mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Replace Q_OS_MAC with Q_OS_MACOS
This commit is contained in:
parent
69193399b4
commit
e150e44cc6
2
src/lib/3rdparty/fancytabwidget.cpp
vendored
2
src/lib/3rdparty/fancytabwidget.cpp
vendored
|
@ -429,7 +429,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_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
if (!selected) {
|
||||
painter->save();
|
||||
int fader = int(m_tabs[tabIndex]->fader());
|
||||
|
|
14
src/lib/3rdparty/processinfo.cpp
vendored
14
src/lib/3rdparty/processinfo.cpp
vendored
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -17,7 +17,7 @@
|
|||
* ============================================================ */
|
||||
#include "processinfo.h"
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
|
@ -36,7 +36,7 @@ ProcessInfo::ProcessInfo(const QString &name)
|
|||
|
||||
bool ProcessInfo::isRunning() const
|
||||
{
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
pid_t pid = GetPIDbyName(qPrintable(m_name));
|
||||
// -1 = process not found
|
||||
// -2 = /proc fs access error
|
||||
|
@ -46,7 +46,7 @@ bool ProcessInfo::isRunning() const
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
bool ProcessInfo::IsNumeric(const char* ccharptr_CharacterList) const
|
||||
{
|
||||
for (; *ccharptr_CharacterList; ccharptr_CharacterList++) {
|
||||
|
@ -75,7 +75,7 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const
|
|||
|
||||
// Loop while not NULL
|
||||
while ((de_DirEntity = readdir(dir_proc))) {
|
||||
#ifndef __HAIKU__
|
||||
#ifndef __HAIKU__
|
||||
if (de_DirEntity->d_type == DT_DIR) {
|
||||
if (IsNumeric(de_DirEntity->d_name)) {
|
||||
strcpy(chrarry_CommandLinePath, "/proc/") ;
|
||||
|
@ -109,7 +109,7 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
closedir(dir_proc) ;
|
||||
|
|
8
src/lib/3rdparty/processinfo.h
vendored
8
src/lib/3rdparty/processinfo.h
vendored
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
bool isRunning() const;
|
||||
|
||||
private:
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
bool IsNumeric(const char* ccharptr_CharacterList) const;
|
||||
pid_t GetPIDbyName(const char* cchrptr_ProcessName) const;
|
||||
#endif
|
||||
|
|
2
src/lib/3rdparty/stylehelper.cpp
vendored
2
src/lib/3rdparty/stylehelper.cpp
vendored
|
@ -50,7 +50,7 @@ namespace Utils
|
|||
|
||||
qreal StyleHelper::sidebarFontSize()
|
||||
{
|
||||
#if defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_MACOS)
|
||||
return 10;
|
||||
#else
|
||||
return 7.5;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -41,7 +41,7 @@ AdBlockDialog::AdBlockDialog(QWidget* parent)
|
|||
|
||||
QzTools::centerWidgetOnScreen(this);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
tabWidget->setDocumentMode(false);
|
||||
#endif
|
||||
adblockCheckBox->setChecked(m_manager->isEnabled());
|
||||
|
|
|
@ -340,7 +340,7 @@ void BrowserWindow::setupUi()
|
|||
|
||||
void BrowserWindow::setupMenu()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
static MainMenu* macMainMenu = 0;
|
||||
|
||||
if (!macMainMenu) {
|
||||
|
@ -471,7 +471,7 @@ void BrowserWindow::loadSettings()
|
|||
m_bookmarksToolbar->setVisible(showBookmarksToolbar);
|
||||
m_navigationToolbar->setVisible(showNavigationToolbar);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
menuBar()->setVisible(!isFullScreen() && showMenuBar);
|
||||
#endif
|
||||
|
||||
|
@ -709,7 +709,7 @@ void BrowserWindow::saveSideBarWidth()
|
|||
|
||||
void BrowserWindow::toggleShowMenubar()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
// We use one shared global menubar on Mac that can't be hidden
|
||||
return;
|
||||
#endif
|
||||
|
@ -763,7 +763,7 @@ void BrowserWindow::toggleShowNavigationToolbar()
|
|||
|
||||
Settings().setValue("Browser-View-Settings/showNavigationToolbar", m_navigationToolbar->isVisible());
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
// Make sure we show Menu Bar when Navigation Toolbar is hidden
|
||||
if (!m_navigationToolbar->isVisible() && !menuBar()->isVisible()) {
|
||||
toggleShowMenubar();
|
||||
|
@ -877,7 +877,7 @@ void BrowserWindow::createToolbarsMenu(QMenu* menu)
|
|||
|
||||
QAction* action;
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
action = menu->addAction(tr("&Menu Bar"), this, SLOT(toggleShowMenubar()));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(menuBar()->isVisible());
|
||||
|
@ -1053,7 +1053,7 @@ bool BrowserWindow::event(QEvent* event)
|
|||
m_windowStates = ev->oldState();
|
||||
|
||||
m_statusBarVisible = statusBar()->isVisible();
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
m_menuBarVisible = menuBar()->isVisible();
|
||||
menuBar()->hide();
|
||||
#endif
|
||||
|
@ -1065,7 +1065,7 @@ bool BrowserWindow::event(QEvent* event)
|
|||
else if (ev->oldState() & Qt::WindowFullScreen && !(windowState() & Qt::WindowFullScreen)) {
|
||||
// Leave fullscreen
|
||||
statusBar()->setVisible(m_statusBarVisible);
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
menuBar()->setVisible(m_menuBarVisible);
|
||||
#endif
|
||||
|
||||
|
@ -1338,7 +1338,7 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
|
|||
|
||||
saveSettings();
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
if (mApp->windowCount() == 1)
|
||||
mApp->quitApplication();
|
||||
#endif
|
||||
|
@ -1348,7 +1348,7 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
|
|||
|
||||
void BrowserWindow::closeWindow()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
close();
|
||||
return;
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2014-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -85,7 +85,7 @@ void DataPaths::clearTempData()
|
|||
void DataPaths::init()
|
||||
{
|
||||
// AppData
|
||||
#if defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_MACOS)
|
||||
m_paths[AppData].append(QApplication::applicationDirPath() + QLatin1String("/../Resources"));
|
||||
#elif defined(Q_OS_UNIX) && !defined(NO_SYSTEM_DATAPATH)
|
||||
m_paths[AppData].append(USE_DATADIR);
|
||||
|
@ -101,7 +101,7 @@ void DataPaths::init()
|
|||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
// Use %LOCALAPPDATA%/qupzilla as Config path on Windows
|
||||
m_paths[Config].append(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation));
|
||||
#elif defined(Q_OS_MAC)
|
||||
#elif defined(Q_OS_MACOS)
|
||||
m_paths[Config].append(QDir::homePath() + QLatin1String("/Library/Application Support/QupZilla"));
|
||||
#else // Unix
|
||||
m_paths[Config].append(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QL1S("/qupzilla"));
|
||||
|
|
|
@ -241,7 +241,7 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
setQuitOnLastWindowClosed(false);
|
||||
#else
|
||||
setQuitOnLastWindowClosed(true);
|
||||
|
@ -960,7 +960,7 @@ void MainApplication::loadTheme(const QString &name)
|
|||
|
||||
QString qss = QzTools::readAllFileContents(activeThemePath + QLatin1String("/main.css"));
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_MACOS)
|
||||
qss.append(QzTools::readAllFileContents(activeThemePath + QLatin1String("/mac.css")));
|
||||
#elif defined(Q_OS_UNIX)
|
||||
qss.append(QzTools::readAllFileContents(activeThemePath + QLatin1String("/linux.css")));
|
||||
|
@ -1112,11 +1112,11 @@ void MainApplication::setUserStyleSheet(const QString &filePath)
|
|||
{
|
||||
QString userCss;
|
||||
|
||||
#if !defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if !defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
// Don't grey out selection on losing focus (to prevent graying out found text)
|
||||
QString highlightColor;
|
||||
QString highlightedTextColor;
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
highlightColor = QLatin1String("#b6d6fc");
|
||||
highlightedTextColor = QLatin1String("#000");
|
||||
#else
|
||||
|
@ -1189,7 +1189,7 @@ RegisterQAppAssociation* MainApplication::associationManager()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <QFileOpenEvent>
|
||||
|
||||
bool MainApplication::event(QEvent* e)
|
||||
|
|
|
@ -196,7 +196,7 @@ private:
|
|||
RegisterQAppAssociation* m_registerQAppAssociation;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
public:
|
||||
bool event(QEvent* e);
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2014-2016 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2014-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include <QMenuBar>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
extern void qt_mac_set_dock_menu(QMenu* menu);
|
||||
#endif
|
||||
|
||||
|
@ -362,7 +362,7 @@ void MainMenu::restoreClosedTab()
|
|||
|
||||
void MainMenu::aboutToShowFileMenu()
|
||||
{
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
m_actions[QSL("File/CloseWindow")]->setEnabled(mApp->windowCount() > 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ void MainMenu::init()
|
|||
// Help menu
|
||||
m_menuHelp = new QMenu(tr("&Help"));
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
ADD_ACTION("Help/AboutQt", m_menuHelp, QIcon(), tr("About &Qt"), SLOT(aboutQt()), "");
|
||||
m_menuHelp->addAction(m_actions[QSL("Standard/About")]);
|
||||
m_menuHelp->addSeparator();
|
||||
|
@ -634,7 +634,7 @@ void MainMenu::init()
|
|||
connect(action, SIGNAL(triggered()), this, SLOT(restoreClosedTab()));
|
||||
m_actions[QSL("Other/RestoreClosedTab")] = action;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
m_actions[QSL("View/FullScreen")]->setShortcut(QKeySequence(QSL("Ctrl+Meta+F")));
|
||||
|
||||
// Add standard actions to File Menu (as it won't be ever cleared) and Mac menubar should move them to "Application" menu
|
||||
|
@ -652,9 +652,9 @@ void MainMenu::init()
|
|||
qt_mac_set_dock_menu(dockMenu);
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
m_menuEdit->addAction(m_actions[QSL("Standard/Preferences")]);
|
||||
#elif !defined(Q_OS_MAC)
|
||||
#elif !defined(Q_OS_MACOS)
|
||||
m_menuTools->addAction(m_actions[QSL("Standard/Preferences")]);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -118,7 +118,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
|
|||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
#define DEFAULT_THEME_NAME "windows"
|
||||
#elif defined(Q_OS_MAC)
|
||||
#elif defined(Q_OS_MACOS)
|
||||
#define DEFAULT_THEME_NAME "mac"
|
||||
#elif defined(Q_OS_UNIX)
|
||||
#define DEFAULT_THEME_NAME "linux"
|
||||
|
|
|
@ -41,7 +41,7 @@ BookmarksToolbar::BookmarksToolbar(BrowserWindow* window, QWidget* parent)
|
|||
|
||||
m_layout = new QHBoxLayout(this);
|
||||
m_layout->setMargin(1);
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
m_layout->setSpacing(0);
|
||||
#endif
|
||||
setLayout(m_layout);
|
||||
|
|
|
@ -686,7 +686,7 @@ void ComboTabBar::paintEvent(QPaintEvent* ev)
|
|||
QPainter p(this);
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &option, &p, this);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
// Draw tabbar base even on parts of ComboTabBar that are not directly QTabBar
|
||||
QStyleOptionTabBarBase opt;
|
||||
TabBarHelper::initStyleBaseOption(&opt, m_mainTabBar, size());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2013-2014 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2013-2017 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -18,7 +18,7 @@
|
|||
* ============================================================ */
|
||||
#include "mactoolbutton.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
MacToolButton::MacToolButton(QWidget* parent)
|
||||
: QPushButton(parent)
|
||||
, m_autoRise(false)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2013-2014 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2013-2017 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "qzcommon.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <QPushButton>
|
||||
|
||||
class QUPZILLA_EXPORT MacToolButton : public QPushButton
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -50,7 +50,7 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
|
@ -850,7 +850,7 @@ void QzTools::setWmClass(const QString &name, const QWidget* widget)
|
|||
|
||||
QString QzTools::operatingSystem()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
QString str = "Mac OS X";
|
||||
|
||||
SInt32 majorVersion;
|
||||
|
|
Loading…
Reference in New Issue
Block a user