1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Qt5: Changing Q_WS_* macros to Q_OS_*

- Q_WS_* macros have been removed in Qt 5
This commit is contained in:
nowrep 2012-09-03 22:48:52 +02:00
parent c71cf910cb
commit c7cdaf824f
33 changed files with 95 additions and 95 deletions

View File

@ -436,7 +436,7 @@ void FancyTabBar::paintTab(QPainter* painter, int tabIndex) const
int textFlags = Qt::AlignCenter | Qt::AlignBottom;
painter->drawText(tabTextRect, textFlags, tabText);
painter->setPen(selected ? QColor(60, 60, 60) : Utils::StyleHelper::panelTextColor());
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
if (!selected) {
painter->save();
int fader = int(m_tabs[tabIndex]->fader());

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "processinfo.h"
#ifdef Q_WS_X11
#ifdef Q_OS_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_WS_X11
#ifdef Q_OS_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_WS_X11
#ifdef Q_OS_X11
bool ProcessInfo::IsNumeric(const char* ccharptr_CharacterList) const
{
for (; *ccharptr_CharacterList; ccharptr_CharacterList++) {

View File

@ -35,7 +35,7 @@ public:
bool isRunning() const;
private:
#ifdef Q_WS_X11
#ifdef Q_OS_X11
bool IsNumeric(const char* ccharptr_CharacterList) const;
pid_t GetPIDbyName(const char* cchrptr_ProcessName) const;

View File

@ -193,7 +193,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char** argv, Type type)
}
#if defined(Q_WS_X11)
#if defined(Q_OS_X11)
/*!
Special constructor for X11, ref. the documentation of
QApplication's corresponding constructor. The application identifier

View File

@ -49,7 +49,7 @@
class QtLocalPeer;
#if defined(Q_WS_WIN)
#if defined(Q_OS_WIN)
# if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT)
# define QT_QTSINGLEAPPLICATION_EXPORT
# elif defined(QT_QTSINGLEAPPLICATION_IMPORT)
@ -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_WS_X11)
#if defined(Q_OS_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);

View File

@ -32,7 +32,7 @@
#include "history.h"
#include "mainapplication.h"
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#include <qt_windows.h>
// Blur behind data structures
@ -114,7 +114,7 @@ static bool resolveLibs()
*/
bool QtWin::isRunningWindows7()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
return QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7;
#else
return false;
@ -133,7 +133,7 @@ bool QtWin::isRunningWindows7()
*/
bool QtWin::isCompositionEnabled()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (resolveLibs()) {
HRESULT hr = S_OK;
BOOL isEnabled = false;
@ -157,7 +157,7 @@ bool QtWin::enableBlurBehindWindow(QWidget* widget, bool enable)
Q_UNUSED(widget);
Q_ASSERT(widget);
bool result = false;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (resolveLibs()) {
DWM_BLURBEHIND bb = {0};
HRESULT hr = S_OK;
@ -200,7 +200,7 @@ bool QtWin::extendFrameIntoClientArea(QWidget* widget, int left, int top, int ri
Q_UNUSED(widget);
bool result = false;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (resolveLibs()) {
QLibrary dwmLib(QString::fromAscii("dwmapi"));
HRESULT hr = S_OK;
@ -226,7 +226,7 @@ QColor QtWin::colorizationColor()
{
QColor resultColor = QApplication::palette().window().color();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (resolveLibs()) {
DWORD color = 0;
BOOL opaque = FALSE;
@ -241,7 +241,7 @@ QColor QtWin::colorizationColor()
return resultColor;
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
WindowNotifier* QtWin::windowNotifier()
{
static WindowNotifier* windowNotifierInstance = 0;
@ -371,7 +371,7 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList)
obj_collection->Release();
}
#endif //W7API
#endif //Q_WS_WIN
#endif //Q_OS_WIN
void QtWin::setupJumpList()
{

View File

@ -37,7 +37,7 @@
* functionality on Windows 7 and Windows Vista. On other platforms
* these functions will simply not do anything.
*/
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#ifdef W7API
#include <ShlObj.h>
#include <shlwapi.h>

View File

@ -50,7 +50,7 @@ namespace Utils
qreal StyleHelper::sidebarFontSize()
{
#if defined(Q_WS_MAC)
#if defined(Q_OS_MAC)
return 10;
#else
return 7.5;

View File

@ -51,7 +51,7 @@
#include "restoremanager.h"
#include "proxystyle.h"
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
#include <QFileOpenEvent>
#endif
#include <QWebSecurityOrigin>
@ -94,13 +94,13 @@ MainApplication::MainApplication(int &argc, char** argv)
, m_startingAfterCrash(false)
, m_databaseConnected(false)
{
#if defined(Q_WS_X11) && !defined(NO_SYSTEM_DATAPATH)
#if defined(Q_OS_X11) && !defined(NO_SYSTEM_DATAPATH)
DATADIR = USE_DATADIR;
#else
DATADIR = qApp->applicationDirPath() + "/";
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
DATADIR.append("../Resources/");
#endif
@ -197,7 +197,7 @@ MainApplication::MainApplication(int &argc, char** argv)
return;
}
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
setQuitOnLastWindowClosed(false);
#else
setQuitOnLastWindowClosed(true);
@ -265,7 +265,7 @@ MainApplication::MainApplication(int &argc, char** argv)
}
QTimer::singleShot(0, this, SLOT(postLaunch()));
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
QTimer::singleShot(10 * 1000, this, SLOT(setupJumpList()));
#endif
}
@ -301,7 +301,7 @@ void MainApplication::loadSettings()
cssFile.open(QFile::ReadOnly);
QString css = cssFile.readAll();
cssFile.close();
#ifdef Q_WS_X11
#ifdef Q_OS_X11
if (QFile(m_activeThemePath + "linux.css").exists()) {
cssFile.setFileName(m_activeThemePath + "linux.css");
cssFile.open(QFile::ReadOnly);
@ -309,7 +309,7 @@ void MainApplication::loadSettings()
cssFile.close();
}
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
if (QFile(m_activeThemePath + "mac.css").exists()) {
cssFile.setFileName(m_activeThemePath + "mac.css");
cssFile.open(QFile::ReadOnly);
@ -317,7 +317,7 @@ void MainApplication::loadSettings()
cssFile.close();
}
#endif
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
if (QFile(m_activeThemePath + "windows.css").exists()) {
cssFile.setFileName(m_activeThemePath + "windows.css");
cssFile.open(QFile::ReadOnly);
@ -547,7 +547,7 @@ QupZilla* MainApplication::makeNewWindow(Qz::BrowserWindow type, const QUrl &sta
return newWindow;
}
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
bool MainApplication::event(QEvent* e)
{
switch (e->type()) {

View File

@ -107,7 +107,7 @@ public:
UserAgentManager* uaManager() { return m_uaManager; }
RestoreManager* restoreManager() { return m_restoreManager; }
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
bool event(QEvent* e);
#endif

View File

@ -97,7 +97,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
, m_startingUrl(startUrl)
, m_startBehaviour(type)
, m_menuBookmarksAction(0)
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
, m_macMenuBar(new QMenuBar())
#endif
, m_actionPrivateBrowsing(0)
@ -115,7 +115,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
m_isStarting = true;
#ifndef Q_WS_X11
#ifndef Q_OS_X11
setUpdatesEnabled(false);
#endif
@ -128,7 +128,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
void QupZilla::postLaunch()
{
#ifdef Q_WS_X11
#ifdef Q_OS_X11
setUpdatesEnabled(false);
#endif
@ -323,7 +323,7 @@ void QupZilla::setupMenu()
m_menuFile->addSeparator();
m_menuFile->addAction(tr("Import bookmarks..."), this, SLOT(showBookmarkImport()));
m_menuFile->addAction(m_actionQuit);
#ifdef Q_WS_MAC // Add standard actions to File Menu (as it won't be ever cleared) and Mac menubar should move them to "application" menu
#ifdef Q_OS_MAC // Add standard actions to File Menu (as it won't be ever cleared) and Mac menubar should move them to "application" menu
m_menuFile->addAction(m_actionAbout);
m_menuFile->addAction(m_actionPreferences);
#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_WS_X11
#ifdef Q_OS_X11
m_menuEdit->addAction(m_actionPreferences);
#endif
connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
@ -363,7 +363,7 @@ void QupZilla::setupMenu()
m_actionShowStatusbar = new QAction(tr("Sta&tus Bar"), this);
m_actionShowStatusbar->setCheckable(true);
connect(m_actionShowStatusbar, SIGNAL(triggered(bool)), this, SLOT(showStatusbar()));
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_actionShowMenubar = new QAction(tr("&Menu Bar"), this);
m_actionShowMenubar->setCheckable(true);
connect(m_actionShowMenubar, SIGNAL(triggered(bool)), this, SLOT(showMenubar()));
@ -384,7 +384,7 @@ void QupZilla::setupMenu()
connect(m_menuEncoding, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu()));
QMenu* toolbarsMenu = new QMenu(tr("Toolbars"));
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
toolbarsMenu->addAction(m_actionShowMenubar);
#endif
toolbarsMenu->addAction(m_actionShowToolbar);
@ -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_WS_X11) && !defined(Q_WS_MAC)
#if !defined(Q_OS_X11) && !defined(Q_OS_MAC)
m_menuTools->addAction(m_actionPreferences);
#endif
@ -473,7 +473,7 @@ void QupZilla::setupMenu()
* Help Menu *
*************/
m_menuHelp = new QMenu(tr("&Help"));
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_menuHelp->addAction(QIcon(":/icons/menu/qt.png"), tr("About &Qt"), qApp, SLOT(aboutQt()));
m_menuHelp->addAction(m_actionAbout);
m_menuHelp->addSeparator();
@ -534,7 +534,7 @@ void QupZilla::setupMenu()
addAction(action);
}
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_superMenu->addMenu(m_menuFile);
m_superMenu->addMenu(m_menuEdit);
m_superMenu->addMenu(m_menuView);
@ -581,7 +581,7 @@ void QupZilla::loadSettings()
m_navigationBar->setVisible(showNavigationToolbar);
menuBar()->setVisible(showMenuBar);
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_navigationBar->buttonSuperMenu()->setVisible(!showMenuBar);
#endif
m_navigationBar->buttonHome()->setVisible(showHomeIcon);
@ -595,7 +595,7 @@ void QupZilla::loadSettings()
//Private browsing
m_privateBrowsing->setVisible(mApp->isPrivateSession());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (m_usingTransparentBackground && !makeTransparent) {
QtWin::extendFrameIntoClientArea(this, 0, 0, 0, 0);
QtWin::enableBlurBehindWindow(this, false);
@ -607,7 +607,7 @@ void QupZilla::loadSettings()
return;
}
//Opacity
#ifdef Q_WS_X11
#ifdef Q_OS_X11
setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_NoSystemBackground, false);
QPalette pal = palette();
@ -619,7 +619,7 @@ void QupZilla::loadSettings()
setAttribute(Qt::WA_StyledBackground, false);
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
setContentsMargins(0, 0, 0, 0);
@ -647,7 +647,7 @@ void QupZilla::goBack()
QMenuBar* QupZilla::menuBar() const
{
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
return m_macMenuBar;
#else
return QMainWindow::menuBar();
@ -920,7 +920,7 @@ void QupZilla::aboutToShowHistoryMostMenu()
void QupZilla::aboutToShowViewMenu()
{
m_actionShowToolbar->setChecked(m_navigationBar->isVisible());
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_actionShowMenubar->setChecked(menuBar()->isVisible());
#endif
m_actionShowStatusbar->setChecked(statusBar()->isVisible());
@ -1238,7 +1238,7 @@ SideBar* QupZilla::addSideBar()
m_mainSplitter->setSizes(QList<int>() << m_sideBarWidth << m_webViewWidth);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
applyBlurToMainWindow();
m_sideBar.data()->installEventFilter(this);
@ -1272,7 +1272,7 @@ void QupZilla::showNavigationToolbar()
void QupZilla::showMenubar()
{
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
if (!m_navigationBar->isVisible() && !m_actionShowMenubar->isChecked()) {
showNavigationToolbar();
}
@ -1310,7 +1310,7 @@ void QupZilla::showWebInspector(bool toggle)
connect(m_tabWidget, SIGNAL(currentChanged(int)), m_webInspectorDock.data(), SLOT(tabChanged()));
addDockWidget(Qt::BottomDockWidgetArea, m_webInspectorDock.data());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
applyBlurToMainWindow();
m_webInspectorDock.data()->installEventFilter(this);
@ -1416,7 +1416,7 @@ void QupZilla::searchOnPage()
m_mainLayout->insertWidget(3, search);
search->focusSearchLine();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
applyBlurToMainWindow();
search->installEventFilter(this);
@ -1480,7 +1480,7 @@ void QupZilla::fullScreen(bool make)
bookmarksToolbar()->hide();
m_navigationBar->hide();
m_tabWidget->getTabBar()->hide();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (m_usingTransparentBackground) {
QtWin::extendFrameIntoClientArea(this, 0, 0, 0 , 0);
QtWin::enableBlurBehindWindow(this, false);
@ -1495,7 +1495,7 @@ void QupZilla::fullScreen(bool make)
m_bookmarksToolbar->setVisible(m_bookmarksToolBarVisible);
m_navigationBar->setVisible(m_navigationVisible);
m_tabWidget->showTabBar();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (m_usingTransparentBackground) {
applyBlurToMainWindow(true);
}
@ -1748,7 +1748,7 @@ void QupZilla::closeEvent(QCloseEvent* event)
m_isClosing = true;
mApp->saveStateSlot();
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
if (mApp->windowCount() == 1) {
if (quitApp()) {
disconnectObjects();
@ -1828,7 +1828,7 @@ bool QupZilla::quitApp()
return true;
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
bool QupZilla::winEvent(MSG* message, long* result)
{
if (message && message->message == WM_DWMCOMPOSITIONCHANGED) {

View File

@ -187,7 +187,7 @@ private slots:
void closeWindow();
bool quitApp();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
void applyBlurToMainWindow(bool force = false);
#endif
@ -201,7 +201,7 @@ private:
void setupMenu();
void disconnectObjects();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
bool winEvent(MSG* message, long* result);
bool eventFilter(QObject* object, QEvent* event);
#endif
@ -229,7 +229,7 @@ private:
Menu* m_menuHistoryMost;
QMenu* m_menuEncoding;
QAction* m_menuBookmarksAction;
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
QMenuBar* m_macMenuBar;
#endif
@ -241,7 +241,7 @@ private:
QAction* m_actionShowToolbar;
QAction* m_actionShowBookmarksToolbar;
QAction* m_actionShowStatusbar;
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
QAction* m_actionShowMenubar;
#endif
QAction* m_actionShowFullScreen;

View File

@ -82,11 +82,11 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define DEFAULT_THEME_NAME "windows"
#elif defined(Q_WS_X11)
#elif defined(Q_OS_X11)
#define DEFAULT_THEME_NAME "linux"
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
#define DEFAULT_THEME_NAME "mac"
#elif defined(Q_OS_OS2)
#define DEFAULT_THEME_NAME "windows"
@ -94,13 +94,13 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
#define DEFAULT_THEME_NAME "default"
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define DEFAULT_CHECK_UPDATES true
#else
#define DEFAULT_CHECK_UPDATES false
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG false
#else
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG true
@ -112,7 +112,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
#define DEFAULT_ENABLE_PLUGINS true
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG false
#else
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG true

View File

@ -240,7 +240,7 @@ bool BookmarksImportDialog::exportedOK()
void BookmarksImportDialog::setFile()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (m_browser == IE) {
QString path = QFileDialog::getExistingDirectory(this, tr("Choose directory..."));
if (!path.isEmpty()) {
@ -287,7 +287,7 @@ void BookmarksImportDialog::setupBrowser(Browser browser)
"This file is usually located in ");
m_browserFileText2 = tr("Please choose this file to begin importing bookmarks.");
m_standardDir =
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
"%APPDATA%/Mozilla/";
#else
"/home/user/.mozilla/firefox/profilename/";
@ -302,7 +302,7 @@ void BookmarksImportDialog::setupBrowser(Browser browser)
"This file is usually located in ");
m_browserFileText2 = tr("Please choose this file to begin importing bookmarks.");
m_standardDir =
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
"%APPDATA%/Chrome/Default/";
#else
"/home/user/.config/chrome/Default/";
@ -318,7 +318,7 @@ void BookmarksImportDialog::setupBrowser(Browser browser)
"This file is usually located in ");
m_browserFileText2 = tr("Please choose this file to begin importing bookmarks.");
m_standardDir =
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
"%APPDATA%/Opera/";
#else
"/home/user/.opera/";

View File

@ -31,7 +31,7 @@ DesktopNotification::DesktopNotification(bool setPosition)
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
flags |= Qt::ToolTip;
#endif
setWindowFlags(flags);

View File

@ -23,7 +23,7 @@
#include <QFile>
#include <QDir>
#if defined(Q_WS_X11) && !defined(DISABLE_DBUS)
#if defined(Q_OS_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_WS_X11
#ifdef Q_OS_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_WS_X11) && !defined(DISABLE_DBUS)
#if defined(Q_OS_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_WS_X11) && !defined(DISABLE_DBUS)
#if defined(Q_OS_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_WS_X11) && !defined(DISABLE_DBUS)
#if defined(Q_OS_X11) && !defined(DISABLE_DBUS)
QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
tmp.open(QFile::WriteOnly);
QPixmap(":icons/preferences/dialog-question.png").save(tmp.fileName());

View File

@ -366,7 +366,7 @@ void DownloadItem::openFile()
void DownloadItem::openFolder()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
QString winFileName = m_path + m_fileName;
winFileName.replace("/", "\\");
QProcess::startDetached("explorer.exe /e,/select,\"" + winFileName + "\"");

View File

@ -42,7 +42,7 @@ DownloadManager::DownloadManager(QWidget* parent)
{
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
ui->setupUi(this);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
QtWin::extendFrameIntoClientArea(this);
}

View File

@ -61,7 +61,7 @@ void LocationCompleterDelegate::paint(QPainter* painter, const QStyleOptionViewI
opt.state &= ~QStyle::State_Selected;
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
const QPalette::ColorRole colorRole = QPalette::Text;
const QPalette::ColorRole colorLinkRole = QPalette::Link;
#else

View File

@ -111,7 +111,7 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent)
m_menuForward = new Menu(this);
m_buttonNext->setMenu(m_menuForward);
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_supMenu = new ToolButton(this);
m_supMenu->setObjectName("navigation-button-supermenu");
m_supMenu->setPopupMode(QToolButton::InstantPopup);
@ -141,7 +141,7 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent)
m_layout->addWidget(m_buttonHome);
m_layout->addWidget(m_buttonAddTab);
m_layout->addWidget(m_navigationSplitter);
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
m_layout->addWidget(m_supMenu);
#endif
m_layout->addWidget(m_exitFullscreen);

View File

@ -94,7 +94,7 @@ void NetworkManager::loadSettings()
settings.endGroup();
m_acceptLanguage = AcceptLanguage::generateHeader(settings.value("Language/acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
// From doc:
// QSslSocket::VerifyNone ... The connection will still be encrypted, and your socket
// will still send its local certificate to the peer if it's requested.
@ -493,7 +493,7 @@ void NetworkManager::loadCertificates()
//CA Certificates
m_caCerts = QSslSocket::defaultCaCertificates();
foreach(const QString & path, m_certPaths) {
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
// Used from Qt 4.7.4 qsslcertificate.cpp and modified because QSslCertificate::fromPath
// is kind of a bugged on Windows, it does work only with full path to cert file
QDirIterator it(path, QDir::Files, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
@ -513,7 +513,7 @@ void NetworkManager::loadCertificates()
#endif
}
//Local Certificates
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
QDirIterator it_(mApp->currentProfilePath() + "certificates", QDir::Files, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
while (it_.hasNext()) {
QString filePath = it_.next();

View File

@ -391,10 +391,10 @@ QString QupZillaSchemeReply::configPage()
#ifdef USE_WEBGL
webGLEnabled = tr("<b>Enabled</b>");
#endif
#if defined(Q_WS_WIN) && defined(W7API)
#if defined(Q_OS_WIN) && defined(W7API)
w7APIEnabled = tr("<b>Enabled</b>");
#endif
#if defined(Q_WS_X11) && defined(KDE)
#if defined(Q_OS_X11) && defined(KDE)
KDEIntegration = tr("<b>Enabled</b>");
#endif
#ifdef PORTABLE_BUILD

View File

@ -28,7 +28,7 @@ AboutDialog::AboutDialog(QWidget* parent)
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
QtWin::extendFrameIntoClientArea(this);
ui->verticalLayout->setContentsMargins(0, 0, 0, 0);

View File

@ -100,7 +100,7 @@ void StatusBarMessage::showMessage(const QString &message)
if (p_QupZilla->statusBar()->isVisible()) {
p_QupZilla->statusBar()->showMessage(message);
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
else if (mApp->activeWindow() == p_QupZilla) {
#else
else {

View File

@ -163,7 +163,7 @@ void Plugins::loadAvailablePlugins()
QStringList dirs;
dirs << mApp->DATADIR + "plugins/"
#ifdef Q_WS_X11
#ifdef Q_OS_X11
#ifdef USE_LIBPATH
<< USE_LIBPATH "qupzilla/"
#else

View File

@ -37,7 +37,7 @@ void PopupStatusBarMessage::showMessage(const QString &message)
if (m_popupWindow->statusBar()->isVisible()) {
m_popupWindow->statusBar()->showMessage(message);
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
else if (mApp->activeWindow() == m_popupWindow) {
#else
else {

View File

@ -45,7 +45,7 @@ void PluginListDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op
titleFont.setPointSize(titleFont.pointSize() + 1);
const QFontMetrics titleMetrics(titleFont);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
const QPalette::ColorRole colorRole = QPalette::Text;
#else
const QPalette::ColorRole colorRole = opt.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text;

View File

@ -159,7 +159,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->useTransparentBg->setChecked(settings.value("useTransparentBackground", false).toBool());
int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0);
settings.endGroup();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
ui->useTransparentBg->setEnabled(QtWin::isCompositionEnabled());
#endif
@ -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_WS_X11
#ifdef Q_OS_X11
notifyType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNotificationsFactory::DesktopNative : DesktopNotificationsFactory::PopupWidget;
#else
notifyType = DesktopNotificationsFactory::PopupWidget;
@ -476,7 +476,7 @@ void Preferences::chooseDownPath()
if (userFileName.isEmpty()) {
return;
}
#ifdef Q_WS_WIN //QFileDialog::getExistingDirectory returns path with \ instead of / (??)
#ifdef Q_OS_WIN //QFileDialog::getExistingDirectory returns path with \ instead of / (??)
userFileName.replace('\\', '/');
#endif
userFileName += "/";

View File

@ -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_WS_X11
#ifdef Q_OS_X11
if (QFile("/usr/bin/akregator").exists()) {
m_rssApps << RssApp("Akregator", "/usr/bin/akregator -a ", QIcon(":/icons/sites/akregator.png"), DesktopApplication);
}

View File

@ -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_WS_X11
#ifdef Q_OS_X11
default:
return mApp->style()->standardIcon(icon);
#else

View File

@ -586,7 +586,7 @@ QString WebPage::userAgentForUrl(const QUrl &url) const
if (userAgent.isEmpty()) {
userAgent = QWebPage::userAgentForUrl(url);
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
#ifdef __i386__ || __x86_64__
userAgent.replace("PPC Mac OS X", "Intel Mac OS X");
#endif

View File

@ -111,7 +111,7 @@ int main(int argc, char* argv[])
{
QT_REQUIRE_VERSION(argc, argv, "4.7.0");
#ifdef Q_WS_X11
#ifdef Q_OS_X11
QApplication::setGraphicsSystem("raster"); // Better overall performance on X11
#endif

View File

@ -52,7 +52,7 @@ void GM_SettingsListDelegate::paint(QPainter* painter, const QStyleOptionViewIte
titleFont.setPointSize(titleFont.pointSize() + 1);
const QFontMetrics titleMetrics(titleFont);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
const QPalette::ColorRole colorRole = QPalette::Text;
#else
const QPalette::ColorRole colorRole = opt.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text;