mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-10 13:54:23 +00:00
- Fixed compilation warning in main.cpp
- Removed use of Qt3 backport headers in ico.cpp
This commit is contained in:
parent
78409570a9
commit
70e2a5d3b3
12
src/ico.cpp
12
src/ico.cpp
@ -6,13 +6,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// remove when QImage::jumpTable is ported
|
|
||||||
#define QT3_SUPPORT
|
|
||||||
#define QT3_SUPPORT_WARNINGS
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#warning TODO: remove QT3_SUPPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -185,12 +178,11 @@ namespace
|
|||||||
unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
|
unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
|
||||||
|
|
||||||
unsigned char* buf = new unsigned char[ bpl ];
|
unsigned char* buf = new unsigned char[ bpl ];
|
||||||
unsigned char** lines = icon.jumpTable();
|
|
||||||
for ( unsigned y = rec.height; !stream.atEnd() && y--; )
|
for ( unsigned y = rec.height; !stream.atEnd() && y--; )
|
||||||
{
|
{
|
||||||
stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
|
stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
|
||||||
unsigned char* pixel = buf;
|
unsigned char* pixel = buf;
|
||||||
QRgb* p = reinterpret_cast< QRgb* >( lines[ y ] );
|
QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine(y));
|
||||||
switch ( header.biBitCount )
|
switch ( header.biBitCount )
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -232,7 +224,7 @@ namespace
|
|||||||
for ( unsigned y = rec.height; y--; )
|
for ( unsigned y = rec.height; y--; )
|
||||||
{
|
{
|
||||||
stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
|
stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
|
||||||
QRgb* p = reinterpret_cast< QRgb* >( lines[ y ] );
|
QRgb* p = reinterpret_cast< QRgb* >(icon.scanLine(y));
|
||||||
for ( unsigned x = 0; x < rec.width; ++x, ++p )
|
for ( unsigned x = 0; x < rec.width; ++x, ++p )
|
||||||
if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
|
if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
|
||||||
*p &= RGB_MASK;
|
*p &= RGB_MASK;
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
@ -96,7 +95,7 @@ int main(int argc, char *argv[]){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set environment variable
|
// Set environment variable
|
||||||
if(putenv("QBITTORRENT="VERSION)){
|
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
||||||
std::cerr << "Couldn't set environment variable...\n";
|
std::cerr << "Couldn't set environment variable...\n";
|
||||||
}
|
}
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user