mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36: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"
|
||||
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
@ -37,7 +37,7 @@ ProcessInfo::ProcessInfo(const QString &name)
|
||||
|
||||
bool ProcessInfo::isRunning() const
|
||||
{
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
pid_t pid = GetPIDbyName(qPrintable(m_name));
|
||||
// -1 = process not found
|
||||
// -2 = /proc fs access error
|
||||
@ -47,7 +47,7 @@ bool ProcessInfo::isRunning() const
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
bool ProcessInfo::IsNumeric(const char* ccharptr_CharacterList) const
|
||||
{
|
||||
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;
|
||||
|
||||
private:
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
bool IsNumeric(const char* ccharptr_CharacterList) 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
|
||||
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(const QString &id, int &argc, char** argv);
|
||||
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, 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);
|
||||
|
@ -94,7 +94,7 @@ MainApplication::MainApplication(int &argc, char** argv)
|
||||
, m_startingAfterCrash(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;
|
||||
#else
|
||||
DATADIR = qApp->applicationDirPath() + "/";
|
||||
@ -301,7 +301,7 @@ void MainApplication::loadSettings()
|
||||
cssFile.open(QFile::ReadOnly);
|
||||
QString css = cssFile.readAll();
|
||||
cssFile.close();
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
if (QFile(m_activeThemePath + "linux.css").exists()) {
|
||||
cssFile.setFileName(m_activeThemePath + "linux.css");
|
||||
cssFile.open(QFile::ReadOnly);
|
||||
|
@ -115,7 +115,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
||||
|
||||
m_isStarting = true;
|
||||
|
||||
#ifndef Q_OS_X11
|
||||
#ifndef Q_WS_X11
|
||||
setUpdatesEnabled(false);
|
||||
#endif
|
||||
|
||||
@ -128,7 +128,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
||||
|
||||
void QupZilla::postLaunch()
|
||||
{
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
setUpdatesEnabled(false);
|
||||
#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-find"), tr("&Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F"));
|
||||
m_menuEdit->addSeparator();
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
m_menuEdit->addAction(m_actionPreferences);
|
||||
#endif
|
||||
connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
|
||||
@ -465,7 +465,7 @@ void QupZilla::setupMenu()
|
||||
connect(m_actionPrivateBrowsing, SIGNAL(triggered(bool)), mApp, SLOT(startPrivateBrowsing()));
|
||||
m_menuTools->addAction(m_actionPrivateBrowsing);
|
||||
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);
|
||||
#endif
|
||||
|
||||
@ -607,7 +607,7 @@ void QupZilla::loadSettings()
|
||||
return;
|
||||
}
|
||||
//Opacity
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
setAttribute(Qt::WA_NoSystemBackground, false);
|
||||
QPalette pal = palette();
|
||||
|
@ -84,7 +84,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define DEFAULT_THEME_NAME "windows"
|
||||
#elif defined(Q_OS_X11)
|
||||
#elif defined(Q_WS_X11)
|
||||
#define DEFAULT_THEME_NAME "linux"
|
||||
#elif defined(Q_OS_MAC)
|
||||
#define DEFAULT_THEME_NAME "mac"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
||||
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||
#include <QDBusInterface>
|
||||
#endif
|
||||
|
||||
@ -40,7 +40,7 @@ void DesktopNotificationsFactory::loadSettings()
|
||||
settings.beginGroup("Notifications");
|
||||
m_enabled = settings.value("Enabled", true).toBool();
|
||||
m_timeout = settings.value("Timeout", 6000).toInt();
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
m_notifType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNative : PopupWidget;
|
||||
#else
|
||||
m_notifType = PopupWidget;
|
||||
@ -51,7 +51,7 @@ void DesktopNotificationsFactory::loadSettings()
|
||||
|
||||
bool DesktopNotificationsFactory::supportsNativeNotifications() const
|
||||
{
|
||||
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
|
||||
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
@ -77,7 +77,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
||||
m_desktopNotif.data()->show();
|
||||
break;
|
||||
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");
|
||||
tmp.open(QFile::WriteOnly);
|
||||
icon.save(tmp.fileName());
|
||||
@ -104,7 +104,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
||||
|
||||
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");
|
||||
tmp.open(QFile::WriteOnly);
|
||||
QPixmap(":icons/preferences/dialog-question.png").save(tmp.fileName());
|
||||
|
@ -394,7 +394,7 @@ QString QupZillaSchemeReply::configPage()
|
||||
#if defined(Q_OS_WIN) && defined(W7API)
|
||||
w7APIEnabled = tr("<b>Enabled</b>");
|
||||
#endif
|
||||
#if defined(Q_OS_X11) && defined(KDE)
|
||||
#if defined(Q_WS_X11) && defined(KDE)
|
||||
KDEIntegration = tr("<b>Enabled</b>");
|
||||
#endif
|
||||
#ifdef PORTABLE_BUILD
|
||||
|
@ -163,7 +163,7 @@ void Plugins::loadAvailablePlugins()
|
||||
|
||||
QStringList dirs;
|
||||
dirs << mApp->DATADIR + "plugins/"
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
#ifdef USE_LIBPATH
|
||||
<< USE_LIBPATH "qupzilla/"
|
||||
#else
|
||||
|
@ -309,7 +309,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
||||
DesktopNotificationsFactory::Type notifyType;
|
||||
settings.beginGroup("Notifications");
|
||||
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;
|
||||
#else
|
||||
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("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()) {
|
||||
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:
|
||||
return QIcon::fromTheme("dialog-warning", mApp->style()->standardIcon(QStyle::SP_MessageBoxWarning));
|
||||
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
default:
|
||||
return mApp->style()->standardIcon(icon);
|
||||
#else
|
||||
|
@ -111,7 +111,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
QT_REQUIRE_VERSION(argc, argv, "4.7.0");
|
||||
|
||||
#ifdef Q_OS_X11
|
||||
#ifdef Q_WS_X11
|
||||
QApplication::setGraphicsSystem("raster"); // Better overall performance on X11
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user