Commit cfbfa765 authored by Bartosz Brachaczek's avatar Bartosz Brachaczek

qt5: Convert most Q_WS_* usage instances

Some Q_WS_X11 are left - these code fragments will require further work
(I have ideas, will do the work some time soon).
Signed-off-by: 's avatarBartosz Brachaczek <b.brachaczek@gmail.com>
parent 45a91918
......@@ -286,7 +286,7 @@ void Core::createDefaultConfiguration()
config_file.addVariable("General", "DEBUG_MASK", KDEBUG_ALL & ~KDEBUG_FUNCTION_END);
config_file.addVariable("General", "DescriptionHeight", 60);
config_file.addVariable("General", "DisconnectWithCurrentDescription", true);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
config_file.addVariable("General", "HideMainWindowFromTaskbar", false);
#endif
config_file.addVariable("General", "Language", QLocale::system().name().left(2));
......@@ -325,7 +325,7 @@ void Core::createDefaultConfiguration()
config_file.addVariable("Look", "ChatContents", QString());
config_file.addVariable("Look", "ForceCustomChatFont", false);
QFont chatFont = qApp->font();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// On Windows default app font is often "MS Shell Dlg 2", and the default sans
// family (Arial, at least in Qt 4.8) is better. Though, on X11 the default
// sans family is the same while most users will have some nice default app
......
......@@ -35,7 +35,7 @@ CheckboxStyledItemDelegate::~CheckboxStyledItemDelegate()
QRect CheckboxStyledItemDelegate::getCenteredComboBoxRect(const QStyleOptionViewItem &option) const
{
QSize size = QApplication::style()->sizeFromContents(QStyle::CT_CheckBox, &option, QSize());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
size.setWidth(size.width() + QApplication::style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &option));
#endif
......
......@@ -220,7 +220,7 @@ void KaduWebView::mouseReleaseEvent(QMouseEvent *e)
QWebView::mouseReleaseEvent(e);
DraggingPossible = false;
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
if (!page()->selectedText().isEmpty())
convertClipboardHtml(QClipboard::Selection);
#endif
......
......@@ -75,7 +75,7 @@ void PluginListWidgetItemDelegate::paint(QPainter *painter, const QStyleOptionVi
}
int xOffset = checkBox->sizeHint().width();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
xOffset += QApplication::style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing);
#endif
......
......@@ -41,11 +41,11 @@
#include "talkable-painter.h"
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include <windows.h>
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
bool TalkablePainter::useColorsWorkaround()
{
static bool checked = false;
......@@ -215,7 +215,7 @@ void TalkablePainter::computeCheckboxRect()
option.state = QStyle::State_Enabled;
QSize size = Style->sizeFromContents(QStyle::CT_CheckBox, &option, QSize());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
size.setWidth(size.width() + Style->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &option));
#endif
CheckboxRect.setSize(size);
......
......@@ -94,7 +94,7 @@ class TalkablePainter
void paintName(QPainter *painter);
void paintDescription(QPainter *painter);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
static bool useColorsWorkaround();
#endif
......
......@@ -33,7 +33,7 @@
#include <QtGui/QSplitter>
#include <QtGui/QVBoxLayout>
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include <windows.h>
#endif
......@@ -85,7 +85,7 @@ KaduWindow::KaduWindow() :
{
setWindowRole("kadu-main");
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
HiddenParent = new QWidget();
setHiddenParent();
#endif
......@@ -373,7 +373,7 @@ void KaduWindow::keyPressEvent(QKeyEvent *e)
MainWindow::keyPressEvent(e);
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
/* On Windows the only way to not show a window in the taskbar without making it a toolwindow
* is to turn off the WS_EX_APPWINDOW style and provide it with a parent (which will be hidden
* in our case).
......@@ -418,7 +418,7 @@ void KaduWindow::changeEvent(QEvent *event)
if (!_isActiveWindow(this))
Roster->clearFilter();
}
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
else if (event->type() == QEvent::WindowStateChange)
{
if (Docked && isMinimized() && config_file.readBoolEntry("General", "HideMainWindowFromTaskbar"))
......@@ -434,7 +434,7 @@ void KaduWindow::changeEvent(QEvent *event)
// On Windows we reparent WindowParent, so we want it to be parentless now.
// BTW, if WindowParent would be really needed in future, it's quite easy to support it.
Q_ASSERT(!WindowParent || 0 == WindowParent->parentWidget());
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// Without QueuedConnection I hit infinite loop here.
QMetaObject::invokeMethod(this, "setHiddenParent", Qt::QueuedConnection);
#endif
......@@ -460,7 +460,7 @@ TalkableProxyModel * KaduWindow::talkableProxyModel()
void KaduWindow::configurationUpdated()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
hideWindowFromTaskbar();
#endif
......
......@@ -86,7 +86,7 @@ private:
StatusButtons *ChangeStatusButtons;
QPoint LastPositionBeforeStatusMenuHide;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
QWidget *HiddenParent;
#endif
QWidget *WindowParent;
......@@ -103,7 +103,7 @@ private:
void createToolsMenu();
void createHelpMenu();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
void hideWindowFromTaskbar();
#endif
......@@ -112,7 +112,7 @@ private:
virtual void compositingEnabled();
virtual void compositingDisabled();
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
void setHiddenParent();
#endif
......
......@@ -189,7 +189,7 @@ MainConfigurationWindow::MainConfigurationWindow() :
widget()->widgetById("windowActivationMethod")->hide();
#endif
#if !defined(Q_WS_X11) && !defined(Q_WS_WIN)
#if !defined(Q_WS_X11) && !defined(Q_OS_WIN32)
widget()->widgetById("notify/fullscreenSilentMode")->hide();
#endif
......
......@@ -49,7 +49,7 @@ UpdatesDialog::UpdatesDialog(const QString &newestVersion, QWidget *parent) :
QLabel *messageLabel = new QLabel(this);
messageLabel->setWordWrap(true);
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
messageLabel->setText(QString(tr("A new version <b>%1</b> of Kadu Instant Messenger is available for download. "
"Please <a href='download'>download</a> an installer and upgrade or use "
"your package management system to update Kadu.")).arg(newestVersion));
......
......@@ -35,7 +35,7 @@
#include <QtGui/QSessionManager>
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include "configuration/configuration-manager.h"
#endif
......@@ -58,7 +58,7 @@ KaduApplication::KaduApplication(int &argc, char *argv[]) :
setApplicationName("Kadu");
setQuitOnLastWindowClosed(false);
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// Fix for #2491
setStyleSheet("QToolBar{border:0px}");
#endif
......@@ -83,7 +83,7 @@ void KaduApplication::commitData(QSessionManager &manager)
{
SessionClosing = true;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
/* On Windows Kadu often (if not always) seems to crash when it is
* opened at the time of closing or rebooting the system (when checking,
* try with Kadu window both visible and hidden by docking).
......
......@@ -43,15 +43,15 @@
#include <errno.h>
#include <time.h>
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN32
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <pwd.h>
#include <unistd.h>
#else // !Q_WS_WIN
#else // !Q_OS_WIN32
#include <winsock2.h>
#endif // !Q_WS_WIN
#endif // !Q_OS_WIN32
#include "configuration/configuration-file.h"
#include "configuration/xml-configuration-file.h"
......@@ -67,7 +67,7 @@
#include "kadu-application.h"
#include "kadu-config.h"
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN32
#if HAVE_EXECINFO
#include <execinfo.h>
#endif
......@@ -128,7 +128,7 @@ static void kaduQtMessageHandler(QtMsgType type, const char *msg)
break;
}
}
#endif // Q_WS_WIN
#endif // !Q_OS_WIN32
#ifdef DEBUG_OUTPUT_ENABLED
extern KADUAPI bool showTimesInDebug;
......@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
exitingTime = 0;
startTime = (sec % 1000) * 1000 + msec;
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN32
// We want some sensible LC_COLLATE (i.e., not "C", if possible) to make
// QString::localeAwareCompare() work as expected.
QByteArray langEnv = qgetenv("LANG");
......@@ -188,11 +188,11 @@ int main(int argc, char *argv[])
qputenv("LC_COLLATE", "en_US");
else if (lcAllEnv.isEmpty())
qputenv("LC_COLLATE", langEnv);
#else // !Q_WS_WIN
#else // !Q_OS_WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
return 2;
#endif // !Q_WS_WIN
#endif // !Q_OS_WIN32
kdebugm(KDEBUG_INFO, "before creation of new KaduApplication\n");
new KaduApplication(argc, argv);
......@@ -206,7 +206,7 @@ int main(int argc, char *argv[])
{
printVersion();
delete qApp;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
WSACleanup();
#endif
return 0;
......@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
printUsage();
printKaduOptions();
delete qApp;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
WSACleanup();
#endif
return 0;
......@@ -251,7 +251,7 @@ int main(int argc, char *argv[])
printf("logging all stderr output to file: %s\n", logFilePath.constData());
}
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN32
// Qt version is better on win32
qInstallMsgHandler(kaduQtMessageHandler);
#endif
......@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
delete config_file_ptr;
delete xml_config_file;
delete qApp;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
WSACleanup();
#endif
......@@ -337,7 +337,7 @@ int main(int argc, char *argv[])
// so it's probably a bug in Qt. Sigh.
//delete qApp;
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
WSACleanup();
#endif
......
......@@ -87,7 +87,7 @@ KaduPaths::KaduPaths()
void KaduPaths::initBasicPaths()
{
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
DesktopFilePath = QCoreApplication::applicationDirPath() + QLatin1String("/" KADU_DESKTOP_FILE_PATH_RELATIVE_TO_BIN);
DesktopFilePath = QFileInfo(DesktopFilePath).canonicalFilePath();
#endif
......
......@@ -39,7 +39,7 @@ class KADUAPI KaduPaths
static KaduPaths *Instance;
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QString DesktopFilePath;
#endif
QString ProfilePath;
......@@ -76,7 +76,7 @@ public:
*/
static QString webKitPath(const QString &path);
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
/**
* @short Returns absolute path to the .desktop file owned by Kadu.
* @return absolute path to the .desktop file owned by Kadu
......
......@@ -31,7 +31,7 @@
NetworkManagerQt::NetworkManagerQt()
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// Kadu bug #2591
if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA)
{
......
......@@ -25,18 +25,18 @@
#include <QtCore/QTextStream>
#include <QtNetwork/QHostInfo>
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
#ifdef Q_OS_UNIX
#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include <windows.h>
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
#include <CoreServices/CoreServices.h>
#endif
......@@ -51,7 +51,7 @@ SystemInfo * SystemInfo::instance()
return Instance;
}
#if defined(Q_WS_X11)
#if defined(Q_OS_LINUX)
QString SystemInfo::lsbRelease(const QStringList &args)
{
QStringList path = QString(qgetenv("PATH")).split(':');
......@@ -197,7 +197,7 @@ SystemInfo::SystemInfo()
OsFullName = "Unknown";
// Detect
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
#if defined(Q_OS_UNIX)
time_t x;
time(&x);
char str[256];
......@@ -217,7 +217,6 @@ SystemInfo::SystemInfo()
if (strftime(str, sizeof(str), fmt, localtime(&x)) > 0)
Timezone = str;
#endif
#if defined(Q_WS_X11)
#if defined(Q_OS_FREEBSD)
OsName = "FreeBSD";
#elif defined(Q_OS_NETBSD)
......@@ -233,8 +232,7 @@ SystemInfo::SystemInfo()
if (OsFullName.isEmpty())
OsFullName = linuxHeuristicDetect();
#endif
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
SInt32 minor_version, major_version, bug_fix;
if (Gestalt(gestaltSystemVersionMajor, &major_version) == noErr &&
Gestalt(gestaltSystemVersionMinor, &minor_version) == noErr &&
......@@ -251,7 +249,7 @@ SystemInfo::SystemInfo()
OsName = "MacOS X";
#endif
#if defined(Q_WS_WIN)
#if defined(Q_OS_WIN32)
TIME_ZONE_INFORMATION i;
//GetTimeZoneInformation(&i);
//TimezoneOffset = (-i.Bias) / 60;
......
......@@ -33,7 +33,7 @@ class KADUAPI SystemInfo
QString OsName;
QString OsVersion;
#if defined(Q_WS_X11)
#if defined(Q_OS_LINUX)
QString lsbRelease(const QStringList &args);
QString linuxHeuristicDetect();
#endif
......
......@@ -48,11 +48,11 @@
#define QTLOCKEDFILE_H
#include <QtCore/QFile>
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN32
#include <QtCore/QVector>
#endif
#if defined(Q_WS_WIN)
#if defined(Q_OS_WIN32)
# if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT)
# define QT_QTLOCKEDFILE_EXPORT
# elif defined(QT_QTLOCKEDFILE_IMPORT)
......
......@@ -42,7 +42,7 @@
#if defined(Q_WS_X11)
#include "notify/x11-screen-mode-checker.h"
#elif defined(Q_WS_WIN)
#elif defined(Q_OS_WIN32)
#include "notify/windows-screen-mode-checker.h"
#else
#include "notify/screen-mode-checker.h"
......@@ -222,7 +222,7 @@ void NotificationService::startScreenModeChecker()
#if defined(Q_WS_X11)
FullscreenChecker = new X11ScreenModeChecker();
#elif defined(Q_WS_WIN)
#elif defined(Q_OS_WIN32)
FullscreenChecker = new WindowsScreenModeChecker();
#else
FullscreenChecker = new ScreenModeChecker();
......
......@@ -61,7 +61,7 @@ ConfigWizardWindow::ConfigWizardWindow(QWidget *parent) :
*/
setWizardStyle(QWizard::ClassicStyle);
#else
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// NOTE: Workaround for bug #1912.
// TODO: Remove this as soon as QTBUG-10478 is fixed in
// a release we bundle in the Windows build.
......
......@@ -103,7 +103,7 @@ DockingManager::DockingManager() :
{
kdebugf();
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
KaduWindowLastTimeVisible = true;
#endif
......@@ -133,7 +133,7 @@ DockingManager::DockingManager() :
MacDockMenu->setSeparatorsCollapsible(true);
#endif
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
ShowKaduAction = new QAction(tr("&Restore"), this);
connect(ShowKaduAction, SIGNAL(triggered()), this, SLOT(showKaduWindow()));
......@@ -146,7 +146,7 @@ DockingManager::DockingManager() :
configurationUpdated();
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
/* Fill context menu for the first time. It seems that Ubuntu panels, when at bottom
* of the screen, set maximum height for menus to what their height was when they
* were clicked for the first time. And normally we fill the menu in response to
......@@ -427,7 +427,7 @@ void DockingManager::trayMousePressEvent(QMouseEvent * e)
}
if (kadu->isMinimized() || !kadu->isVisible()
#ifndef Q_WS_WIN
#ifndef Q_OS_WIN32
// NOTE: It won't work as expected on Windows since when you click on tray icon,
// the tray will become active and any other window will loose focus.
// See bug #1915.
......@@ -502,7 +502,7 @@ void DockingManager::setDocker(Docker *docker)
void DockingManager::contextMenuAboutToBeShown()
{
if (DockMenuNeedsUpdate
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|| Core::instance()->kaduWindow()->window()->isVisible() != KaduWindowLastTimeVisible
#endif
)
......@@ -583,7 +583,7 @@ void DockingManager::doUpdateContextMenu()
DockMenu->addSeparator();
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
KaduWindowLastTimeVisible = Core::instance()->kaduWindow()->window()->isVisible();
DockMenu->addAction(KaduWindowLastTimeVisible ? HideKaduAction : ShowKaduAction);
#endif
......
......@@ -62,7 +62,7 @@ class DOCKINGAPI DockingManager : public QObject, ConfigurationAwareObject, Stat
Docker *CurrentDocker;
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
bool KaduWindowLastTimeVisible;
#endif
bool DockMenuNeedsUpdate;
......@@ -73,7 +73,7 @@ class DOCKINGAPI DockingManager : public QObject, ConfigurationAwareObject, Stat
StatusMenu *AllAccountsMenu;
#ifdef Q_WS_X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QAction *ShowKaduAction;
QAction *HideKaduAction;
#endif
......
......@@ -35,7 +35,7 @@
QString EmoticonThemeManager::defaultTheme()
{
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
return QLatin1String("penguins");
#else
return QLatin1String("tango");
......
......@@ -676,6 +676,7 @@ void HintManager::import_0_6_5_configuration()
void HintManager::createDefaultConfiguration()
{
// TODO: this should be more like: if (plugins.loaded(freedesktop_notify) && this_is_first_time_we_are_loaded_or_whatever)
#if !defined(Q_WS_X11)
config_file.addVariable("Notify", "ConnectionError_Hints", true);
config_file.addVariable("Notify", "NewChat_Hints", true);
......
......@@ -36,7 +36,7 @@
#include <QtGui/QLineEdit>
#include <QtGui/QSlider>
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include <windows.h>
#endif
......@@ -69,7 +69,7 @@ int sounds[96] = {
29,58,116,233,466,932,1865,3729,
31,62,123,245,494,988,1975,3951};
#if defined(Q_WS_WIN)
#if defined(Q_OS_WIN32)
void PCSpeaker::beep(int pitch, int duration)
{
if (pitch == 0)
......
......@@ -121,7 +121,7 @@ void Qt4TrayIcon::changeTrayMovie(const QString &moviePath)
void Qt4TrayIcon::changeTrayTooltip(const QString &tooltip)
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
// checked on XP and 7
const int maxTooltipLength = 127;
const QString &truncatedTooltip = tooltip.length() > maxTooltipLength
......
......@@ -64,7 +64,7 @@ void ScreenshotAction::actionInstanceCreated(Action *action)
QMenu *menu = new QMenu();
menu->addAction(tr("Simple Shot"), this, SLOT(takeStandardShotSlot()))->setData(chatWidgetData);
menu->addAction(tr("With Chat Window Hidden"), this, SLOT(takeShotWithChatWindowHiddenSlot()))->setData(chatWidgetData);
#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
menu->addAction(tr("Window Shot"), this, SLOT(takeWindowShotSlot()))->setData(chatWidgetData);
#endif
action->setMenu(menu);
......
......@@ -31,10 +31,10 @@
#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
#include <Carbon/Carbon.h>
#endif
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN32
#include <QtCore/QLibrary>
#include <windows.h>
#undef MessageBox
......@@ -227,7 +227,7 @@ Window PixmapGrabber::findRealWindow( Window w, int depth )
// End of code copied from KSnapShot
//////////////////////////////////////////////////////////////////
#elif defined Q_WS_WIN
#elif defined Q_OS_WIN32
QPixmap PixmapGrabber::grabCurrent()
{
......@@ -293,7 +293,7 @@ QPixmap PixmapGrabber::grabCurrent()
}
#elif defined Q_WS_MAC
#elif defined Q_OS_MAC
QPixmap PixmapGrabber::grabCurrent()
{
......
......@@ -36,7 +36,7 @@
#include <aspell.h>
#elif defined(HAVE_ENCHANT)
#include <enchant.h>
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
#include "macspellchecker.h"
#endif
......@@ -107,7 +107,7 @@ SpellChecker::~SpellChecker()
foreach (EnchantDict *dict, MyCheckers)
enchant_broker_free_dict(Broker, dict);
enchant_broker_free(Broker);
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
qDeleteAll(MyCheckers);
#endif
}
......@@ -182,7 +182,7 @@ bool SpellChecker::addCheckedLang(const QString &name)
errorMsg = enchant_broker_get_error(Broker);
ok = false;
}
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
MyCheckers.insert(name, new MacSpellChecker());
#endif
......@@ -212,7 +212,7 @@ void SpellChecker::removeCheckedLang(const QString &name)
delete_aspell_speller(checker.value());
#elif defined(HAVE_ENCHANT)
enchant_broker_free_dict(Broker, checker.value());
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
delete checker.value();
#endif
MyCheckers.erase(checker);
......@@ -227,7 +227,7 @@ void SpellChecker::buildCheckers()
#elif defined(HAVE_ENCHANT)
foreach (EnchantDict *dict, MyCheckers)
enchant_broker_free_dict(Broker, dict);
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
qDeleteAll(MyCheckers);
#endif
MyCheckers.clear();
......@@ -372,7 +372,7 @@ bool SpellChecker::checkWord(const QString &word)
#elif defined(HAVE_ENCHANT)
QByteArray utf8Word = word.toUtf8();
if (0 == enchant_dict_check(it.value(), utf8Word.constData(), utf8Word.size()))
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
if (it.value()->isCorrect(word.toUtf8().constData()))
#endif
{
......@@ -435,7 +435,7 @@ QStringList SpellChecker::buildSuggestList(const QString &word)
enchant_dict_free_string_list(it.value(), suggs);
}
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
suggestWordList.append(it.value()->suggestions(word));
#endif
}
......
......@@ -42,7 +42,7 @@ struct AspellConfig;
#elif defined(HAVE_ENCHANT)
typedef struct str_enchant_broker EnchantBroker;
typedef struct str_enchant_dict EnchantDict;
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
class MacSpellChecker;
#endif
......@@ -55,9 +55,9 @@ public:
typedef QMap<QString, AspellSpeller *> Checkers;
#elif defined(HAVE_ENCHANT)
typedef QMap<QString, EnchantDict *> Checkers;
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
typedef QMap<QString, MacSpellChecker *> Checkers;
#endif // Q_WS_MAC
#endif // Q_OS_MAC
private:
QPointer<ChatWidgetRepository> m_chatWidgetRepository;
......@@ -66,7 +66,7 @@ private:
AspellConfig *SpellConfig;
#elif defined(HAVE_ENCHANT)
EnchantBroker *Broker;
#elif defined(Q_WS_MAC)
#elif defined(Q_OS_MAC)
MacSpellChecker *MacSpellCheck;
#endif
......
......@@ -273,7 +273,7 @@ void TabWidget::chatKeyPressed(QKeyEvent *e, CustomInput *k, bool &handled)
switchTabRight();
else if (HotKey::shortCut(e, "ShortCuts", "ReopenClosedTab"))
Manager->reopenClosedChat();
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
#define TAB_SWITCH_MODIFIER "Ctrl"
#else
#define TAB_SWITCH_MODIFIER "Alt"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment