diff --git a/appmenu/glowbar.h b/appmenu/glowbar.h index 2d86fc47..5a51beb9 100644 --- a/appmenu/glowbar.h +++ b/appmenu/glowbar.h @@ -48,4 +48,4 @@ private: Plasma::Svg *m_svg; QPixmap m_buffer; }; -#endif \ No newline at end of file +#endif diff --git a/drkonqi/drkonqibackends.cpp b/drkonqi/drkonqibackends.cpp index 064d07d4..eea710bb 100644 --- a/drkonqi/drkonqibackends.cpp +++ b/drkonqi/drkonqibackends.cpp @@ -168,11 +168,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager() { QList internalDebuggers = Debugger::availableInternalDebuggers("KCrash"); KConfigGroup config(KGlobal::config(), "DrKonqi"); -#ifndef Q_OS_WIN QString defaultDebuggerName = config.readEntry("Debugger", QString("gdb")); -#else - QString defaultDebuggerName = config.readEntry("Debugger", QString("kdbgwin")); -#endif Debugger firstKnownGoodDebugger, preferredDebugger; foreach (const Debugger & debugger, internalDebuggers) { diff --git a/drkonqi/main.cpp b/drkonqi/main.cpp index 4deed2c9..d461049f 100644 --- a/drkonqi/main.cpp +++ b/drkonqi/main.cpp @@ -43,7 +43,6 @@ static const char description[] = I18N_NOOP("The KDE Crash Handler gives the use int main(int argc, char* argv[]) { -#ifndef Q_OS_WIN //krazy:exclude=cpp // TODO - Investigate and fix this, or work around it as follows... // #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) // When starting Dr Konqi via kdeinit4, Apple OS X aborts us unconditionally for @@ -53,7 +52,6 @@ int main(int argc, char* argv[]) if (setuid(getuid()) < 0 && geteuid() != getuid()) { exit(255); } -#endif // Prevent KApplication from setting the crash handler. We will set it later... setenv("KDE_DEBUG", "true", 1); diff --git a/kcontrol/desktoppaths/globalpaths.cpp b/kcontrol/desktoppaths/globalpaths.cpp index 845757af..de18ac55 100644 --- a/kcontrol/desktoppaths/globalpaths.cpp +++ b/kcontrol/desktoppaths/globalpaths.cpp @@ -151,13 +151,8 @@ void DesktopPathConfig::defaults() // the following method is copied from kdelibs/kdecore/config/kconfiggroup.cpp static bool cleanHomeDirPath( QString &path, const QString &homeDir ) { -#ifdef Q_WS_WIN //safer - if (!QDir::convertSeparators(path).startsWith(QDir::convertSeparators(homeDir))) - return false; -#else if (!path.startsWith(homeDir)) return false; -#endif int len = homeDir.length(); // replace by "$HOME" if possible diff --git a/kcontrol/fonts/fonts.cpp b/kcontrol/fonts/fonts.cpp index 67eccd47..0f8d1644 100644 --- a/kcontrol/fonts/fonts.cpp +++ b/kcontrol/fonts/fonts.cpp @@ -516,11 +516,7 @@ KFonts::KFonts(QWidget *parent, const QVariantList &args) // NOTE: keep in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp -#ifdef Q_WS_MAC - QFont f0("Lucida Grande", 13); // general/menu/desktop - QFont f1("Monaco", 10); - QFont f2("Lucida Grande", 11); // toolbar -#elif defined(Q_WS_MAEMO_5) || defined(MEEGO_EDITION_HARMATTAN) +#if defined(Q_WS_MAEMO_5) || defined(MEEGO_EDITION_HARMATTAN) QFont f0("Sans Serif", 16); // general/menu/desktop QFont f1("Monospace", 16; QFont f2("Sans Serif", 16); // toolbar diff --git a/kglobalaccel/globalshortcutsregistry.cpp b/kglobalaccel/globalshortcutsregistry.cpp index 985ab31e..3f9ac3d5 100644 --- a/kglobalaccel/globalshortcutsregistry.cpp +++ b/kglobalaccel/globalshortcutsregistry.cpp @@ -35,8 +35,6 @@ #include #elif defined(Q_WS_MACX) #include "kglobalaccel_mac.h" -#elif defined(Q_WS_WIN) -#include "kglobalaccel_win.h" #else #include "kglobalaccel_qws.h" #endif diff --git a/kglobalaccel/kglobalaccel_mac.cpp b/kglobalaccel/kglobalaccel_mac.cpp index 17e6a6de..d8c8ea6c 100644 --- a/kglobalaccel/kglobalaccel_mac.cpp +++ b/kglobalaccel/kglobalaccel_mac.cpp @@ -22,137 +22,3 @@ #include -#ifdef Q_WS_MAC - -#include -#include - -#include "globalshortcutsregistry.h" -#include "kkeyserver.h" - -OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData) -{ - UInt32 eventKind = GetEventKind(inEvent); - if (eventKind == kEventRawKeyDown) { - UInt32 keycode; - if (GetEventParameter(inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keycode), NULL, &keycode) != noErr) { - kWarning(125) << "Error retrieving keycode parameter from event"; - } - kDebug() << " key down, keycode = " << keycode; - } else if (eventKind == kEventHotKeyPressed) { - KGlobalAccelImpl* impl = static_cast(inUserData); - EventHotKeyID hotkey; - if (GetEventParameter(inEvent, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotkey), NULL, &hotkey) != noErr) { - kWarning(125) << "Error retrieving hotkey parameter from event"; - return eventNotHandledErr; - } - // Typecasts necesary to prevent a warning from gcc - return (impl->keyPressed(hotkey.id) ? (OSStatus) noErr : (OSStatus) eventNotHandledErr); - } - return eventNotHandledErr; -} - -void layoutChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { - static_cast(observer)->keyboardLayoutChanged(); -} - -KGlobalAccelImpl::KGlobalAccelImpl(GlobalShortcutsRegistry* owner) - : m_owner(owner) - , m_eventTarget(GetApplicationEventTarget()) - , m_eventHandler(NewEventHandlerUPP(hotKeyEventHandler)) -{ - m_eventType[0].eventClass = kEventClassKeyboard; - m_eventType[0].eventKind = kEventHotKeyPressed; - m_eventType[1].eventClass = kEventClassKeyboard; // only useful for testing, is not used because count passed in call to InstallEventHandler is 1 - m_eventType[1].eventKind = kEventRawKeyDown; - refs = new QMap >(); - - CFStringRef str = CFStringCreateWithCString(NULL, "AppleKeyboardPreferencesChangedNotification", kCFStringEncodingASCII); - if (str) { - CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), this, layoutChanged, str, NULL, CFNotificationSuspensionBehaviorHold); - CFRelease(str); - } else { - kWarning(125) << "Couldn't create CFString to register for keyboard notifications"; - } -} - -KGlobalAccelImpl::~KGlobalAccelImpl() -{ - DisposeEventHandlerUPP(hotKeyEventHandler); - CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), this, NULL, NULL); - delete refs; -} - -bool KGlobalAccelImpl::grabKey( int keyQt, bool grab ) -{ - if (grab) { - kDebug() << "Grabbing key " << keyQt; - QList keyCodes; - uint mod; - KKeyServer::keyQtToCodeMac( keyQt, keyCodes ); - KKeyServer::keyQtToModMac( keyQt, mod ); - - kDebug() << "keyQt: " << keyQt << " mod: " << mod; - foreach (uint keyCode, keyCodes) { - kDebug() << " keyCode: " << keyCode; - } - - EventHotKeyID ehkid; - ehkid.signature = 'Kgai'; - ehkid.id = keyQt; - QList hotkeys; - foreach (uint keyCode, keyCodes) { - EventHotKeyRef ref; - if (RegisterEventHotKey(keyCode, mod, ehkid, m_eventTarget, 0, &ref) != noErr) { - kWarning(125) << "RegisterEventHotKey failed!"; - } - hotkeys.append(ref); - } - refs->insert(keyQt, hotkeys); - } else { - kDebug() << "Ungrabbing key " << keyQt; - if (refs->count(keyQt) == 0) kWarning(125) << "Trying to ungrab a key thas is not grabbed"; - foreach (const EventHotKeyRef &ref, refs->value(keyQt)) { - if (UnregisterEventHotKey(ref) != noErr) { - kWarning(125) << "UnregisterEventHotKey should not fail!"; - } - } - refs->remove(keyQt); - } - return true; -} - -void KGlobalAccelImpl::setEnabled(bool enable) -{ - if (enable) { - if (InstallEventHandler(m_eventTarget, m_eventHandler, 1, m_eventType, this, &m_curHandler) != noErr) - kWarning(125) << "InstallEventHandler failed!"; - } else { - if (RemoveEventHandler(m_curHandler) != noErr) - kWarning(125) << "RemoveEventHandler failed!"; - } -} - -bool KGlobalAccelImpl::keyPressed( int key ) -{ - return m_owner->keyPressed(key); -} - -void KGlobalAccelImpl::keyboardLayoutChanged() -{ - // Keyboard layout might have changed, first ungrab all keys - QList keys; // Array to store all the keys that were grabbed - while (!refs->empty()) { - int key = refs->begin().key(); - keys.append(key); - grabKey(key, false); - } - // Now re-grab all the keys - foreach (int key, keys) { - grabKey(key, true); - } -} - -#include "kglobalaccel_mac.moc" - -#endif // !Q_WS_MAC diff --git a/kioslave/archive/kio_archive.cpp b/kioslave/archive/kio_archive.cpp index 5fc1c70d..5a6b7d03 100644 --- a/kioslave/archive/kio_archive.cpp +++ b/kioslave/archive/kio_archive.cpp @@ -76,11 +76,7 @@ ArchiveProtocol::~ArchiveProtocol() bool ArchiveProtocol::checkNewFile( const KUrl & url, QString & path, KIO::Error& errorNum ) { -#ifndef Q_WS_WIN QString fullPath = url.path(); -#else - QString fullPath = url.path().remove(0, 1); -#endif kDebug(7109) << "ArchiveProtocol::checkNewFile" << fullPath; @@ -134,15 +130,10 @@ bool ArchiveProtocol::checkNewFile( const KUrl & url, QString & path, KIO::Error { archiveFile = tryPath; m_mtime = statbuf.st_mtime; -#ifdef Q_WS_WIN // st_uid and st_gid provides no information - m_user.clear(); - m_group.clear(); -#else KUser user(statbuf.st_uid); m_user = user.loginName(); KUserGroup group(statbuf.st_gid); m_group = group.name(); -#endif path = fullPath.mid( pos + 1 ); kDebug(7109).nospace() << "fullPath=" << fullPath << " path=" << path; len = path.length(); @@ -349,11 +340,7 @@ void ArchiveProtocol::stat( const KUrl & url ) kDebug( 7109 ).nospace() << "ArchiveProtocol::stat returning name=" << url.fileName(); KDE_struct_stat buff; -#ifdef Q_WS_WIN - QString fullPath = url.path().remove(0, 1); -#else QString fullPath = url.path(); -#endif if ( KDE_stat( QFile::encodeName( fullPath ), &buff ) == -1 ) { diff --git a/kioslave/desktop/kio_desktop.cpp b/kioslave/desktop/kio_desktop.cpp index db3b8a60..43eba011 100644 --- a/kioslave/desktop/kio_desktop.cpp +++ b/kioslave/desktop/kio_desktop.cpp @@ -64,7 +64,6 @@ DesktopProtocol::~DesktopProtocol() void DesktopProtocol::checkLocalInstall() { -#ifndef Q_WS_WIN // We can't use KGlobalSettings::desktopPath() here, since it returns the home dir // if the desktop folder doesn't exist. QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); @@ -145,7 +144,6 @@ void DesktopProtocol::checkLocalInstall() trash.desktopGroup().writeEntry("EmptyIcon", "user-trash"); } } -#endif } bool DesktopProtocol::rewriteUrl(const KUrl &url, KUrl &newUrl) diff --git a/kioslave/fish/fish.cpp b/kioslave/fish/fish.cpp index db865df0..e5a6f0d0 100644 --- a/kioslave/fish/fish.cpp +++ b/kioslave/fish/fish.cpp @@ -104,11 +104,7 @@ #define sendmimeType(x) mimeType(x) #endif -#ifdef Q_WS_WIN -#define ENDLINE "\r\n" -#else #define ENDLINE '\n' -#endif static char *sshPath = NULL; static char *suPath = NULL; @@ -116,11 +112,7 @@ static char *suPath = NULL; // static int isOpenSSH = 0; /** the SSH process used to communicate with the remote end */ -#ifndef Q_WS_WIN static pid_t childPid; -#else -static KProcess *childPid = 0; -#endif #define E(x) ((const char*)remoteEncoding()->encode(x).data()) @@ -238,11 +230,7 @@ fishProtocol::fishProtocol(const QByteArray &pool_socket, const QByteArray &app_ if (sshPath == NULL) { // disabled: currently not needed. Didn't work reliably. // isOpenSSH = !system("ssh -V 2>&1 | grep OpenSSH > /dev/null"); -#ifdef Q_WS_WIN - sshPath = strdup(QFile::encodeName(KStandardDirs::findExe("plink"))); -#else sshPath = strdup(QFile::encodeName(KStandardDirs::findExe("ssh"))); -#endif } if (suPath == NULL) { suPath = strdup(QFile::encodeName(KStandardDirs::findExe("su"))); @@ -310,7 +298,6 @@ void fishProtocol::openConnection() { } // XXX Use KPty! XXX -#ifndef Q_WS_WIN static int open_pty_pair(int fd[2]) { #if defined(HAVE_TERMIOS_H) && defined(HAVE_GRANTPT) && !defined(HAVE_OPENPTY) @@ -376,7 +363,6 @@ close_master: #endif #endif } -#endif /** creates the subprocess */ @@ -385,52 +371,14 @@ bool fishProtocol::connectionStart() { int rc, flags; thisFn.clear(); -#ifndef Q_WS_WIN rc = open_pty_pair(fd); if (rc == -1) { myDebug( << "socketpair failed, error: " << strerror(errno) << endl); return true; } -#endif if (!requestNetwork()) return true; myDebug( << "Exec: " << (local ? suPath : sshPath) << " Port: " << connectionPort << " User: " << connectionUser << endl); -#ifdef Q_WS_WIN - childPid = new KProcess(); - childPid->setOutputChannelMode(KProcess::MergedChannels); - QStringList common_args; - common_args << "-l" << connectionUser.toLatin1().constData() << "-x" << connectionHost.toLatin1().constData(); - common_args << "echo;echo FISH:;exec /bin/sh -c \"if env true 2>/dev/null; then env PS1= PS2= TZ=UTC LANG=C LC_ALL=C LOCALE=C /bin/sh; else PS1= PS2= TZ=UTC LANG=C LC_ALL=C LOCALE=C /bin/sh; fi\""; - - childPid->setProgram(sshPath, common_args); - childPid->start(); - - QByteArray buf; - int offset = 0; - while (!isLoggedIn) { - if (outBuf.size()) { - rc = childPid->write(outBuf); - outBuf.clear(); - } - else rc = 0; - - if(rc < 0) { - myDebug( << "write failed, rc: " << rc); - outBufPos = -1; - //return true; - } - - if (childPid->waitForReadyRead(1000)) { - QByteArray buf2 = childPid->readAll(); - buf += buf2; - - int noff = establishConnection(buf); - if (noff < 0) return false; - if (noff > 0) buf = buf.mid(/*offset+*/noff); -// offset = noff; - } - } -#else childPid = fork(); if (childPid == -1) { myDebug( << "fork failed, error: " << strerror(errno) << endl); @@ -554,20 +502,14 @@ bool fishProtocol::connectionStart() { } } } -#endif return false; } /** writes one chunk of data to stdin of child process */ -#ifndef Q_WS_WIN void fishProtocol::writeChild(const char *buf, KIO::fileoffset_t len) { if (outBufPos >= 0 && outBuf) { -#else -void fishProtocol::writeChild(const QByteArray &buf, KIO::fileoffset_t len) { - if (outBufPos >= 0 && outBuf.size()) { -#endif #if 0 QString debug = QString::fromLatin1(outBuf,outBufLen); if (len > 0) myDebug( << "write request while old one is pending, throwing away input (" << outBufLen << "," << outBufPos << "," << debug.left(10) << "...)" << endl); @@ -582,13 +524,8 @@ void fishProtocol::writeChild(const QByteArray &buf, KIO::fileoffset_t len) { /** manages initial communication setup including password queries */ -#ifndef Q_WS_WIN int fishProtocol::establishConnection(char *buffer, KIO::fileoffset_t len) { QString buf = QString::fromLatin1(buffer,len); -#else -int fishProtocol::establishConnection(const QByteArray &buffer) { - QString buf = buffer; -#endif int pos=0; // Strip trailing whitespace while (buf.length() && (buf[buf.length()-1] == ' ')) @@ -671,10 +608,6 @@ int fishProtocol::establishConnection(const QByteArray &buffer) { writeChild(connectionAuth.password.toLatin1(),connectionAuth.password.length()); } thisFn.clear(); -#ifdef Q_WS_WIN - return buf.length(); - } -#else return 0; } else if (buf.endsWith('?')) { int rc = messageBox(QuestionYesNo,thisFn+buf); @@ -686,22 +619,9 @@ int fishProtocol::establishConnection(const QByteArray &buffer) { thisFn.clear(); return 0; } -#endif else { myDebug( << "unmatched case in initial handling! should not happen!" << endl); } -#ifdef Q_WS_WIN - if (buf.endsWith(QLatin1String("(y/n)"))) { - int rc = messageBox(QuestionYesNo,thisFn+buf); - if (rc == KMessageBox::Yes) { - writeChild("y\n",2); - } else { - writeChild("n\n",2); - } - thisFn.clear(); - return 0; - } -#endif } return buf.length(); } @@ -756,17 +676,11 @@ Closes the connection */ void fishProtocol::shutdownConnection(bool forced){ if (childPid) { -#ifdef Q_WS_WIN - childPid->terminate(); -#else int killStatus = kill(childPid,SIGTERM); // We may not have permission... if (killStatus == 0) waitpid(childPid, 0, 0); -#endif childPid = 0; -#ifndef Q_WS_WIN ::close(childFd); // ...in which case this should do the trick childFd = -1; -#endif if (!forced) { dropNetwork(); @@ -1427,14 +1341,11 @@ with .fishsrv.pl typically running on another computer. */ int rc; isRunning = true; finished(); -#ifndef Q_WS_WIN fd_set rfds, wfds; FD_ZERO(&rfds); -#endif char buf[32768]; int offset = 0; while (isRunning) { -#ifndef Q_WS_WIN FD_SET(childFd,&rfds); FD_ZERO(&wfds); if (outBufPos >= 0) FD_SET(childFd,&wfds); @@ -1457,25 +1368,15 @@ with .fishsrv.pl typically running on another computer. */ if (FD_ISSET(childFd,&wfds) && outBufPos >= 0) { if (outBufLen-outBufPos > 0) rc = ::write(childFd, outBuf + outBufPos, outBufLen - outBufPos); -#else - if (outBufPos >= 0) { - if (outBufLen-outBufPos > 0) { - rc = childPid->write(outBuf); - } -#endif else rc = 0; if (rc >= 0) outBufPos += rc; else { -#ifndef Q_WS_WIN if (errno == EINTR) continue; myDebug( << "write failed, rc: " << rc << ", error: " << strerror(errno) << endl); -#else - myDebug( << "write failed, rc: " << rc); -#endif error(ERR_CONNECTION_BROKEN,connectionHost); shutdownConnection(); return; @@ -1486,13 +1387,8 @@ with .fishsrv.pl typically running on another computer. */ sent(); } } -#ifndef Q_WS_WIN else if (FD_ISSET(childFd,&rfds)) { rc = ::read(childFd, buf + offset, sizeof(buf) - offset); -#else - else if (childPid->waitForReadyRead(1000)) { - rc = childPid->read(buf + offset, sizeof(buf) - offset); -#endif //myDebug( << "read " << rc << " bytes" << endl); if (rc > 0) { int noff = received(buf, rc + offset); @@ -1500,13 +1396,9 @@ with .fishsrv.pl typically running on another computer. */ //myDebug( << "left " << noff << " bytes: " << QString::fromLatin1(buf,offset) << endl); offset = noff; } else { -#ifndef Q_WS_WIN if (errno == EINTR) continue; myDebug( << "read failed, rc: " << rc << ", error: " << strerror(errno) << endl); -#else - myDebug( << "read failed, rc: " << rc ); -#endif error(ERR_CONNECTION_BROKEN,connectionHost); shutdownConnection(); return; diff --git a/kioslave/fish/fish.h b/kioslave/fish/fish.h index 2991631d..23931ab6 100644 --- a/kioslave/fish/fish.h +++ b/kioslave/fish/fish.h @@ -82,11 +82,7 @@ private: // Private attributes /** fd for reading and writing to the process */ int childFd; /** buffer for data to be written */ -#ifndef Q_WS_WIN const char *outBuf; -#else - QByteArray outBuf; -#endif /** current write position in buffer */ KIO::fileoffset_t outBufPos; /** length of buffer */ @@ -184,11 +180,7 @@ protected: // Protected attributes int fishCodeLen; protected: // Protected methods /** manages initial communication setup including password queries */ -#ifndef Q_WS_WIN int establishConnection(char *buffer, KIO::fileoffset_t buflen); -#else - int establishConnection(const QByteArray &buffer); -#endif int received(const char *buffer, KIO::fileoffset_t buflen); void sent(); /** builds each FISH request and sets the error counter */ @@ -202,11 +194,7 @@ protected: // Protected methods /** creates the subprocess */ bool connectionStart(); /** writes one chunk of data to stdin of child process */ -#ifndef Q_WS_WIN void writeChild(const char *buf, KIO::fileoffset_t len); -#else - void writeChild(const QByteArray &buf, KIO::fileoffset_t len); -#endif /** parses response from server and acts accordingly */ void manageConnection(const QString &line); /** writes to process */ diff --git a/kioslave/network/network/builder/slp/slpservicebrowser.cpp b/kioslave/network/network/builder/slp/slpservicebrowser.cpp index bee6face..1fed76f6 100644 --- a/kioslave/network/network/builder/slp/slpservicebrowser.cpp +++ b/kioslave/network/network/builder/slp/slpservicebrowser.cpp @@ -27,13 +27,11 @@ #include -#ifndef Q_OS_WIN extern "C" { /* let it still work, even someone installed a non-SuSE openslp */ SLPEXP const char* SLPAPI SLPGetMDNSName( SLPHandle hSLP, const char* pcURL ) __attribute__ ((weak)); } -#endif namespace Mollet { diff --git a/kioslave/sftp/kio_sftp.cpp b/kioslave/sftp/kio_sftp.cpp index 908bfe01..1278b079 100644 --- a/kioslave/sftp/kio_sftp.cpp +++ b/kioslave/sftp/kio_sftp.cpp @@ -448,11 +448,9 @@ QString sftpProtocol::canonicalizePath(const QString &path) { sftpProtocol::sftpProtocol(const QByteArray &pool_socket, const QByteArray &app_socket) : SlaveBase("kio_sftp", pool_socket, app_socket), mConnected(false), mPort(-1), mSession(NULL), mSftp(NULL), mPublicKeyAuthInfo(0) { -#ifndef Q_WS_WIN kDebug(KIO_SFTP_DB) << "pid = " << getpid(); kDebug(KIO_SFTP_DB) << "debug = " << getenv("KIO_SFTP_LOG_VERBOSITY"); -#endif mCallbacks = (ssh_callbacks) malloc(sizeof(struct ssh_callbacks_struct)); if (mCallbacks == NULL) { @@ -493,9 +491,7 @@ sftpProtocol::sftpProtocol(const QByteArray &pool_socket, const QByteArray &app_ } sftpProtocol::~sftpProtocol() { -#ifndef Q_WS_WIN kDebug(KIO_SFTP_DB) << "pid = " << getpid(); -#endif closeConnection(); delete mCallbacks; diff --git a/kioslave/thumbnail/comiccreator.cpp b/kioslave/thumbnail/comiccreator.cpp index 24d42e8f..0f79b71a 100644 --- a/kioslave/thumbnail/comiccreator.cpp +++ b/kioslave/thumbnail/comiccreator.cpp @@ -280,22 +280,14 @@ int ComicCreator::startProcess(const QString& processPath, const QStringList& ar /// Run a process and store std::out, std::err data in their respective buffers. int ret = 0; -#if defined(Q_OS_WIN) - m_process.reset(new QProcess(this)); -#else m_process.reset(new KPtyProcess(this)); m_process->setOutputChannelMode(KProcess::SeparateChannels); -#endif connect(m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(readProcessOut())); connect(m_process.data(), SIGNAL(readyReadStandardError()), SLOT(readProcessErr())); connect(m_process.data(), SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(finishedProcess(int, QProcess::ExitStatus))); -#if defined(Q_OS_WIN) - m_process->start(processPath, args, QIODevice::ReadWrite | QIODevice::Unbuffered); - ret = m_process->waitForFinished(-1) ? 0 : 1; -#else m_process->setProgram(processPath, args); m_process->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered); m_process->start(); @@ -303,7 +295,6 @@ int ComicCreator::startProcess(const QString& processPath, const QStringList& ar m_loop = &loop; ret = loop.exec(QEventLoop::WaitForMoreEvents); m_loop = 0; -#endif return ret; } diff --git a/kioslave/thumbnail/comiccreator.h b/kioslave/thumbnail/comiccreator.h index cb292b83..06d19f55 100644 --- a/kioslave/thumbnail/comiccreator.h +++ b/kioslave/thumbnail/comiccreator.h @@ -37,11 +37,7 @@ #include #include -#if defined(Q_OS_WIN) - #include -#else #include -#endif class KArchiveDirectory; class QEventLoop; @@ -81,11 +77,7 @@ class ComicCreator : public QObject, public ThumbCreator void finishedProcess(int exitCode, QProcess::ExitStatus exitStatus); private: -#if defined(Q_OS_WIN) - QScopedPointer m_process; -#else QScopedPointer m_process; -#endif QByteArray m_stdOut; QByteArray m_stdErr; QEventLoop* m_loop; diff --git a/kioslave/thumbnail/thumbnail.cpp b/kioslave/thumbnail/thumbnail.cpp index f2330597..5c9dd5bf 100644 --- a/kioslave/thumbnail/thumbnail.cpp +++ b/kioslave/thumbnail/thumbnail.cpp @@ -26,10 +26,8 @@ #include #endif #include -#ifndef Q_WS_WIN #include #include -#endif #include #include @@ -344,7 +342,6 @@ void ThumbnailProtocol::get(const KUrl &url) data(imgData); } } else { -#ifndef Q_WS_WIN QByteArray imgData; QDataStream stream( &imgData, QIODevice::WriteOnly ); //kDebug(7115) << "IMAGE TO SHMID"; @@ -367,7 +364,6 @@ void ThumbnailProtocol::get(const KUrl &url) shmdt((char*)shmaddr); mimeType("application/octet-stream"); data(imgData); -#endif } finished(); } diff --git a/kioslave/trash/tests/lockingtest.cpp b/kioslave/trash/tests/lockingtest.cpp index 81ccbc99..eb391309 100644 --- a/kioslave/trash/tests/lockingtest.cpp +++ b/kioslave/trash/tests/lockingtest.cpp @@ -36,11 +36,7 @@ int main(int argc, char **argv) lock.waitForLockGranted(); qDebug("retrieved lock"); qDebug("sleeping..."); -#ifdef Q_OS_WIN - Sleep(10*1000); -#else sleep(10); -#endif if (argc != 2) { lock.unlock(); diff --git a/kioslave/trash/trashimpl.cpp b/kioslave/trash/trashimpl.cpp index 5dc57cac..2d3494dc 100644 --- a/kioslave/trash/trashimpl.cpp +++ b/kioslave/trash/trashimpl.cpp @@ -219,9 +219,7 @@ bool TrashImpl::createInfo( const QString& origPath, int& trashId, QString& file * off_t should be 64bit on Unix systems to have large file support * FIXME: on windows this gets disabled until trash gets integrated */ -#ifndef Q_OS_WIN char off_t_should_be_64bit[sizeof(off_t) >= 8 ? 1:-1]; (void)off_t_should_be_64bit; -#endif KDE_struct_stat buff_src; if ( KDE_lstat( origPath_c.data(), &buff_src ) == -1 ) { if ( errno == EACCES ) @@ -308,11 +306,7 @@ QString TrashImpl::makeRelativePath( const QString& topdir, const QString& path { const QString realPath = KStandardDirs::realFilePath( path ); // topdir ends with '/' -#ifndef Q_OS_WIN if ( realPath.startsWith( topdir ) ) { -#else - if ( realPath.startsWith( topdir, Qt::CaseInsensitive ) ) { -#endif const QString rel = realPath.mid( topdir.length() ); Q_ASSERT( rel[0] != QLatin1Char('/') ); return rel; diff --git a/kmenuedit/basictab.cpp b/kmenuedit/basictab.cpp index 868a4bcc..57ff2662 100644 --- a/kmenuedit/basictab.cpp +++ b/kmenuedit/basictab.cpp @@ -36,9 +36,7 @@ #include #include -#ifndef Q_WS_WIN #include "khotkeys.h" -#endif #include "klinespellchecking.h" #include "menuinfo.h" @@ -234,10 +232,8 @@ BasicTab::BasicTab( QWidget *parent ) advancedLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); addTab(advanced, i18n("Advanced")); -#ifndef Q_WS_WIN if (!KHotKeys::present()) general_group_keybind->hide(); -#endif slotDisableAction(); } @@ -367,7 +363,6 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo) _iconButton->setIcon(df->readIcon()); // key binding part -#ifndef Q_WS_WIN if( KHotKeys::present()) { if ( !entryInfo->shortcut().isEmpty() ) @@ -375,7 +370,6 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo) else _keyEdit->clearKeySequence(); } -#endif QString temp = df->desktopGroup().readEntry("Exec"); if (temp.startsWith(QLatin1String("ksystraycmd "))) { @@ -525,7 +519,6 @@ void BasicTab::slotCapturedKeySequence(const QKeySequence& seq) if (signalsBlocked()) return; KShortcut cut(seq, QKeySequence()); -#ifndef Q_WS_WIN if (_menuEntryInfo->isShortcutAvailable( cut ) && KHotKeys::present() ) { _menuEntryInfo->setShortcut( cut ); @@ -535,7 +528,6 @@ void BasicTab::slotCapturedKeySequence(const QKeySequence& seq) // We will not assign the shortcut so reset the visible key sequence _keyEdit->setKeySequence(QKeySequence()); } -#endif if (_menuEntryInfo) emit changed( _menuEntryInfo ); } diff --git a/kmenuedit/main.cpp b/kmenuedit/main.cpp index 77fc5ab9..b8af237a 100644 --- a/kmenuedit/main.cpp +++ b/kmenuedit/main.cpp @@ -25,9 +25,7 @@ #include #include "kmenuedit.h" -#ifndef Q_WS_WIN #include "khotkeys.h" -#endif static const char description[] = I18N_NOOP("KDE menu editor"); static const char version[] = "0.9"; @@ -38,9 +36,7 @@ class KMenuApplication : public KUniqueApplication { public: KMenuApplication() { } -#ifndef Q_WS_WIN virtual ~KMenuApplication() { KHotKeys::cleanup(); } -#endif virtual int newInstance() { KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); diff --git a/kmenuedit/menuinfo.cpp b/kmenuedit/menuinfo.cpp index 63085e3d..d688454c 100644 --- a/kmenuedit/menuinfo.cpp +++ b/kmenuedit/menuinfo.cpp @@ -26,9 +26,7 @@ #include #include "menufile.h" -#ifndef Q_WS_WIN #include "khotkeys.h" -#endif // // MenuFolderInfo @@ -177,7 +175,6 @@ void MenuFolderInfo::save(MenuFile *menuFile) { if (s_deletedApps) { -#ifndef Q_WS_WIN // Remove hotkeys for applications that have been deleted for(QStringList::ConstIterator it = s_deletedApps->constBegin(); it != s_deletedApps->constEnd(); ++it) @@ -185,7 +182,6 @@ void MenuFolderInfo::save(MenuFile *menuFile) // The shorcut is deleted if we set a empty sequence KHotKeys::changeMenuEntryShortcut(*it, ""); } -#endif delete s_deletedApps; s_deletedApps = 0; } @@ -330,7 +326,6 @@ void MenuEntryInfo::save() m_desktopFile->sync(); dirty = false; } -#ifndef Q_WS_WIN if (shortcutDirty) { if( KHotKeys::present()) @@ -339,7 +334,6 @@ void MenuEntryInfo::save() } shortcutDirty = false; } -#endif } void MenuEntryInfo::setCaption(const QString &_caption) @@ -372,7 +366,6 @@ void MenuEntryInfo::setIcon(const QString &_icon) KShortcut MenuEntryInfo::shortcut() { -#ifndef Q_WS_WIN if (!shortcutLoaded) { shortcutLoaded = true; @@ -381,7 +374,6 @@ KShortcut MenuEntryInfo::shortcut() shortCut = KShortcut(KHotKeys::getMenuEntryShortcut( service->storageId() )); } } -#endif return shortCut; } diff --git a/knetattach/knetattach.cpp b/knetattach/knetattach.cpp index 3d348c1b..8d0583e9 100644 --- a/knetattach/knetattach.cpp +++ b/knetattach/knetattach.cpp @@ -198,12 +198,10 @@ bool KNetAttach::validateCurrentPage() url.setHost(_host->text().trimmed()); url.setUser(_user->text().trimmed()); QString path = _path->text().trimmed(); - #ifndef Q_WS_WIN // could a relative path really be made absolute by simply prepending a '/' ? if (!path.startsWith('/')) { path = QString("/") + path; } - #endif url.setPath(path); _folderParameters->setEnabled(false); bool success = doConnectionTest(url); diff --git a/knotify/knotify.cpp b/knotify/knotify.cpp index 632eedc1..49f14647 100644 --- a/knotify/knotify.cpp +++ b/knotify/knotify.cpp @@ -67,9 +67,7 @@ void KNotify::loadConfig() addPlugin(new NotifyByExecute(this)); addPlugin(new NotifyByLogfile(this)); //TODO reactivate on Mac/Win when KWindowSystem::demandAttention will implemented on this system. -#ifndef Q_WS_MAC addPlugin(new NotifyByTaskbar(this)); -#endif addPlugin(new NotifyByKTTS(this)); KService::List offers = KServiceTypeTrader::self()->query("KNotify/NotifyMethod"); diff --git a/knotify/notifybypopup.cpp b/knotify/notifybypopup.cpp index 552099a0..3daa1c90 100644 --- a/knotify/notifybypopup.cpp +++ b/knotify/notifybypopup.cpp @@ -71,9 +71,6 @@ NotifyByPopup::NotifyByPopup(QObject *parent) if(!m_dbusServiceExists) { bool startfdo = false; -#ifdef Q_WS_WIN - startfdo = true; -#else if (qgetenv("KDE_FULL_SESSION").isEmpty()) { QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus", @@ -91,7 +88,6 @@ NotifyByPopup::NotifyByPopup(QObject *parent) m_dbusServiceExists = true; } } -#endif if (startfdo) QDBusConnection::sessionBus().interface()->startService(dbusServiceName); } diff --git a/kpasswdserver/kpasswdserver.cpp b/kpasswdserver/kpasswdserver.cpp index 9aecc48e..ab4d7e44 100644 --- a/kpasswdserver/kpasswdserver.cpp +++ b/kpasswdserver/kpasswdserver.cpp @@ -574,11 +574,7 @@ KPasswdServer::processRequest() QStringList(), QString(), 0L, (KMessageBox::Notify | KMessageBox::NoExec)); - #ifndef Q_WS_WIN KWindowSystem::setMainWindow(dlg, request->windowId); - #else - KWindowSystem::setMainWindow(dlg, (HWND)(long)request->windowId); - #endif kDebug(debugArea()) << "Calling open on retry dialog" << dlg; m_authRetryInProgress.insert(dlg, request.take()); @@ -847,11 +843,7 @@ void KPasswdServer::showPasswordDialog (KPasswdServer::Request* request) dialogFlags |= KPasswordDialog::ShowKeepPassword; // instantiate dialog -#ifndef Q_WS_WIN kDebug(debugArea()) << "Widget for" << request->windowId << QWidget::find(request->windowId) << QApplication::activeWindow(); -#else - kDebug(debugArea()) << "Widget for" << request->windowId << QWidget::find((HWND)request->windowId) << QApplication::activeWindow(); -#endif KPasswordDialog* dlg = new KPasswordDialog(0, dialogFlags); connect(dlg, SIGNAL(finished(int)), this, SLOT(passwordDialogDone(int))); @@ -884,11 +876,7 @@ void KPasswdServer::showPasswordDialog (KPasswdServer::Request* request) if (info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).isValid () && password.isEmpty() && username.isEmpty()) dlg->setAnonymousMode(info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).toBool()); -#ifndef Q_WS_WIN KWindowSystem::setMainWindow(dlg, request->windowId); -#else - KWindowSystem::setMainWindow(dlg, (HWND)request->windowId); -#endif kDebug(debugArea()) << "Showing password dialog" << dlg << ", window-id=" << request->windowId; m_authInProgress.insert(dlg, request); diff --git a/krunner/krunnerapp.cpp b/krunner/krunnerapp.cpp index a0a3e244..be75117f 100644 --- a/krunner/krunnerapp.cpp +++ b/krunner/krunnerapp.cpp @@ -84,10 +84,8 @@ void KRunnerApp::cleanUp() m_interface = 0; delete m_runnerManager; m_runnerManager = 0; -#ifndef Q_WS_WIN delete m_tasks; m_tasks = 0; -#endif KGlobal::config()->sync(); } @@ -233,7 +231,6 @@ void KRunnerApp::showTaskManager() void KRunnerApp::showTaskManagerWithFilter(const QString &filterText) { -#ifndef Q_WS_WIN //kDebug(1204) << "Launching KSysGuard..."; if (!m_tasks) { m_tasks = new KSystemActivityDialog; @@ -247,7 +244,6 @@ void KRunnerApp::showTaskManagerWithFilter(const QString &filterText) m_tasks->run(); m_tasks->setFilterText(filterText); -#endif } void KRunnerApp::display() @@ -348,10 +344,8 @@ void KRunnerApp::clearHistory() void KRunnerApp::taskDialogFinished() { -#ifndef Q_WS_WIN m_tasks->deleteLater(); m_tasks = 0; -#endif } int KRunnerApp::newInstance() diff --git a/krunner/ksystemactivitydialog.cpp b/krunner/ksystemactivitydialog.cpp index 5c4bcac8..45bd0b36 100644 --- a/krunner/ksystemactivitydialog.cpp +++ b/krunner/ksystemactivitydialog.cpp @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef Q_WS_WIN #include "ksystemactivitydialog.h" @@ -110,5 +109,4 @@ void KSystemActivityDialog::saveDialogSettings() KGlobal::config()->sync(); } -#endif // not Q_WS_WIN diff --git a/krunner/ksystemactivitydialog.h b/krunner/ksystemactivitydialog.h index d72bebdf..d29cc573 100644 --- a/krunner/ksystemactivitydialog.h +++ b/krunner/ksystemactivitydialog.h @@ -19,7 +19,6 @@ #ifndef KSYSTEMACTIVITYDIALOG__H #define KSYSTEMACTIVITYDIALOG__H -#ifndef Q_WS_WIN #include @@ -58,6 +57,5 @@ class KSystemActivityDialog : public KDialog KSysGuardProcessList m_processList; }; -#endif // not Q_WS_WIN #endif // KSYSTEMACTIVITYDIALOG__H diff --git a/kscreensaver/krandom_screensaver/random.cpp b/kscreensaver/krandom_screensaver/random.cpp index 67fe07c9..a307ae4f 100644 --- a/kscreensaver/krandom_screensaver/random.cpp +++ b/kscreensaver/krandom_screensaver/random.cpp @@ -96,11 +96,7 @@ int main(int argc, char *argv[]) if (args->isSet("window-id")) { -#ifdef Q_WS_WIN - windowId = (HWND) args->getOption("window-id").toULong(); -#else windowId = args->getOption("window-id").toInt(); -#endif } #ifdef Q_WS_X11 @@ -155,11 +151,7 @@ int main(int argc, char *argv[]) cmd = service->exec(); QHash keyMap; -#ifdef Q_WS_WIN - keyMap.insert('w', QString::number((quintptr)windowId)); -#else keyMap.insert('w', QString::number(windowId)); -#endif const QStringList words = KShell::splitArgs(KMacroExpander::expandMacrosShellQuote(cmd, keyMap)); if (!words.isEmpty()) { QString exeFile = KStandardDirs::findExe(words.first()); diff --git a/kscreensaver/libkscreensaver/kscreensaver.cpp b/kscreensaver/libkscreensaver/kscreensaver.cpp index 6fa66e09..a64af466 100644 --- a/kscreensaver/libkscreensaver/kscreensaver.cpp +++ b/kscreensaver/libkscreensaver/kscreensaver.cpp @@ -31,9 +31,6 @@ #include #endif -#ifdef Q_WS_WIN -#include -#endif //----------------------------------------------------------------------------- @@ -58,9 +55,6 @@ bool KScreenSaver::event(QEvent* e) if ((e->type() == QEvent::Resize) && embeddedWidget) { embeddedWidget->resize( size() ); -#ifdef Q_WS_WIN - SetWindowPos(embeddedWidget->winId(), HWND_TOP, 0, 0, size().width(), size().height(), 0 ); -#endif } return r; } @@ -71,18 +65,6 @@ void KScreenSaver::embed( QWidget *w ) QApplication::sendPostedEvents(); #if defined(Q_WS_X11) //FIXME XReparentWindow(QX11Info::display(), w->winId(), winId(), 0, 0); -#elif defined(Q_WS_WIN) - SetParent(w->winId(), winId()); - - LONG style = GetWindowLong(w->winId(), GWL_STYLE); - style &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU); - SetWindowLong(w->winId(), GWL_STYLE, style); - - LONG exStyle = GetWindowLong(w->winId(), GWL_EXSTYLE); - exStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE); - SetWindowLong(w->winId(), GWL_EXSTYLE, exStyle); - - SetWindowPos(w->winId(), HWND_TOP, 0, 0, size().width(), size().height(), SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); #endif w->setGeometry( 0, 0, width(), height() ); embeddedWidget = w; diff --git a/kscreensaver/libkscreensaver/main.cpp b/kscreensaver/libkscreensaver/main.cpp index 561205a2..1e9846d4 100644 --- a/kscreensaver/libkscreensaver/main.cpp +++ b/kscreensaver/libkscreensaver/main.cpp @@ -153,13 +153,11 @@ int kScreenSaverMain( int argc, char** argv, KScreenSaverInterface& screenSaverI if (!pipe(termPipe)) { -#ifndef Q_WS_WIN struct sigaction sa; sa.sa_handler = termHandler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(SIGTERM, &sa, 0); -#endif QSocketNotifier *sn = new QSocketNotifier(termPipe[0], QSocketNotifier::Read, &app); QObject::connect(sn, SIGNAL(activated(int)), &app, SLOT(quit())); } @@ -188,11 +186,7 @@ int kScreenSaverMain( int argc, char** argv, KScreenSaverInterface& screenSaverI if (args->isSet("window-id")) { -#ifdef Q_WS_WIN - saveWin = (HWND)(args->getOption("window-id").toULong()); -#else saveWin = args->getOption("window-id").toInt(); -#endif } #ifdef Q_WS_X11 //FIXME diff --git a/ksplash/ksplashx/qcolor.cpp b/ksplash/ksplashx/qcolor.cpp index d8bce062..40bb309b 100644 --- a/ksplash/ksplashx/qcolor.cpp +++ b/ksplash/ksplashx/qcolor.cpp @@ -168,13 +168,8 @@ Global colors *****************************************************************************/ -#if defined(Q_WS_WIN) -#define COLOR0_PIX 0x00ffffff -#define COLOR1_PIX 0 -#else #define COLOR0_PIX 0 #define COLOR1_PIX 1 -#endif static QColor stdcol[19]; @@ -913,13 +908,7 @@ uint QColor::pixel() const if ( isDirty() ) return ((QColor*)this)->alloc(); else if ( colormodel == d8 ) -#ifdef Q_WS_WIN - // since d.d8.pix is uchar we have to use the PALETTEINDEX - // macro to get the respective palette entry index. - return (0x01000000 | (int)(short)(d.d8.pix)); -#else return d.d8.pix; -#endif else return d.d32.pix; } diff --git a/ksplash/ksplashx/qcolor.h b/ksplash/ksplashx/qcolor.h index deb973f4..9952dbfe 100644 --- a/ksplash/ksplashx/qcolor.h +++ b/ksplash/ksplashx/qcolor.h @@ -143,13 +143,6 @@ public: static int currentAllocContext(); static void destroyAllocContext( int ); -#if defined(Q_WS_WIN) - static const QRgb* palette( int* numEntries = 0 ); - static int setPaletteEntries( const QRgb* entries, int numEntries, - int base = -1 ); - static HPALETTE hPal() { return hpal; } - static uint realizePal( QWidget * ); -#endif static void initialize(); static void cleanup(); @@ -170,9 +163,6 @@ private: static QColor* globalColors(); static bool color_init; static bool globals_init; -#if defined(Q_WS_WIN) - static HPALETTE hpal; -#endif static enum ColorModel { d8, d32 } colormodel; union { QRgb argb; diff --git a/ksplash/ksplashx/qnamespace.h b/ksplash/ksplashx/qnamespace.h index f0b22ad5..7c2e4b98 100644 --- a/ksplash/ksplashx/qnamespace.h +++ b/ksplash/ksplashx/qnamespace.h @@ -214,11 +214,6 @@ public: WWinOwnDC = 0x00000000, WMacNoSheet = 0x00000000, WMacDrawer = 0x00000000, -#elif defined(Q_WS_MAC) - WX11BypassWM = 0x00000000, - WWinOwnDC = 0x00000000, - WMacNoSheet = 0x01000000, - WMacDrawer = 0x20000000, #else WX11BypassWM = 0x00000000, WWinOwnDC = 0x01000000, @@ -893,11 +888,7 @@ public: // "handle" type for system objects. Documented as \internal in // qapplication.cpp -#if defined(Q_WS_MAC) - typedef void * HANDLE; -#elif defined(Q_WS_WIN) - typedef void *HANDLE; -#elif defined(Q_WS_X11) +#if defined(Q_WS_X11) typedef unsigned long HANDLE; #elif defined(Q_WS_QWS) typedef void * HANDLE; diff --git a/ksplash/ksplashx/qpoint.h b/ksplash/ksplashx/qpoint.h index 9563403d..517b60d0 100644 --- a/ksplash/ksplashx/qpoint.h +++ b/ksplash/ksplashx/qpoint.h @@ -93,13 +93,8 @@ public: private: static void warningDivByZero(); -#if defined(Q_WS_MAC) - QCOORD yp; - QCOORD xp; -#else QCOORD xp; QCOORD yp; -#endif }; diff --git a/ksplash/ksplashx/qrect.h b/ksplash/ksplashx/qrect.h index 6c16ae3d..1bf97a34 100644 --- a/ksplash/ksplashx/qrect.h +++ b/ksplash/ksplashx/qrect.h @@ -145,17 +145,10 @@ private: #if defined(Q_WS_X11) || defined(Q_OS_TEMP) friend void qt_setCoords( QRect *r, int xp1, int yp1, int xp2, int yp2 ); #endif -#if defined(Q_WS_MAC) - QCOORD y1; - QCOORD x1; - QCOORD y2; - QCOORD x2; -#else QCOORD x1; QCOORD y1; QCOORD x2; QCOORD y2; -#endif }; Q_EXPORT bool operator==( const QRect &, const QRect & ); diff --git a/kstyles/oxygen/demo/oxygensimulator.cpp b/kstyles/oxygen/demo/oxygensimulator.cpp index 88143dfc..c1922c37 100644 --- a/kstyles/oxygen/demo/oxygensimulator.cpp +++ b/kstyles/oxygen/demo/oxygensimulator.cpp @@ -49,10 +49,6 @@ #include #include -#ifdef Q_OS_WIN -/* need windows.h include for Sleep function*/ -#include -#endif #ifdef Q_OS_UNIX #include @@ -796,12 +792,8 @@ namespace Oxygen int ms( 10 ); // sleep - #ifdef Q_OS_WIN - Sleep(uint(ms)); - #else struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; nanosleep(&ts, NULL); - #endif } diff --git a/kstyles/oxygen/oxygenstyle.cpp b/kstyles/oxygen/oxygenstyle.cpp index 100d1558..7e8af423 100644 --- a/kstyles/oxygen/oxygenstyle.cpp +++ b/kstyles/oxygen/oxygenstyle.cpp @@ -305,10 +305,6 @@ namespace Oxygen { widget->setAttribute( Qt::WA_TranslucentBackground ); - #ifdef Q_WS_WIN - //FramelessWindowHint is needed on windows to make WA_TranslucentBackground work properly - widget->setWindowFlags( widget->windowFlags() | Qt::FramelessWindowHint ); - #endif } if( QAbstractItemView *itemView = qobject_cast( widget ) ) @@ -390,10 +386,6 @@ namespace Oxygen widget->setBackgroundRole( QPalette::NoRole ); widget->setAttribute( Qt::WA_TranslucentBackground ); - #ifdef Q_WS_WIN - //FramelessWindowHint is needed on windows to make WA_TranslucentBackground work properly - widget->setWindowFlags( widget->windowFlags() | Qt::FramelessWindowHint ); - #endif } else if( qobject_cast( widget ) ) { @@ -431,19 +423,11 @@ namespace Oxygen } else if( qobject_cast( widget ) ) { widget->setAttribute( Qt::WA_TranslucentBackground ); - #ifdef Q_WS_WIN - //FramelessWindowHint is needed on windows to make WA_TranslucentBackground work properly - widget->setWindowFlags( widget->windowFlags() | Qt::FramelessWindowHint ); - #endif } else if( widget->inherits( "QComboBoxPrivateContainer" ) ) { addEventFilter( widget ); widget->setAttribute( Qt::WA_TranslucentBackground ); - #ifdef Q_WS_WIN - //FramelessWindowHint is needed on windows to make WA_TranslucentBackground work properly - widget->setWindowFlags( widget->windowFlags() | Qt::FramelessWindowHint ); - #endif } else if( qobject_cast( widget ) && widget->parent() && widget->parent()->inherits( "KTitleWidget" ) ) { @@ -1312,9 +1296,7 @@ namespace Oxygen helper().renderWindowBackground( &painter, r, dockWidget, color ); - #ifndef Q_WS_WIN helper().drawFloatFrame( &painter, r, color, !helper().compositingActive() ); - #endif } else { @@ -1481,10 +1463,8 @@ namespace Oxygen } - #ifndef Q_WS_WIN if( helper().compositingActive() ) helper().drawFloatFrame( &painter, r.adjusted( -1, -1, 1, 1 ), color, false ); else helper().drawFloatFrame( &painter, r, color, true ); - #endif // do not propagate return true; diff --git a/kwalletd/autotests/kwalletexecuter.cpp b/kwalletd/autotests/kwalletexecuter.cpp index 949db576..ef15fa3d 100644 --- a/kwalletd/autotests/kwalletexecuter.cpp +++ b/kwalletd/autotests/kwalletexecuter.cpp @@ -35,9 +35,7 @@ #include #include -#ifndef Q_OS_WIN extern char **environ; -#endif KWalletExecuter::KWalletExecuter(QObject* parent): QObject(parent) { diff --git a/kwalletd/backend/backendpersisthandler.cpp b/kwalletd/backend/backendpersisthandler.cpp index 126210ac..a7a6fe51 100644 --- a/kwalletd/backend/backendpersisthandler.cpp +++ b/kwalletd/backend/backendpersisthandler.cpp @@ -40,10 +40,6 @@ #include "sha1.h" #include "cbc.h" -#ifdef Q_OS_WIN -#include -#include -#endif #define KWALLET_CIPHER_BLOWFISH_CBC 0 #define KWALLET_CIPHER_3DES_CBC 1 // unsupported @@ -57,26 +53,6 @@ namespace KWallet { static int getRandomBlock(QByteArray& randBlock) { -#ifdef Q_OS_WIN //krazy:exclude=cpp - - // Use windows crypto API to get randomness on win32 - // HACK: this should be done using qca - HCRYPTPROV hProv; - - if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) return -1; // couldn't get random data - - if (!CryptGenRandom(hProv, static_cast(randBlock.size()), - (BYTE*)randBlock.data())) { - return -3; // read error - } - - // release the crypto context - CryptReleaseContext(hProv, 0); - - return randBlock.size(); - -#else // First try /dev/urandom if (QFile::exists("/dev/urandom")) { @@ -136,7 +112,6 @@ static int getRandomBlock(QByteArray& randBlock) { // Couldn't get any random data!! return -1; -#endif } diff --git a/kwalletd/backend/kwalletbackend.cc b/kwalletd/backend/kwalletbackend.cc index 7d439e37..118fb626 100644 --- a/kwalletd/backend/kwalletbackend.cc +++ b/kwalletd/backend/kwalletbackend.cc @@ -45,10 +45,6 @@ #include // quick fix to get random numbers on win32 -#ifdef Q_OS_WIN //krazy:exclude=cpp - #include - #include -#endif #define KWALLET_VERSION_MAJOR 0 #define KWALLET_VERSION_MINOR 1 diff --git a/kwin/kcmkwin/kwincompositing/dbus.h b/kwin/kcmkwin/kwincompositing/dbus.h index 05f5d23e..3ce3a3bf 100644 --- a/kwin/kcmkwin/kwincompositing/dbus.h +++ b/kwin/kcmkwin/kwincompositing/dbus.h @@ -43,4 +43,4 @@ public slots: } }; } -#endif \ No newline at end of file +#endif diff --git a/libs/ksysguard/processcore/processes.h b/libs/ksysguard/processcore/processes.h index e9546b26..7023cc8b 100644 --- a/libs/ksysguard/processcore/processes.h +++ b/libs/ksysguard/processcore/processes.h @@ -50,11 +50,7 @@ namespace KSysGuard * * @author John Tapsell */ -#ifdef Q_WS_WIN - class Processes : public QObject -#else class KDE_EXPORT Processes : public QObject -#endif { Q_OBJECT diff --git a/libs/ksysguard/processui/ProcessFilter.h b/libs/ksysguard/processui/ProcessFilter.h index 36fcf8c7..a28d1a68 100644 --- a/libs/ksysguard/processui/ProcessFilter.h +++ b/libs/ksysguard/processui/ProcessFilter.h @@ -30,13 +30,7 @@ class QModelIndex; -#ifdef Q_OS_WIN -// this workaround is needed to make krunner link under msvc -// please keep it this way even if you port this library to have a _export.h header file -#define KSYSGUARD_EXPORT -#else #define KSYSGUARD_EXPORT KDE_EXPORT -#endif class KSYSGUARD_EXPORT ProcessFilter : public QSortFilterProxyModel { diff --git a/libs/ksysguard/processui/ProcessModel.h b/libs/ksysguard/processui/ProcessModel.h index 506cc17d..a60705b6 100644 --- a/libs/ksysguard/processui/ProcessModel.h +++ b/libs/ksysguard/processui/ProcessModel.h @@ -36,13 +36,7 @@ namespace KSysGuard { class ProcessModelPrivate; -#ifdef Q_OS_WIN -// this workaround is needed to make krunner link under msvc -// please keep it this way even if you port this library to have a _export.h header file -#define KSYSGUARD_EXPORT -#else #define KSYSGUARD_EXPORT KDE_EXPORT -#endif class KSYSGUARD_EXPORT ProcessModel : public QAbstractItemModel { diff --git a/libs/taskmanager/taskmanager.cpp b/libs/taskmanager/taskmanager.cpp index ee1062c3..6be17c32 100644 --- a/libs/taskmanager/taskmanager.cpp +++ b/libs/taskmanager/taskmanager.cpp @@ -44,9 +44,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #endif -#ifdef Q_WS_WIN -#include -#endif #include @@ -517,11 +514,9 @@ bool TaskManager::isOnTop(const Task *task) const continue; } -#ifndef Q_WS_WIN if (!t->isIconified() && (t->isAlwaysOnTop() == task->isAlwaysOnTop())) { return false; } -#endif } return false; diff --git a/plasma/desktop/applets/kickoff/core/leavemodel.cpp b/plasma/desktop/applets/kickoff/core/leavemodel.cpp index 47559cef..b6943986 100644 --- a/plasma/desktop/applets/kickoff/core/leavemodel.cpp +++ b/plasma/desktop/applets/kickoff/core/leavemodel.cpp @@ -151,7 +151,6 @@ void LeaveModel::updateModel() bool addSystemSession = false; //FIXME: the proper fix is to implement the KWorkSpace methods for Windows -#ifndef Q_WS_WIN QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates(); if (spdMethods.contains(Solid::PowerManagement::StandbyState)) { QStandardItem *standbyOption = createStandardItem("leave:/standby"); @@ -186,7 +185,6 @@ void LeaveModel::updateModel() addSystemSession = true; } } -#endif appendRow(sessionOptions); if (addSystemSession) { diff --git a/plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp b/plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp index c54fc492..95972d0e 100644 --- a/plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp +++ b/plasma/desktop/applets/kickoff/simpleapplet/simpleapplet.cpp @@ -764,7 +764,6 @@ void MenuLauncherApplet::showMenu(bool pressed) leavemodel->updateModel(); d->addModel(leavemodel, Leave, Kickoff::MenuView::MergeFirstLevel, Kickoff::MenuView::Name); } else { -#ifndef Q_WS_WIN QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates(); if (vtname == "Standby") { if (spdMethods.contains(Solid::PowerManagement::StandbyState)) @@ -782,7 +781,6 @@ void MenuLauncherApplet::showMenu(bool pressed) if (KWorkSpace::canShutDown(KWorkSpace::ShutdownConfirmDefault, KWorkSpace::ShutdownTypeHalt)) menuview->addAction(KIcon(d->viewIcon(Shutdown)), d->viewText(Shutdown))->setData(KUrl("leave:/shutdown")); } -#endif } } } diff --git a/plasma/desktop/shell/desktopview.cpp b/plasma/desktop/shell/desktopview.cpp index f0f0371a..ba19e8c2 100644 --- a/plasma/desktop/shell/desktopview.cpp +++ b/plasma/desktop/shell/desktopview.cpp @@ -45,12 +45,6 @@ #include "plasmaapp.h" #include "plasma-shell-desktop.h" -#ifdef Q_WS_WIN -#include "windows.h" -#include "windef.h" -#include "wingdi.h" -#include "winuser.h" -#endif DesktopView::DesktopView(Plasma::Containment *containment, int id, QWidget *parent) : Plasma::View(containment, id, parent), @@ -71,14 +65,7 @@ DesktopView::DesktopView(Plasma::Containment *containment, int id, QWidget *pare */ //setFocusPolicy(Qt::NoFocus); -#ifdef Q_WS_WIN - setWindowFlags(Qt::FramelessWindowHint); - SetWindowPos(winId(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - HWND hwndDesktop = ::FindWindowW(L"Progman", NULL); - SetParent(winId(), hwndDesktop); -#else setWindowFlags(windowFlags() | Qt::FramelessWindowHint); -#endif checkDesktopAffiliation(); @@ -314,7 +301,6 @@ void DesktopView::toolBoxOpened(bool open) return; } -#ifndef Q_WS_WIN NETRootInfo info(QX11Info::display(), NET::Supported); if (!info.isSupported(NET::WM2ShowingDesktop)) { return; @@ -329,7 +315,6 @@ void DesktopView::toolBoxOpened(bool open) } info.setShowingDesktop(open); -#endif } void DesktopView::showWidgetExplorer() diff --git a/plasma/desktop/shell/panelview.cpp b/plasma/desktop/shell/panelview.cpp index 9a45ab64..81e98c9a 100644 --- a/plasma/desktop/shell/panelview.cpp +++ b/plasma/desktop/shell/panelview.cpp @@ -231,9 +231,6 @@ PanelView::PanelView(Plasma::Containment *panel, int id, QWidget *parent) pal.setBrush(backgroundRole(), Qt::transparent); setPalette(pal); -#ifdef Q_WS_WIN - registerAccessBar(true); -#endif KConfigGroup viewConfig = config(); KConfigGroup sizes = KConfigGroup(&viewConfig, "Sizes"); @@ -283,9 +280,6 @@ PanelView::~PanelView() delete m_glowBar; destroyUnhideTrigger(); -#ifdef Q_WS_WIN - registerAccessBar(false); -#endif } void PanelView::setContainment(Plasma::Containment *containment) @@ -418,9 +412,6 @@ void PanelView::setLocation(Plasma::Location location) c->resize(panelWidth, panelHeight); c->setMinimumSize(min); c->setMaximumSize(max); -#ifdef Q_WS_WIN - appBarPosChanged(); -#endif const QRect screenRect = PlasmaApp::self()->corona()->screenGeometry(c->screen()); pinchContainment(screenRect); KWindowSystem::setOnAllDesktops(winId(), true); @@ -1152,9 +1143,6 @@ void PanelView::resizeEvent(QResizeEvent *event) recreateUnhideTrigger(); m_strutsTimer->stop(); m_strutsTimer->start(STRUTSTIMERDELAY); -#ifdef Q_WS_WIN - appBarPosChanged(); -#endif if (containment()) { foreach (Plasma::Applet *applet, containment()->applets()) { diff --git a/plasma/desktop/shell/panelview.h b/plasma/desktop/shell/panelview.h index d105509a..ce080b29 100644 --- a/plasma/desktop/shell/panelview.h +++ b/plasma/desktop/shell/panelview.h @@ -32,10 +32,6 @@ #include #endif -#ifdef Q_WS_WIN -#include -#include -#endif class QWidget; class QTimeLine; @@ -217,14 +213,6 @@ private: void positionSpacer(const QPoint pos); bool hasPopup(); -#ifdef Q_WS_WIN - bool registerAccessBar(bool fRegister); - void appBarQuerySetPos(LPRECT lprc); - void appBarCallback(WPARAM message, LPARAM lParam); - void appBarPosChanged(); - bool winEvent(MSG *message, long *result); - APPBARDATA abd; -#endif private Q_SLOTS: void immutabilityChanged(Plasma::ImmutabilityType immutability); diff --git a/plasma/desktop/shell/plasmaapp.cpp b/plasma/desktop/shell/plasmaapp.cpp index c1294a1e..fe7b2d6c 100644 --- a/plasma/desktop/shell/plasmaapp.cpp +++ b/plasma/desktop/shell/plasmaapp.cpp @@ -20,13 +20,6 @@ #include "plasmaapp.h" -#ifdef Q_WS_WIN -#ifdef _WIN32_WINNT -#undef _WIN32_WINNT -#endif -#define _WIN32_WINNT 0x0500 -#include -#endif #include @@ -239,15 +232,6 @@ PlasmaApp::PlasmaApp() len = sizeof(memorySize); sysctl(mib, 2, &memorySize, &len, NULL, 0); memorySize /= 1024; -#endif -#ifdef Q_WS_WIN - size_t memorySize; - - MEMORYSTATUSEX statex; - statex.dwLength = sizeof (statex); - GlobalMemoryStatusEx (&statex); - - memorySize = (statex.ullTotalPhys/1024) + (statex.ullTotalPageFile/1024); #endif // If you have no suitable sysconf() interface and are not FreeBSD, // then you are out of luck and get a compile error. diff --git a/plasma/desktop/toolboxes/desktoptoolbox.cpp b/plasma/desktop/toolboxes/desktoptoolbox.cpp index d5632e09..24c3b84b 100644 --- a/plasma/desktop/toolboxes/desktoptoolbox.cpp +++ b/plasma/desktop/toolboxes/desktoptoolbox.cpp @@ -46,9 +46,6 @@ #include -#ifdef Q_OS_WIN -#include -#endif class EmptyGraphicsItem : public QGraphicsWidget { @@ -806,13 +803,9 @@ void DesktopToolBox::lockScreen() return; } -#ifndef Q_OS_WIN const QString interface("org.freedesktop.ScreenSaver"); QDBusInterface screensaver(interface, "/ScreenSaver"); screensaver.asyncCall("Lock"); -#else - LockWorkStation(); -#endif // !Q_OS_WIN } void DesktopToolBox::startLogout() diff --git a/plasma/generic/containmentactions/contextmenu/menu.cpp b/plasma/generic/containmentactions/contextmenu/menu.cpp index bfd60a12..955a2ce5 100644 --- a/plasma/generic/containmentactions/contextmenu/menu.cpp +++ b/plasma/generic/containmentactions/contextmenu/menu.cpp @@ -39,10 +39,6 @@ #include "krunner_interface.h" #include "screensaver_interface.h" -#ifdef Q_OS_WIN -#define _WIN32_WINNT 0x0500 // require NT 5.0 (win 2k pro) -#include -#endif // Q_OS_WIN ContextMenu::ContextMenu(QObject *parent, const QVariantList &args) : Plasma::ContainmentActions(parent, args), @@ -208,16 +204,12 @@ void ContextMenu::lockScreen() return; } -#ifndef Q_OS_WIN QString interface("org.freedesktop.ScreenSaver"); org::freedesktop::ScreenSaver screensaver(interface, "/ScreenSaver", QDBusConnection::sessionBus()); if (screensaver.isValid()) { screensaver.Lock(); } -#else - LockWorkStation(); -#endif // !Q_OS_WIN } void ContextMenu::startLogout() diff --git a/plasma/generic/declarativeimports/core/dialog.cpp b/plasma/generic/declarativeimports/core/dialog.cpp index 861103b5..8c68a696 100644 --- a/plasma/generic/declarativeimports/core/dialog.cpp +++ b/plasma/generic/declarativeimports/core/dialog.cpp @@ -364,12 +364,10 @@ int DialogProxy::windowFlags() const return (int)m_flags; } -#ifndef Q_WS_WIN qulonglong DialogProxy::windowId() const { return m_dialog->winId(); } -#endif void DialogProxy::setWindowFlags(const int flags) { diff --git a/plasma/generic/declarativeimports/core/dialog.h b/plasma/generic/declarativeimports/core/dialog.h index 08a466d6..150221fb 100644 --- a/plasma/generic/declarativeimports/core/dialog.h +++ b/plasma/generic/declarativeimports/core/dialog.h @@ -146,12 +146,10 @@ class DialogProxy : public QDeclarativeItem */ Q_PROPERTY(int location READ location WRITE setLocation NOTIFY locationChanged) //This won't be available on windows, but should be used only by kwin and never by applets anyways -#ifndef Q_WS_WIN /** * Window ID of the dialog window. **/ Q_PROPERTY(qulonglong windowId READ windowId CONSTANT) -#endif public: enum WidgetAttribute { @@ -193,9 +191,7 @@ public: QObject *margins() const; -#ifndef Q_WS_WIN qulonglong windowId() const; -#endif /** * @returns The suggested screen position for the popup diff --git a/plasma/generic/declarativeimports/qtextracomponents/tests/columnproxymodeltest.h b/plasma/generic/declarativeimports/qtextracomponents/tests/columnproxymodeltest.h index 46b8d409..d7151f55 100644 --- a/plasma/generic/declarativeimports/qtextracomponents/tests/columnproxymodeltest.h +++ b/plasma/generic/declarativeimports/qtextracomponents/tests/columnproxymodeltest.h @@ -29,4 +29,4 @@ class ColumnProxyModelTest : public QObject void testInit(); }; -#endif \ No newline at end of file +#endif diff --git a/plasma/generic/runners/bookmarks/bookmarksrunner_defs.h b/plasma/generic/runners/bookmarks/bookmarksrunner_defs.h index 211925af..8b1b732c 100644 --- a/plasma/generic/runners/bookmarks/bookmarksrunner_defs.h +++ b/plasma/generic/runners/bookmarks/bookmarksrunner_defs.h @@ -23,4 +23,4 @@ #define kdbg_code 1207 -#endif \ No newline at end of file +#endif