From 092e0d9aa0d95e925c3d3bf97bb445def1e3b7bb Mon Sep 17 00:00:00 2001 From: codestation Date: Mon, 16 Sep 2013 00:46:43 -0430 Subject: [PATCH] Added Windows icon. Use a 16x16 tray icon under Windows. Fix disk space funcion under Windows. --- mainwidget.cpp | 4 ++++ qcma.pro | 5 ++++- qcma.rc | 1 + qcmares.qrc | 1 + resources/psv_icon_16.png | Bin 0 -> 344 bytes utils.cpp | 2 +- 6 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 qcma.rc create mode 100644 resources/psv_icon_16.png diff --git a/mainwidget.cpp b/mainwidget.cpp index 17f940c..08d68e7 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -129,7 +129,11 @@ void MainWidget::createTrayIcon() trayIcon = new QSystemTrayIcon(this); trayIcon->setContextMenu(trayIconMenu); +#ifndef Q_OS_WIN32 trayIcon->setIcon(QIcon(":/main/resources/psv_icon.png")); +#else + trayIcon->setIcon(QIcon(":/main/resources/psv_icon_16.png")); +#endif trayIcon->show(); // try to avoid the iconTray Qt bug Sleeper::sleep(1); diff --git a/qcma.pro b/qcma.pro index 4c9ec1f..31aab85 100644 --- a/qcma.pro +++ b/qcma.pro @@ -67,7 +67,8 @@ OTHER_FILES += \ resources/psp2-updatelist.xml \ resources/psv_icon.png \ README.md \ - qcma.desktop + qcma.desktop \ + qcma.rc FORMS += \ configwidget.ui \ @@ -96,3 +97,5 @@ unix { target.path = $$BINDIR INSTALLS += target desktop icon64 } + +win32:RC_FILE = qcma.rc diff --git a/qcma.rc b/qcma.rc new file mode 100644 index 0000000..0a048b1 --- /dev/null +++ b/qcma.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "resources/qcma.ico" diff --git a/qcmares.qrc b/qcmares.qrc index d49c186..2475b76 100644 --- a/qcmares.qrc +++ b/qcmares.qrc @@ -3,5 +3,6 @@ resources/psp2-updatelist.xml resources/psv_icon.png resources/translations/qcma.es.qm + resources/psv_icon_16.png diff --git a/resources/psv_icon_16.png b/resources/psv_icon_16.png new file mode 100644 index 0000000000000000000000000000000000000000..1784d0a800eb1ca48454272be9285176cf1b697a GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTK0E?OF^V_+mK%u9eE{-7W)fQBD;?mKz(96fx`{G{6Cvpz<< znblWJ%~-qM>#LJ04rq@4NlI*5>@;+}k(U>^|G5`v&h?ciZIrXP-b3mq3?EDoh`8BBup< z&0Mw0tp0*YFJsT^U2Gbn1$;J)zjaQ(QQ+uPlW1$)q{DweyI^hI6-nmp2aX3#|MTfp ks>}nvis)NEzW-qA@M}N*aLUV4pobYeUHx3vIVCg!0Mn_7TmS$7 literal 0 HcmV?d00001 diff --git a/utils.cpp b/utils.cpp index db134a4..6647340 100644 --- a/utils.cpp +++ b/utils.cpp @@ -35,7 +35,7 @@ bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total) { #ifdef Q_OS_WIN32 - if(GetDiskFreeSpaceExW(dir.toStdWString().c_str(), free, total, NULL) != 0) { + if(GetDiskFreeSpaceEx(dir.toStdWString().c_str(), (ULARGE_INTEGER *)free, (ULARGE_INTEGER *)total, NULL) != 0) { return true; }