mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Q_OS_X11 macro is invalid in both Qt 4 & 5.
- so for now, use just Q_WS_X11
This commit is contained in:
parent
84ec408669
commit
7b21bf61f1
6
src/lib/3rdparty/processinfo.cpp
vendored
6
src/lib/3rdparty/processinfo.cpp
vendored
@ -17,7 +17,7 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "processinfo.h"
|
#include "processinfo.h"
|
||||||
|
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -37,7 +37,7 @@ ProcessInfo::ProcessInfo(const QString &name)
|
|||||||
|
|
||||||
bool ProcessInfo::isRunning() const
|
bool ProcessInfo::isRunning() const
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
pid_t pid = GetPIDbyName(qPrintable(m_name));
|
pid_t pid = GetPIDbyName(qPrintable(m_name));
|
||||||
// -1 = process not found
|
// -1 = process not found
|
||||||
// -2 = /proc fs access error
|
// -2 = /proc fs access error
|
||||||
@ -47,7 +47,7 @@ bool ProcessInfo::isRunning() const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
bool ProcessInfo::IsNumeric(const char* ccharptr_CharacterList) const
|
bool ProcessInfo::IsNumeric(const char* ccharptr_CharacterList) const
|
||||||
{
|
{
|
||||||
for (; *ccharptr_CharacterList; ccharptr_CharacterList++) {
|
for (; *ccharptr_CharacterList; ccharptr_CharacterList++) {
|
||||||
|
2
src/lib/3rdparty/processinfo.h
vendored
2
src/lib/3rdparty/processinfo.h
vendored
@ -35,7 +35,7 @@ public:
|
|||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
bool IsNumeric(const char* ccharptr_CharacterList) const;
|
bool IsNumeric(const char* ccharptr_CharacterList) const;
|
||||||
|
|
||||||
pid_t GetPIDbyName(const char* cchrptr_ProcessName) const;
|
pid_t GetPIDbyName(const char* cchrptr_ProcessName) const;
|
||||||
|
2
src/lib/3rdparty/qtsingleapplication.cpp
vendored
2
src/lib/3rdparty/qtsingleapplication.cpp
vendored
@ -193,7 +193,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char** argv, Type type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_OS_X11)
|
#if defined(Q_WS_X11)
|
||||||
/*!
|
/*!
|
||||||
Special constructor for X11, ref. the documentation of
|
Special constructor for X11, ref. the documentation of
|
||||||
QApplication's corresponding constructor. The application identifier
|
QApplication's corresponding constructor. The application identifier
|
||||||
|
2
src/lib/3rdparty/qtsingleapplication.h
vendored
2
src/lib/3rdparty/qtsingleapplication.h
vendored
@ -73,7 +73,7 @@ public:
|
|||||||
QtSingleApplication(int &argc, char** argv, bool GUIenabled = true);
|
QtSingleApplication(int &argc, char** argv, bool GUIenabled = true);
|
||||||
QtSingleApplication(const QString &id, int &argc, char** argv);
|
QtSingleApplication(const QString &id, int &argc, char** argv);
|
||||||
QtSingleApplication(int &argc, char** argv, Type type);
|
QtSingleApplication(int &argc, char** argv, Type type);
|
||||||
#if defined(Q_OS_X11)
|
#if defined(Q_WS_X11)
|
||||||
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
||||||
QtSingleApplication(Display* dpy, int &argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0);
|
QtSingleApplication(Display* dpy, int &argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0);
|
||||||
QtSingleApplication(Display* dpy, const QString &appId, int argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
QtSingleApplication(Display* dpy, const QString &appId, int argc, char** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
||||||
|
@ -94,7 +94,7 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||||||
, m_startingAfterCrash(false)
|
, m_startingAfterCrash(false)
|
||||||
, m_databaseConnected(false)
|
, m_databaseConnected(false)
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_X11) && !defined(NO_SYSTEM_DATAPATH)
|
#if defined(Q_WS_X11) && !defined(NO_SYSTEM_DATAPATH)
|
||||||
DATADIR = USE_DATADIR;
|
DATADIR = USE_DATADIR;
|
||||||
#else
|
#else
|
||||||
DATADIR = qApp->applicationDirPath() + "/";
|
DATADIR = qApp->applicationDirPath() + "/";
|
||||||
@ -301,7 +301,7 @@ void MainApplication::loadSettings()
|
|||||||
cssFile.open(QFile::ReadOnly);
|
cssFile.open(QFile::ReadOnly);
|
||||||
QString css = cssFile.readAll();
|
QString css = cssFile.readAll();
|
||||||
cssFile.close();
|
cssFile.close();
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
if (QFile(m_activeThemePath + "linux.css").exists()) {
|
if (QFile(m_activeThemePath + "linux.css").exists()) {
|
||||||
cssFile.setFileName(m_activeThemePath + "linux.css");
|
cssFile.setFileName(m_activeThemePath + "linux.css");
|
||||||
cssFile.open(QFile::ReadOnly);
|
cssFile.open(QFile::ReadOnly);
|
||||||
|
@ -115,7 +115,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
|||||||
|
|
||||||
m_isStarting = true;
|
m_isStarting = true;
|
||||||
|
|
||||||
#ifndef Q_OS_X11
|
#ifndef Q_WS_X11
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
|||||||
|
|
||||||
void QupZilla::postLaunch()
|
void QupZilla::postLaunch()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ void QupZilla::setupMenu()
|
|||||||
m_menuEdit->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &All"), this, SLOT(editSelectAll()))->setShortcut(QKeySequence("Ctrl+A"));
|
m_menuEdit->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &All"), this, SLOT(editSelectAll()))->setShortcut(QKeySequence("Ctrl+A"));
|
||||||
m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("&Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F"));
|
m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("&Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F"));
|
||||||
m_menuEdit->addSeparator();
|
m_menuEdit->addSeparator();
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
m_menuEdit->addAction(m_actionPreferences);
|
m_menuEdit->addAction(m_actionPreferences);
|
||||||
#endif
|
#endif
|
||||||
connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
|
connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
|
||||||
@ -465,7 +465,7 @@ void QupZilla::setupMenu()
|
|||||||
connect(m_actionPrivateBrowsing, SIGNAL(triggered(bool)), mApp, SLOT(startPrivateBrowsing()));
|
connect(m_actionPrivateBrowsing, SIGNAL(triggered(bool)), mApp, SLOT(startPrivateBrowsing()));
|
||||||
m_menuTools->addAction(m_actionPrivateBrowsing);
|
m_menuTools->addAction(m_actionPrivateBrowsing);
|
||||||
m_menuTools->addSeparator();
|
m_menuTools->addSeparator();
|
||||||
#if !defined(Q_OS_X11) && !defined(Q_OS_MAC)
|
#if !defined(Q_WS_X11) && !defined(Q_OS_MAC)
|
||||||
m_menuTools->addAction(m_actionPreferences);
|
m_menuTools->addAction(m_actionPreferences);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ void QupZilla::loadSettings()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Opacity
|
//Opacity
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
setAttribute(Qt::WA_TranslucentBackground);
|
setAttribute(Qt::WA_TranslucentBackground);
|
||||||
setAttribute(Qt::WA_NoSystemBackground, false);
|
setAttribute(Qt::WA_NoSystemBackground, false);
|
||||||
QPalette pal = palette();
|
QPalette pal = palette();
|
||||||
|
@ -84,7 +84,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#define DEFAULT_THEME_NAME "windows"
|
#define DEFAULT_THEME_NAME "windows"
|
||||||
#elif defined(Q_OS_X11)
|
#elif defined(Q_WS_X11)
|
||||||
#define DEFAULT_THEME_NAME "linux"
|
#define DEFAULT_THEME_NAME "linux"
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
#define DEFAULT_THEME_NAME "mac"
|
#define DEFAULT_THEME_NAME "mac"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ void DesktopNotificationsFactory::loadSettings()
|
|||||||
settings.beginGroup("Notifications");
|
settings.beginGroup("Notifications");
|
||||||
m_enabled = settings.value("Enabled", true).toBool();
|
m_enabled = settings.value("Enabled", true).toBool();
|
||||||
m_timeout = settings.value("Timeout", 6000).toInt();
|
m_timeout = settings.value("Timeout", 6000).toInt();
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
m_notifType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNative : PopupWidget;
|
m_notifType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNative : PopupWidget;
|
||||||
#else
|
#else
|
||||||
m_notifType = PopupWidget;
|
m_notifType = PopupWidget;
|
||||||
@ -51,7 +51,7 @@ void DesktopNotificationsFactory::loadSettings()
|
|||||||
|
|
||||||
bool DesktopNotificationsFactory::supportsNativeNotifications() const
|
bool DesktopNotificationsFactory::supportsNativeNotifications() const
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
@ -77,7 +77,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
|||||||
m_desktopNotif.data()->show();
|
m_desktopNotif.data()->show();
|
||||||
break;
|
break;
|
||||||
case DesktopNative:
|
case DesktopNative:
|
||||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||||
QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
|
QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
|
||||||
tmp.open(QFile::WriteOnly);
|
tmp.open(QFile::WriteOnly);
|
||||||
icon.save(tmp.fileName());
|
icon.save(tmp.fileName());
|
||||||
@ -104,7 +104,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
|||||||
|
|
||||||
void DesktopNotificationsFactory::nativeNotificationPreview()
|
void DesktopNotificationsFactory::nativeNotificationPreview()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||||
QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
|
QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
|
||||||
tmp.open(QFile::WriteOnly);
|
tmp.open(QFile::WriteOnly);
|
||||||
QPixmap(":icons/preferences/dialog-question.png").save(tmp.fileName());
|
QPixmap(":icons/preferences/dialog-question.png").save(tmp.fileName());
|
||||||
|
@ -394,7 +394,7 @@ QString QupZillaSchemeReply::configPage()
|
|||||||
#if defined(Q_OS_WIN) && defined(W7API)
|
#if defined(Q_OS_WIN) && defined(W7API)
|
||||||
w7APIEnabled = tr("<b>Enabled</b>");
|
w7APIEnabled = tr("<b>Enabled</b>");
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_X11) && defined(KDE)
|
#if defined(Q_WS_X11) && defined(KDE)
|
||||||
KDEIntegration = tr("<b>Enabled</b>");
|
KDEIntegration = tr("<b>Enabled</b>");
|
||||||
#endif
|
#endif
|
||||||
#ifdef PORTABLE_BUILD
|
#ifdef PORTABLE_BUILD
|
||||||
|
@ -163,7 +163,7 @@ void Plugins::loadAvailablePlugins()
|
|||||||
|
|
||||||
QStringList dirs;
|
QStringList dirs;
|
||||||
dirs << mApp->DATADIR + "plugins/"
|
dirs << mApp->DATADIR + "plugins/"
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
#ifdef USE_LIBPATH
|
#ifdef USE_LIBPATH
|
||||||
<< USE_LIBPATH "qupzilla/"
|
<< USE_LIBPATH "qupzilla/"
|
||||||
#else
|
#else
|
||||||
|
@ -309,7 +309,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||||||
DesktopNotificationsFactory::Type notifyType;
|
DesktopNotificationsFactory::Type notifyType;
|
||||||
settings.beginGroup("Notifications");
|
settings.beginGroup("Notifications");
|
||||||
ui->notificationTimeout->setValue(settings.value("Timeout", 6000).toInt() / 1000);
|
ui->notificationTimeout->setValue(settings.value("Timeout", 6000).toInt() / 1000);
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
notifyType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNotificationsFactory::DesktopNative : DesktopNotificationsFactory::PopupWidget;
|
notifyType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNotificationsFactory::DesktopNative : DesktopNotificationsFactory::PopupWidget;
|
||||||
#else
|
#else
|
||||||
notifyType = DesktopNotificationsFactory::PopupWidget;
|
notifyType = DesktopNotificationsFactory::PopupWidget;
|
||||||
|
@ -61,7 +61,7 @@ RSSNotification::RSSNotification(const QString &title, const QUrl &url, WebView*
|
|||||||
<< RssApp("Netvibes", "http://www.netvibes.com/subscribe.php?url=", QIcon(":/icons/sites/netvibes.png"))
|
<< RssApp("Netvibes", "http://www.netvibes.com/subscribe.php?url=", QIcon(":/icons/sites/netvibes.png"))
|
||||||
<< RssApp("Yahoo!", "http://add.my.yahoo.com/rss?url=", QIcon(":/icons/sites/yahoo.png"));
|
<< RssApp("Yahoo!", "http://add.my.yahoo.com/rss?url=", QIcon(":/icons/sites/yahoo.png"));
|
||||||
|
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
if (QFile("/usr/bin/akregator").exists()) {
|
if (QFile("/usr/bin/akregator").exists()) {
|
||||||
m_rssApps << RssApp("Akregator", "/usr/bin/akregator -a ", QIcon(":/icons/sites/akregator.png"), DesktopApplication);
|
m_rssApps << RssApp("Akregator", "/usr/bin/akregator -a ", QIcon(":/icons/sites/akregator.png"), DesktopApplication);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ QIcon IconProvider::standardIcon(QStyle::StandardPixmap icon)
|
|||||||
case QStyle::SP_MessageBoxWarning:
|
case QStyle::SP_MessageBoxWarning:
|
||||||
return QIcon::fromTheme("dialog-warning", mApp->style()->standardIcon(QStyle::SP_MessageBoxWarning));
|
return QIcon::fromTheme("dialog-warning", mApp->style()->standardIcon(QStyle::SP_MessageBoxWarning));
|
||||||
|
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
default:
|
default:
|
||||||
return mApp->style()->standardIcon(icon);
|
return mApp->style()->standardIcon(icon);
|
||||||
#else
|
#else
|
||||||
|
@ -111,7 +111,7 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
QT_REQUIRE_VERSION(argc, argv, "4.7.0");
|
QT_REQUIRE_VERSION(argc, argv, "4.7.0");
|
||||||
|
|
||||||
#ifdef Q_OS_X11
|
#ifdef Q_WS_X11
|
||||||
QApplication::setGraphicsSystem("raster"); // Better overall performance on X11
|
QApplication::setGraphicsSystem("raster"); // Better overall performance on X11
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user