Fix windows build

This commit is contained in:
craig.p.drummond
2013-10-14 18:12:25 +00:00
committed by craig.p.drummond
parent 072f63feda
commit fafe9df311
7 changed files with 29 additions and 25 deletions

View File

@@ -20,7 +20,11 @@ else(WIN32)
set(QXT-SOURCES ${QXT-SOURCES} qxtglobalshortcut_x11.cpp)
endif(WIN32)
QT4_WRAP_CPP(QXT-SOURCES-MOC ${QXT-MOC-HEADERS})
if (ENABLE_QT5)
QT5_WRAP_CPP(QXT-SOURCES-MOC ${QXT-MOC-HEADERS})
else (ENABLE_QT5)
QT4_WRAP_CPP(QXT-SOURCES-MOC ${QXT-MOC-HEADERS})
endif (ENABLE_QT5)
ADD_LIBRARY(qxt STATIC
${QXT-SOURCES}

View File

@@ -437,11 +437,12 @@ else (ENABLE_KDE)
QT4_WRAP_CPP(CANTATA_MOC_SRCS ${CANTATA_MOC_HDRS})
endif (ENABLE_QT5)
if (NOT APPLE AND NOT ENABLE_QT5)
if (WIN32 OR APPLE OR NOT ENABLE_QT5)
add_definitions(-DQXT_STATIC)
add_subdirectory(3rdparty/qxt)
include_directories(${CMAKE_SOURCE_DIR}/3rdparty/qxt)
set(CANTATA_SRCS ${CANTATA_SRCS} gui/qxtmediakeys.cpp)
endif (NOT APPLE AND NOT ENABLE_QT5)
endif (WIN32 OR APPLE OR NOT ENABLE_QT5)
if (WIN32)
set(CMAKE_BUILD_TYPE "Release")
@@ -473,9 +474,9 @@ else (ENABLE_KDE)
add_subdirectory(3rdparty/qtsingleapplication)
target_link_libraries(cantata qtsingleapplication)
endif (WIN32)
if (NOT APPLE AND NOT ENABLE_QT5)
if (WIN32 OR APPLE OR NOT ENABLE_QT5)
target_link_libraries(cantata qxt)
endif (NOT APPLE AND NOT ENABLE_QT5)
endif (WIN32 OR APPLE OR NOT ENABLE_QT5)
endif (ENABLE_KDE)
if (ENABLE_HTTP_STREAM_PLAYBACK AND NOT ENABLE_QT5)
@@ -548,7 +549,7 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
if (WIN32)
set(DIR_SEPARATOR "\\")
set(DIR_SEPARATOR "\\\\")
else (WIN32)
set(DIR_SEPARATOR "/")
endif (WIN32)

View File

@@ -22,12 +22,13 @@
*/
#include "mediakeys.h"
#if !defined Q_OS_WIN && !defined Q_OS_MAC
#ifdef QT_QTDBUS_FOUND
#include "gnomemediakeys.h"
#endif
#ifdef QT_QTDBUS_FOUND
#ifdef CANTATA_USE_QXT_MEDIAKEYS
#include "qxtmediakeys.h"
#endif
#include "multimediakeysinterface.h"
#include "stdactions.h"
#include "settings.h"
#ifdef ENABLE_KDE_SUPPORT
@@ -90,14 +91,14 @@ MediaKeys::MediaKeys()
gnome=0;
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
qxt=0;
#endif
}
MediaKeys::~MediaKeys()
{
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
if (qxt) {
delete qxt;
}
@@ -119,7 +120,7 @@ void MediaKeys::load()
}
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
if (qxt && qxt->isEnabled()) {
current=QxtInterface;
}
@@ -137,7 +138,7 @@ void MediaKeys::load()
}
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
if (qxt && QxtInterface==current) {
disable(qxt);
qxt->deleteLater();
@@ -154,7 +155,7 @@ void MediaKeys::load()
}
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
if (QxtInterface==configured) {
if (!qxt) {
qxt=new QxtMediaKeys(0);
@@ -174,7 +175,7 @@ void MediaKeys::stop()
}
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
if (qxt) {
disable(qxt);
qxt->deleteLater();
@@ -206,3 +207,4 @@ void MediaKeys::disable(MultiMediaKeysInterface *iface)
QObject::disconnect(iface, SIGNAL(previous()), StdActions::self()->prevTrackAction, SIGNAL(triggered()));
iface->setEnabled(false);
}

View File

@@ -31,6 +31,10 @@ class GnomeMediaKeys;
class QxtMediaKeys;
class MultiMediaKeysInterface;
#if defined Q_OS_WIN || defined Q_OS_MAC || QT_VERSION < 0x050000
#define CANTATA_USE_QXT_MEDIAKEYS
#endif
class MediaKeys
{
public:
@@ -58,7 +62,7 @@ private:
#ifdef QT_QTDBUS_FOUND
GnomeMediaKeys *gnome;
#endif
#if !defined Q_OS_MAC && QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
QxtMediaKeys *qxt;
#endif
};

View File

@@ -51,19 +51,16 @@ ShortcutsSettingsPage::ShortcutsSettingsPage(QWidget *p)
shortcuts->view()->setItemDelegate(new BasicItemDelegate(shortcuts->view()));
lay->addWidget(shortcuts);
#if !defined Q_OS_MAC
#if QT_VERSION < 0x050000 || !defined Q_OS_WIN
QGroupBox *box=new QGroupBox(i18n("Multi-Media Keys"));
QBoxLayout *boxLay=new QBoxLayout(QBoxLayout::LeftToRight, box);
mediaKeysIfaceCombo=new QComboBox(box);
boxLay->addWidget(mediaKeysIfaceCombo);
mediaKeysIfaceCombo->addItem(i18n("Disabled"), (unsigned int)MediaKeys::NoInterface);
#if QT_VERSION < 0x050000
#ifdef CANTATA_USE_QXT_MEDIAKEYS
mediaKeysIfaceCombo->addItem(i18n("Enabled"), (unsigned int)MediaKeys::QxtInterface);
#endif
#if !defined Q_OS_WIN
#if !defined Q_OS_WIN && !defined Q_OS_MAC
QByteArray desktop=qgetenv("XDG_CURRENT_DESKTOP");
mediaKeysIfaceCombo->addItem(desktop=="Unity" || desktop=="GNOME"
? i18n("Use desktop settings")
@@ -78,9 +75,6 @@ ShortcutsSettingsPage::ShortcutsSettingsPage(QWidget *p)
#endif
lay->addWidget(box);
#endif // QT_VERSION < 0x050000 || !defined Q_OS_WIN
#endif // !defined Q_OS_MAC
}
void ShortcutsSettingsPage::load()

View File

@@ -25,7 +25,6 @@
#include "buddylabel.h"
#include "pathrequester.h"
#include "settings.h"
#include "onoffbutton.h"
#include "localize.h"
#include "utils.h"
#include <QComboBox>

View File

@@ -25,11 +25,11 @@
#define PODCAST_SETTINGS_DIALOG_H
#include "dialog.h"
#include "onoffbutton.h"
#include "config.h"
class QComboBox;
class PathRequester;
class OnOffButton;
class PodcastSettingsDialog : public Dialog
{