removed win and mac code

This commit is contained in:
Ivailo Monev 2014-11-19 17:57:24 +00:00
parent a3331afd2c
commit 0a82433c59
58 changed files with 6 additions and 613 deletions

View file

@ -168,11 +168,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
{ {
QList<Debugger> internalDebuggers = Debugger::availableInternalDebuggers("KCrash"); QList<Debugger> internalDebuggers = Debugger::availableInternalDebuggers("KCrash");
KConfigGroup config(KGlobal::config(), "DrKonqi"); KConfigGroup config(KGlobal::config(), "DrKonqi");
#ifndef Q_OS_WIN
QString defaultDebuggerName = config.readEntry("Debugger", QString("gdb")); QString defaultDebuggerName = config.readEntry("Debugger", QString("gdb"));
#else
QString defaultDebuggerName = config.readEntry("Debugger", QString("kdbgwin"));
#endif
Debugger firstKnownGoodDebugger, preferredDebugger; Debugger firstKnownGoodDebugger, preferredDebugger;
foreach (const Debugger & debugger, internalDebuggers) { foreach (const Debugger & debugger, internalDebuggers) {

View file

@ -43,7 +43,6 @@ static const char description[] = I18N_NOOP("The KDE Crash Handler gives the use
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
#ifndef Q_OS_WIN //krazy:exclude=cpp
// TODO - Investigate and fix this, or work around it as follows... // TODO - Investigate and fix this, or work around it as follows...
// #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) // #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
// When starting Dr Konqi via kdeinit4, Apple OS X aborts us unconditionally for // 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()) { if (setuid(getuid()) < 0 && geteuid() != getuid()) {
exit(255); exit(255);
} }
#endif
// Prevent KApplication from setting the crash handler. We will set it later... // Prevent KApplication from setting the crash handler. We will set it later...
setenv("KDE_DEBUG", "true", 1); setenv("KDE_DEBUG", "true", 1);

View file

@ -151,13 +151,8 @@ void DesktopPathConfig::defaults()
// the following method is copied from kdelibs/kdecore/config/kconfiggroup.cpp // the following method is copied from kdelibs/kdecore/config/kconfiggroup.cpp
static bool cleanHomeDirPath( QString &path, const QString &homeDir ) 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)) if (!path.startsWith(homeDir))
return false; return false;
#endif
int len = homeDir.length(); int len = homeDir.length();
// replace by "$HOME" if possible // replace by "$HOME" if possible

View file

@ -516,11 +516,7 @@ KFonts::KFonts(QWidget *parent, const QVariantList &args)
// NOTE: keep in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp // NOTE: keep in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp
#ifdef Q_WS_MAC #if defined(Q_WS_MAEMO_5) || defined(MEEGO_EDITION_HARMATTAN)
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)
QFont f0("Sans Serif", 16); // general/menu/desktop QFont f0("Sans Serif", 16); // general/menu/desktop
QFont f1("Monospace", 16; QFont f1("Monospace", 16;
QFont f2("Sans Serif", 16); // toolbar QFont f2("Sans Serif", 16); // toolbar

View file

@ -35,8 +35,6 @@
#include <QApplication> #include <QApplication>
#elif defined(Q_WS_MACX) #elif defined(Q_WS_MACX)
#include "kglobalaccel_mac.h" #include "kglobalaccel_mac.h"
#elif defined(Q_WS_WIN)
#include "kglobalaccel_win.h"
#else #else
#include "kglobalaccel_qws.h" #include "kglobalaccel_qws.h"
#endif #endif

View file

@ -22,137 +22,3 @@
#include <kdebug.h> #include <kdebug.h>
#ifdef Q_WS_MAC
#include <QMultiMap>
#include <QList>
#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<KGlobalAccelImpl *>(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<KGlobalAccelImpl *>(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<int, QList<EventHotKeyRef> >();
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<uint> 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<EventHotKeyRef> 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<int> 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

View file

@ -76,11 +76,7 @@ ArchiveProtocol::~ArchiveProtocol()
bool ArchiveProtocol::checkNewFile( const KUrl & url, QString & path, KIO::Error& errorNum ) bool ArchiveProtocol::checkNewFile( const KUrl & url, QString & path, KIO::Error& errorNum )
{ {
#ifndef Q_WS_WIN
QString fullPath = url.path(); QString fullPath = url.path();
#else
QString fullPath = url.path().remove(0, 1);
#endif
kDebug(7109) << "ArchiveProtocol::checkNewFile" << fullPath; kDebug(7109) << "ArchiveProtocol::checkNewFile" << fullPath;
@ -134,15 +130,10 @@ bool ArchiveProtocol::checkNewFile( const KUrl & url, QString & path, KIO::Error
{ {
archiveFile = tryPath; archiveFile = tryPath;
m_mtime = statbuf.st_mtime; 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); KUser user(statbuf.st_uid);
m_user = user.loginName(); m_user = user.loginName();
KUserGroup group(statbuf.st_gid); KUserGroup group(statbuf.st_gid);
m_group = group.name(); m_group = group.name();
#endif
path = fullPath.mid( pos + 1 ); path = fullPath.mid( pos + 1 );
kDebug(7109).nospace() << "fullPath=" << fullPath << " path=" << path; kDebug(7109).nospace() << "fullPath=" << fullPath << " path=" << path;
len = path.length(); len = path.length();
@ -349,11 +340,7 @@ void ArchiveProtocol::stat( const KUrl & url )
kDebug( 7109 ).nospace() << "ArchiveProtocol::stat returning name=" << url.fileName(); kDebug( 7109 ).nospace() << "ArchiveProtocol::stat returning name=" << url.fileName();
KDE_struct_stat buff; KDE_struct_stat buff;
#ifdef Q_WS_WIN
QString fullPath = url.path().remove(0, 1);
#else
QString fullPath = url.path(); QString fullPath = url.path();
#endif
if ( KDE_stat( QFile::encodeName( fullPath ), &buff ) == -1 ) if ( KDE_stat( QFile::encodeName( fullPath ), &buff ) == -1 )
{ {

View file

@ -64,7 +64,6 @@ DesktopProtocol::~DesktopProtocol()
void DesktopProtocol::checkLocalInstall() void DesktopProtocol::checkLocalInstall()
{ {
#ifndef Q_WS_WIN
// We can't use KGlobalSettings::desktopPath() here, since it returns the home dir // We can't use KGlobalSettings::desktopPath() here, since it returns the home dir
// if the desktop folder doesn't exist. // if the desktop folder doesn't exist.
QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
@ -145,7 +144,6 @@ void DesktopProtocol::checkLocalInstall()
trash.desktopGroup().writeEntry("EmptyIcon", "user-trash"); trash.desktopGroup().writeEntry("EmptyIcon", "user-trash");
} }
} }
#endif
} }
bool DesktopProtocol::rewriteUrl(const KUrl &url, KUrl &newUrl) bool DesktopProtocol::rewriteUrl(const KUrl &url, KUrl &newUrl)

View file

@ -104,11 +104,7 @@
#define sendmimeType(x) mimeType(x) #define sendmimeType(x) mimeType(x)
#endif #endif
#ifdef Q_WS_WIN
#define ENDLINE "\r\n"
#else
#define ENDLINE '\n' #define ENDLINE '\n'
#endif
static char *sshPath = NULL; static char *sshPath = NULL;
static char *suPath = NULL; static char *suPath = NULL;
@ -116,11 +112,7 @@ static char *suPath = NULL;
// static int isOpenSSH = 0; // static int isOpenSSH = 0;
/** the SSH process used to communicate with the remote end */ /** the SSH process used to communicate with the remote end */
#ifndef Q_WS_WIN
static pid_t childPid; static pid_t childPid;
#else
static KProcess *childPid = 0;
#endif
#define E(x) ((const char*)remoteEncoding()->encode(x).data()) #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) { if (sshPath == NULL) {
// disabled: currently not needed. Didn't work reliably. // disabled: currently not needed. Didn't work reliably.
// isOpenSSH = !system("ssh -V 2>&1 | grep OpenSSH > /dev/null"); // 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"))); sshPath = strdup(QFile::encodeName(KStandardDirs::findExe("ssh")));
#endif
} }
if (suPath == NULL) { if (suPath == NULL) {
suPath = strdup(QFile::encodeName(KStandardDirs::findExe("su"))); suPath = strdup(QFile::encodeName(KStandardDirs::findExe("su")));
@ -310,7 +298,6 @@ void fishProtocol::openConnection() {
} }
// XXX Use KPty! XXX // XXX Use KPty! XXX
#ifndef Q_WS_WIN
static int open_pty_pair(int fd[2]) static int open_pty_pair(int fd[2])
{ {
#if defined(HAVE_TERMIOS_H) && defined(HAVE_GRANTPT) && !defined(HAVE_OPENPTY) #if defined(HAVE_TERMIOS_H) && defined(HAVE_GRANTPT) && !defined(HAVE_OPENPTY)
@ -376,7 +363,6 @@ close_master:
#endif #endif
#endif #endif
} }
#endif
/** /**
creates the subprocess creates the subprocess
*/ */
@ -385,52 +371,14 @@ bool fishProtocol::connectionStart() {
int rc, flags; int rc, flags;
thisFn.clear(); thisFn.clear();
#ifndef Q_WS_WIN
rc = open_pty_pair(fd); rc = open_pty_pair(fd);
if (rc == -1) { if (rc == -1) {
myDebug( << "socketpair failed, error: " << strerror(errno) << endl); myDebug( << "socketpair failed, error: " << strerror(errno) << endl);
return true; return true;
} }
#endif
if (!requestNetwork()) return true; if (!requestNetwork()) return true;
myDebug( << "Exec: " << (local ? suPath : sshPath) << " Port: " << connectionPort << " User: " << connectionUser << endl); 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(); childPid = fork();
if (childPid == -1) { if (childPid == -1) {
myDebug( << "fork failed, error: " << strerror(errno) << endl); myDebug( << "fork failed, error: " << strerror(errno) << endl);
@ -554,20 +502,14 @@ bool fishProtocol::connectionStart() {
} }
} }
} }
#endif
return false; return false;
} }
/** /**
writes one chunk of data to stdin of child process writes one chunk of data to stdin of child process
*/ */
#ifndef Q_WS_WIN
void fishProtocol::writeChild(const char *buf, KIO::fileoffset_t len) { void fishProtocol::writeChild(const char *buf, KIO::fileoffset_t len) {
if (outBufPos >= 0 && outBuf) { if (outBufPos >= 0 && outBuf) {
#else
void fishProtocol::writeChild(const QByteArray &buf, KIO::fileoffset_t len) {
if (outBufPos >= 0 && outBuf.size()) {
#endif
#if 0 #if 0
QString debug = QString::fromLatin1(outBuf,outBufLen); 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); 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 manages initial communication setup including password queries
*/ */
#ifndef Q_WS_WIN
int fishProtocol::establishConnection(char *buffer, KIO::fileoffset_t len) { int fishProtocol::establishConnection(char *buffer, KIO::fileoffset_t len) {
QString buf = QString::fromLatin1(buffer,len); QString buf = QString::fromLatin1(buffer,len);
#else
int fishProtocol::establishConnection(const QByteArray &buffer) {
QString buf = buffer;
#endif
int pos=0; int pos=0;
// Strip trailing whitespace // Strip trailing whitespace
while (buf.length() && (buf[buf.length()-1] == ' ')) while (buf.length() && (buf[buf.length()-1] == ' '))
@ -671,10 +608,6 @@ int fishProtocol::establishConnection(const QByteArray &buffer) {
writeChild(connectionAuth.password.toLatin1(),connectionAuth.password.length()); writeChild(connectionAuth.password.toLatin1(),connectionAuth.password.length());
} }
thisFn.clear(); thisFn.clear();
#ifdef Q_WS_WIN
return buf.length();
}
#else
return 0; return 0;
} else if (buf.endsWith('?')) { } else if (buf.endsWith('?')) {
int rc = messageBox(QuestionYesNo,thisFn+buf); int rc = messageBox(QuestionYesNo,thisFn+buf);
@ -686,22 +619,9 @@ int fishProtocol::establishConnection(const QByteArray &buffer) {
thisFn.clear(); thisFn.clear();
return 0; return 0;
} }
#endif
else { else {
myDebug( << "unmatched case in initial handling! should not happen!" << endl); 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(); return buf.length();
} }
@ -756,17 +676,11 @@ Closes the connection
*/ */
void fishProtocol::shutdownConnection(bool forced){ void fishProtocol::shutdownConnection(bool forced){
if (childPid) { if (childPid) {
#ifdef Q_WS_WIN
childPid->terminate();
#else
int killStatus = kill(childPid,SIGTERM); // We may not have permission... int killStatus = kill(childPid,SIGTERM); // We may not have permission...
if (killStatus == 0) waitpid(childPid, 0, 0); if (killStatus == 0) waitpid(childPid, 0, 0);
#endif
childPid = 0; childPid = 0;
#ifndef Q_WS_WIN
::close(childFd); // ...in which case this should do the trick ::close(childFd); // ...in which case this should do the trick
childFd = -1; childFd = -1;
#endif
if (!forced) if (!forced)
{ {
dropNetwork(); dropNetwork();
@ -1427,14 +1341,11 @@ with .fishsrv.pl typically running on another computer. */
int rc; int rc;
isRunning = true; isRunning = true;
finished(); finished();
#ifndef Q_WS_WIN
fd_set rfds, wfds; fd_set rfds, wfds;
FD_ZERO(&rfds); FD_ZERO(&rfds);
#endif
char buf[32768]; char buf[32768];
int offset = 0; int offset = 0;
while (isRunning) { while (isRunning) {
#ifndef Q_WS_WIN
FD_SET(childFd,&rfds); FD_SET(childFd,&rfds);
FD_ZERO(&wfds); FD_ZERO(&wfds);
if (outBufPos >= 0) FD_SET(childFd,&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 (FD_ISSET(childFd,&wfds) && outBufPos >= 0) {
if (outBufLen-outBufPos > 0) if (outBufLen-outBufPos > 0)
rc = ::write(childFd, outBuf + outBufPos, outBufLen - outBufPos); rc = ::write(childFd, outBuf + outBufPos, outBufLen - outBufPos);
#else
if (outBufPos >= 0) {
if (outBufLen-outBufPos > 0) {
rc = childPid->write(outBuf);
}
#endif
else else
rc = 0; rc = 0;
if (rc >= 0) if (rc >= 0)
outBufPos += rc; outBufPos += rc;
else { else {
#ifndef Q_WS_WIN
if (errno == EINTR) if (errno == EINTR)
continue; continue;
myDebug( << "write failed, rc: " << rc << ", error: " << strerror(errno) << endl); myDebug( << "write failed, rc: " << rc << ", error: " << strerror(errno) << endl);
#else
myDebug( << "write failed, rc: " << rc);
#endif
error(ERR_CONNECTION_BROKEN,connectionHost); error(ERR_CONNECTION_BROKEN,connectionHost);
shutdownConnection(); shutdownConnection();
return; return;
@ -1486,13 +1387,8 @@ with .fishsrv.pl typically running on another computer. */
sent(); sent();
} }
} }
#ifndef Q_WS_WIN
else if (FD_ISSET(childFd,&rfds)) { else if (FD_ISSET(childFd,&rfds)) {
rc = ::read(childFd, buf + offset, sizeof(buf) - offset); 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); //myDebug( << "read " << rc << " bytes" << endl);
if (rc > 0) { if (rc > 0) {
int noff = received(buf, rc + offset); 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); //myDebug( << "left " << noff << " bytes: " << QString::fromLatin1(buf,offset) << endl);
offset = noff; offset = noff;
} else { } else {
#ifndef Q_WS_WIN
if (errno == EINTR) if (errno == EINTR)
continue; continue;
myDebug( << "read failed, rc: " << rc << ", error: " << strerror(errno) << endl); myDebug( << "read failed, rc: " << rc << ", error: " << strerror(errno) << endl);
#else
myDebug( << "read failed, rc: " << rc );
#endif
error(ERR_CONNECTION_BROKEN,connectionHost); error(ERR_CONNECTION_BROKEN,connectionHost);
shutdownConnection(); shutdownConnection();
return; return;

View file

@ -82,11 +82,7 @@ private: // Private attributes
/** fd for reading and writing to the process */ /** fd for reading and writing to the process */
int childFd; int childFd;
/** buffer for data to be written */ /** buffer for data to be written */
#ifndef Q_WS_WIN
const char *outBuf; const char *outBuf;
#else
QByteArray outBuf;
#endif
/** current write position in buffer */ /** current write position in buffer */
KIO::fileoffset_t outBufPos; KIO::fileoffset_t outBufPos;
/** length of buffer */ /** length of buffer */
@ -184,11 +180,7 @@ protected: // Protected attributes
int fishCodeLen; int fishCodeLen;
protected: // Protected methods protected: // Protected methods
/** manages initial communication setup including password queries */ /** manages initial communication setup including password queries */
#ifndef Q_WS_WIN
int establishConnection(char *buffer, KIO::fileoffset_t buflen); int establishConnection(char *buffer, KIO::fileoffset_t buflen);
#else
int establishConnection(const QByteArray &buffer);
#endif
int received(const char *buffer, KIO::fileoffset_t buflen); int received(const char *buffer, KIO::fileoffset_t buflen);
void sent(); void sent();
/** builds each FISH request and sets the error counter */ /** builds each FISH request and sets the error counter */
@ -202,11 +194,7 @@ protected: // Protected methods
/** creates the subprocess */ /** creates the subprocess */
bool connectionStart(); bool connectionStart();
/** writes one chunk of data to stdin of child process */ /** writes one chunk of data to stdin of child process */
#ifndef Q_WS_WIN
void writeChild(const char *buf, KIO::fileoffset_t len); 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 */ /** parses response from server and acts accordingly */
void manageConnection(const QString &line); void manageConnection(const QString &line);
/** writes to process */ /** writes to process */

View file

@ -27,13 +27,11 @@
#include <KDebug> #include <KDebug>
#ifndef Q_OS_WIN
extern "C" extern "C"
{ {
/* let it still work, even someone installed a non-SuSE openslp */ /* let it still work, even someone installed a non-SuSE openslp */
SLPEXP const char* SLPAPI SLPGetMDNSName( SLPHandle hSLP, const char* pcURL ) __attribute__ ((weak)); SLPEXP const char* SLPAPI SLPGetMDNSName( SLPHandle hSLP, const char* pcURL ) __attribute__ ((weak));
} }
#endif
namespace Mollet namespace Mollet
{ {

View file

@ -448,11 +448,9 @@ QString sftpProtocol::canonicalizePath(const QString &path) {
sftpProtocol::sftpProtocol(const QByteArray &pool_socket, const QByteArray &app_socket) sftpProtocol::sftpProtocol(const QByteArray &pool_socket, const QByteArray &app_socket)
: SlaveBase("kio_sftp", pool_socket, app_socket), : SlaveBase("kio_sftp", pool_socket, app_socket),
mConnected(false), mPort(-1), mSession(NULL), mSftp(NULL), mPublicKeyAuthInfo(0) { mConnected(false), mPort(-1), mSession(NULL), mSftp(NULL), mPublicKeyAuthInfo(0) {
#ifndef Q_WS_WIN
kDebug(KIO_SFTP_DB) << "pid = " << getpid(); kDebug(KIO_SFTP_DB) << "pid = " << getpid();
kDebug(KIO_SFTP_DB) << "debug = " << getenv("KIO_SFTP_LOG_VERBOSITY"); kDebug(KIO_SFTP_DB) << "debug = " << getenv("KIO_SFTP_LOG_VERBOSITY");
#endif
mCallbacks = (ssh_callbacks) malloc(sizeof(struct ssh_callbacks_struct)); mCallbacks = (ssh_callbacks) malloc(sizeof(struct ssh_callbacks_struct));
if (mCallbacks == NULL) { if (mCallbacks == NULL) {
@ -493,9 +491,7 @@ sftpProtocol::sftpProtocol(const QByteArray &pool_socket, const QByteArray &app_
} }
sftpProtocol::~sftpProtocol() { sftpProtocol::~sftpProtocol() {
#ifndef Q_WS_WIN
kDebug(KIO_SFTP_DB) << "pid = " << getpid(); kDebug(KIO_SFTP_DB) << "pid = " << getpid();
#endif
closeConnection(); closeConnection();
delete mCallbacks; delete mCallbacks;

View file

@ -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. /// Run a process and store std::out, std::err data in their respective buffers.
int ret = 0; int ret = 0;
#if defined(Q_OS_WIN)
m_process.reset(new QProcess(this));
#else
m_process.reset(new KPtyProcess(this)); m_process.reset(new KPtyProcess(this));
m_process->setOutputChannelMode(KProcess::SeparateChannels); m_process->setOutputChannelMode(KProcess::SeparateChannels);
#endif
connect(m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(readProcessOut())); connect(m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(readProcessOut()));
connect(m_process.data(), SIGNAL(readyReadStandardError()), SLOT(readProcessErr())); connect(m_process.data(), SIGNAL(readyReadStandardError()), SLOT(readProcessErr()));
connect(m_process.data(), SIGNAL(finished(int, QProcess::ExitStatus)), connect(m_process.data(), SIGNAL(finished(int, QProcess::ExitStatus)),
SLOT(finishedProcess(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->setProgram(processPath, args);
m_process->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered); m_process->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered);
m_process->start(); m_process->start();
@ -303,7 +295,6 @@ int ComicCreator::startProcess(const QString& processPath, const QStringList& ar
m_loop = &loop; m_loop = &loop;
ret = loop.exec(QEventLoop::WaitForMoreEvents); ret = loop.exec(QEventLoop::WaitForMoreEvents);
m_loop = 0; m_loop = 0;
#endif
return ret; return ret;
} }

View file

@ -37,11 +37,7 @@
#include <QImage> #include <QImage>
#include <QtCore/QScopedPointer> #include <QtCore/QScopedPointer>
#if defined(Q_OS_WIN)
#include <QtCore/QProcess>
#else
#include <kptyprocess.h> #include <kptyprocess.h>
#endif
class KArchiveDirectory; class KArchiveDirectory;
class QEventLoop; class QEventLoop;
@ -81,11 +77,7 @@ class ComicCreator : public QObject, public ThumbCreator
void finishedProcess(int exitCode, QProcess::ExitStatus exitStatus); void finishedProcess(int exitCode, QProcess::ExitStatus exitStatus);
private: private:
#if defined(Q_OS_WIN)
QScopedPointer<QProcess> m_process;
#else
QScopedPointer<KPtyProcess> m_process; QScopedPointer<KPtyProcess> m_process;
#endif
QByteArray m_stdOut; QByteArray m_stdOut;
QByteArray m_stdErr; QByteArray m_stdErr;
QEventLoop* m_loop; QEventLoop* m_loop;

View file

@ -26,10 +26,8 @@
#include <machine/param.h> #include <machine/param.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#ifndef Q_WS_WIN
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/shm.h> #include <sys/shm.h>
#endif
#include <QtCore/QBuffer> #include <QtCore/QBuffer>
#include <QtCore/QFile> #include <QtCore/QFile>
@ -344,7 +342,6 @@ void ThumbnailProtocol::get(const KUrl &url)
data(imgData); data(imgData);
} }
} else { } else {
#ifndef Q_WS_WIN
QByteArray imgData; QByteArray imgData;
QDataStream stream( &imgData, QIODevice::WriteOnly ); QDataStream stream( &imgData, QIODevice::WriteOnly );
//kDebug(7115) << "IMAGE TO SHMID"; //kDebug(7115) << "IMAGE TO SHMID";
@ -367,7 +364,6 @@ void ThumbnailProtocol::get(const KUrl &url)
shmdt((char*)shmaddr); shmdt((char*)shmaddr);
mimeType("application/octet-stream"); mimeType("application/octet-stream");
data(imgData); data(imgData);
#endif
} }
finished(); finished();
} }

View file

@ -36,11 +36,7 @@ int main(int argc, char **argv)
lock.waitForLockGranted(); lock.waitForLockGranted();
qDebug("retrieved lock"); qDebug("retrieved lock");
qDebug("sleeping..."); qDebug("sleeping...");
#ifdef Q_OS_WIN
Sleep(10*1000);
#else
sleep(10); sleep(10);
#endif
if (argc != 2) { if (argc != 2) {
lock.unlock(); lock.unlock();

View file

@ -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 * off_t should be 64bit on Unix systems to have large file support
* FIXME: on windows this gets disabled until trash gets integrated * 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; char off_t_should_be_64bit[sizeof(off_t) >= 8 ? 1:-1]; (void)off_t_should_be_64bit;
#endif
KDE_struct_stat buff_src; KDE_struct_stat buff_src;
if ( KDE_lstat( origPath_c.data(), &buff_src ) == -1 ) { if ( KDE_lstat( origPath_c.data(), &buff_src ) == -1 ) {
if ( errno == EACCES ) if ( errno == EACCES )
@ -308,11 +306,7 @@ QString TrashImpl::makeRelativePath( const QString& topdir, const QString& path
{ {
const QString realPath = KStandardDirs::realFilePath( path ); const QString realPath = KStandardDirs::realFilePath( path );
// topdir ends with '/' // topdir ends with '/'
#ifndef Q_OS_WIN
if ( realPath.startsWith( topdir ) ) { if ( realPath.startsWith( topdir ) ) {
#else
if ( realPath.startsWith( topdir, Qt::CaseInsensitive ) ) {
#endif
const QString rel = realPath.mid( topdir.length() ); const QString rel = realPath.mid( topdir.length() );
Q_ASSERT( rel[0] != QLatin1Char('/') ); Q_ASSERT( rel[0] != QLatin1Char('/') );
return rel; return rel;

View file

@ -36,9 +36,7 @@
#include <KUrlRequester> #include <KUrlRequester>
#include <KShell> #include <KShell>
#ifndef Q_WS_WIN
#include "khotkeys.h" #include "khotkeys.h"
#endif
#include "klinespellchecking.h" #include "klinespellchecking.h"
#include "menuinfo.h" #include "menuinfo.h"
@ -234,10 +232,8 @@ BasicTab::BasicTab( QWidget *parent )
advancedLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); advancedLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding));
addTab(advanced, i18n("Advanced")); addTab(advanced, i18n("Advanced"));
#ifndef Q_WS_WIN
if (!KHotKeys::present()) if (!KHotKeys::present())
general_group_keybind->hide(); general_group_keybind->hide();
#endif
slotDisableAction(); slotDisableAction();
} }
@ -367,7 +363,6 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo)
_iconButton->setIcon(df->readIcon()); _iconButton->setIcon(df->readIcon());
// key binding part // key binding part
#ifndef Q_WS_WIN
if( KHotKeys::present()) if( KHotKeys::present())
{ {
if ( !entryInfo->shortcut().isEmpty() ) if ( !entryInfo->shortcut().isEmpty() )
@ -375,7 +370,6 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo)
else else
_keyEdit->clearKeySequence(); _keyEdit->clearKeySequence();
} }
#endif
QString temp = df->desktopGroup().readEntry("Exec"); QString temp = df->desktopGroup().readEntry("Exec");
if (temp.startsWith(QLatin1String("ksystraycmd "))) if (temp.startsWith(QLatin1String("ksystraycmd ")))
{ {
@ -525,7 +519,6 @@ void BasicTab::slotCapturedKeySequence(const QKeySequence& seq)
if (signalsBlocked()) if (signalsBlocked())
return; return;
KShortcut cut(seq, QKeySequence()); KShortcut cut(seq, QKeySequence());
#ifndef Q_WS_WIN
if (_menuEntryInfo->isShortcutAvailable( cut ) && KHotKeys::present() ) if (_menuEntryInfo->isShortcutAvailable( cut ) && KHotKeys::present() )
{ {
_menuEntryInfo->setShortcut( cut ); _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 // We will not assign the shortcut so reset the visible key sequence
_keyEdit->setKeySequence(QKeySequence()); _keyEdit->setKeySequence(QKeySequence());
} }
#endif
if (_menuEntryInfo) if (_menuEntryInfo)
emit changed( _menuEntryInfo ); emit changed( _menuEntryInfo );
} }

View file

@ -25,9 +25,7 @@
#include <KAboutData> #include <KAboutData>
#include "kmenuedit.h" #include "kmenuedit.h"
#ifndef Q_WS_WIN
#include "khotkeys.h" #include "khotkeys.h"
#endif
static const char description[] = I18N_NOOP("KDE menu editor"); static const char description[] = I18N_NOOP("KDE menu editor");
static const char version[] = "0.9"; static const char version[] = "0.9";
@ -38,9 +36,7 @@ class KMenuApplication : public KUniqueApplication
{ {
public: public:
KMenuApplication() { } KMenuApplication() { }
#ifndef Q_WS_WIN
virtual ~KMenuApplication() { KHotKeys::cleanup(); } virtual ~KMenuApplication() { KHotKeys::cleanup(); }
#endif
virtual int newInstance() virtual int newInstance()
{ {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

View file

@ -26,9 +26,7 @@
#include <KConfigGroup> #include <KConfigGroup>
#include "menufile.h" #include "menufile.h"
#ifndef Q_WS_WIN
#include "khotkeys.h" #include "khotkeys.h"
#endif
// //
// MenuFolderInfo // MenuFolderInfo
@ -177,7 +175,6 @@ void MenuFolderInfo::save(MenuFile *menuFile)
{ {
if (s_deletedApps) if (s_deletedApps)
{ {
#ifndef Q_WS_WIN
// Remove hotkeys for applications that have been deleted // Remove hotkeys for applications that have been deleted
for(QStringList::ConstIterator it = s_deletedApps->constBegin(); for(QStringList::ConstIterator it = s_deletedApps->constBegin();
it != s_deletedApps->constEnd(); ++it) it != s_deletedApps->constEnd(); ++it)
@ -185,7 +182,6 @@ void MenuFolderInfo::save(MenuFile *menuFile)
// The shorcut is deleted if we set a empty sequence // The shorcut is deleted if we set a empty sequence
KHotKeys::changeMenuEntryShortcut(*it, ""); KHotKeys::changeMenuEntryShortcut(*it, "");
} }
#endif
delete s_deletedApps; delete s_deletedApps;
s_deletedApps = 0; s_deletedApps = 0;
} }
@ -330,7 +326,6 @@ void MenuEntryInfo::save()
m_desktopFile->sync(); m_desktopFile->sync();
dirty = false; dirty = false;
} }
#ifndef Q_WS_WIN
if (shortcutDirty) if (shortcutDirty)
{ {
if( KHotKeys::present()) if( KHotKeys::present())
@ -339,7 +334,6 @@ void MenuEntryInfo::save()
} }
shortcutDirty = false; shortcutDirty = false;
} }
#endif
} }
void MenuEntryInfo::setCaption(const QString &_caption) void MenuEntryInfo::setCaption(const QString &_caption)
@ -372,7 +366,6 @@ void MenuEntryInfo::setIcon(const QString &_icon)
KShortcut MenuEntryInfo::shortcut() KShortcut MenuEntryInfo::shortcut()
{ {
#ifndef Q_WS_WIN
if (!shortcutLoaded) if (!shortcutLoaded)
{ {
shortcutLoaded = true; shortcutLoaded = true;
@ -381,7 +374,6 @@ KShortcut MenuEntryInfo::shortcut()
shortCut = KShortcut(KHotKeys::getMenuEntryShortcut( service->storageId() )); shortCut = KShortcut(KHotKeys::getMenuEntryShortcut( service->storageId() ));
} }
} }
#endif
return shortCut; return shortCut;
} }

View file

@ -198,12 +198,10 @@ bool KNetAttach::validateCurrentPage()
url.setHost(_host->text().trimmed()); url.setHost(_host->text().trimmed());
url.setUser(_user->text().trimmed()); url.setUser(_user->text().trimmed());
QString path = _path->text().trimmed(); QString path = _path->text().trimmed();
#ifndef Q_WS_WIN
// could a relative path really be made absolute by simply prepending a '/' ? // could a relative path really be made absolute by simply prepending a '/' ?
if (!path.startsWith('/')) { if (!path.startsWith('/')) {
path = QString("/") + path; path = QString("/") + path;
} }
#endif
url.setPath(path); url.setPath(path);
_folderParameters->setEnabled(false); _folderParameters->setEnabled(false);
bool success = doConnectionTest(url); bool success = doConnectionTest(url);

View file

@ -67,9 +67,7 @@ void KNotify::loadConfig()
addPlugin(new NotifyByExecute(this)); addPlugin(new NotifyByExecute(this));
addPlugin(new NotifyByLogfile(this)); addPlugin(new NotifyByLogfile(this));
//TODO reactivate on Mac/Win when KWindowSystem::demandAttention will implemented on this system. //TODO reactivate on Mac/Win when KWindowSystem::demandAttention will implemented on this system.
#ifndef Q_WS_MAC
addPlugin(new NotifyByTaskbar(this)); addPlugin(new NotifyByTaskbar(this));
#endif
addPlugin(new NotifyByKTTS(this)); addPlugin(new NotifyByKTTS(this));
KService::List offers = KServiceTypeTrader::self()->query("KNotify/NotifyMethod"); KService::List offers = KServiceTypeTrader::self()->query("KNotify/NotifyMethod");

View file

@ -71,9 +71,6 @@ NotifyByPopup::NotifyByPopup(QObject *parent)
if(!m_dbusServiceExists) if(!m_dbusServiceExists)
{ {
bool startfdo = false; bool startfdo = false;
#ifdef Q_WS_WIN
startfdo = true;
#else
if (qgetenv("KDE_FULL_SESSION").isEmpty()) if (qgetenv("KDE_FULL_SESSION").isEmpty())
{ {
QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus", QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus",
@ -91,7 +88,6 @@ NotifyByPopup::NotifyByPopup(QObject *parent)
m_dbusServiceExists = true; m_dbusServiceExists = true;
} }
} }
#endif
if (startfdo) if (startfdo)
QDBusConnection::sessionBus().interface()->startService(dbusServiceName); QDBusConnection::sessionBus().interface()->startService(dbusServiceName);
} }

View file

@ -574,11 +574,7 @@ KPasswdServer::processRequest()
QStringList(), QString(), 0L, QStringList(), QString(), 0L,
(KMessageBox::Notify | KMessageBox::NoExec)); (KMessageBox::Notify | KMessageBox::NoExec));
#ifndef Q_WS_WIN
KWindowSystem::setMainWindow(dlg, request->windowId); KWindowSystem::setMainWindow(dlg, request->windowId);
#else
KWindowSystem::setMainWindow(dlg, (HWND)(long)request->windowId);
#endif
kDebug(debugArea()) << "Calling open on retry dialog" << dlg; kDebug(debugArea()) << "Calling open on retry dialog" << dlg;
m_authRetryInProgress.insert(dlg, request.take()); m_authRetryInProgress.insert(dlg, request.take());
@ -847,11 +843,7 @@ void KPasswdServer::showPasswordDialog (KPasswdServer::Request* request)
dialogFlags |= KPasswordDialog::ShowKeepPassword; dialogFlags |= KPasswordDialog::ShowKeepPassword;
// instantiate dialog // instantiate dialog
#ifndef Q_WS_WIN
kDebug(debugArea()) << "Widget for" << request->windowId << QWidget::find(request->windowId) << QApplication::activeWindow(); 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); KPasswordDialog* dlg = new KPasswordDialog(0, dialogFlags);
connect(dlg, SIGNAL(finished(int)), this, SLOT(passwordDialogDone(int))); 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()) if (info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).isValid () && password.isEmpty() && username.isEmpty())
dlg->setAnonymousMode(info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).toBool()); dlg->setAnonymousMode(info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).toBool());
#ifndef Q_WS_WIN
KWindowSystem::setMainWindow(dlg, request->windowId); KWindowSystem::setMainWindow(dlg, request->windowId);
#else
KWindowSystem::setMainWindow(dlg, (HWND)request->windowId);
#endif
kDebug(debugArea()) << "Showing password dialog" << dlg << ", window-id=" << request->windowId; kDebug(debugArea()) << "Showing password dialog" << dlg << ", window-id=" << request->windowId;
m_authInProgress.insert(dlg, request); m_authInProgress.insert(dlg, request);

View file

@ -84,10 +84,8 @@ void KRunnerApp::cleanUp()
m_interface = 0; m_interface = 0;
delete m_runnerManager; delete m_runnerManager;
m_runnerManager = 0; m_runnerManager = 0;
#ifndef Q_WS_WIN
delete m_tasks; delete m_tasks;
m_tasks = 0; m_tasks = 0;
#endif
KGlobal::config()->sync(); KGlobal::config()->sync();
} }
@ -233,7 +231,6 @@ void KRunnerApp::showTaskManager()
void KRunnerApp::showTaskManagerWithFilter(const QString &filterText) void KRunnerApp::showTaskManagerWithFilter(const QString &filterText)
{ {
#ifndef Q_WS_WIN
//kDebug(1204) << "Launching KSysGuard..."; //kDebug(1204) << "Launching KSysGuard...";
if (!m_tasks) { if (!m_tasks) {
m_tasks = new KSystemActivityDialog; m_tasks = new KSystemActivityDialog;
@ -247,7 +244,6 @@ void KRunnerApp::showTaskManagerWithFilter(const QString &filterText)
m_tasks->run(); m_tasks->run();
m_tasks->setFilterText(filterText); m_tasks->setFilterText(filterText);
#endif
} }
void KRunnerApp::display() void KRunnerApp::display()
@ -348,10 +344,8 @@ void KRunnerApp::clearHistory()
void KRunnerApp::taskDialogFinished() void KRunnerApp::taskDialogFinished()
{ {
#ifndef Q_WS_WIN
m_tasks->deleteLater(); m_tasks->deleteLater();
m_tasks = 0; m_tasks = 0;
#endif
} }
int KRunnerApp::newInstance() int KRunnerApp::newInstance()

View file

@ -16,7 +16,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifndef Q_WS_WIN
#include "ksystemactivitydialog.h" #include "ksystemactivitydialog.h"
@ -110,5 +109,4 @@ void KSystemActivityDialog::saveDialogSettings()
KGlobal::config()->sync(); KGlobal::config()->sync();
} }
#endif // not Q_WS_WIN

View file

@ -19,7 +19,6 @@
#ifndef KSYSTEMACTIVITYDIALOG__H #ifndef KSYSTEMACTIVITYDIALOG__H
#define KSYSTEMACTIVITYDIALOG__H #define KSYSTEMACTIVITYDIALOG__H
#ifndef Q_WS_WIN
#include <KDialog> #include <KDialog>
@ -58,6 +57,5 @@ class KSystemActivityDialog : public KDialog
KSysGuardProcessList m_processList; KSysGuardProcessList m_processList;
}; };
#endif // not Q_WS_WIN
#endif // KSYSTEMACTIVITYDIALOG__H #endif // KSYSTEMACTIVITYDIALOG__H

View file

@ -96,11 +96,7 @@ int main(int argc, char *argv[])
if (args->isSet("window-id")) if (args->isSet("window-id"))
{ {
#ifdef Q_WS_WIN
windowId = (HWND) args->getOption("window-id").toULong();
#else
windowId = args->getOption("window-id").toInt(); windowId = args->getOption("window-id").toInt();
#endif
} }
#ifdef Q_WS_X11 #ifdef Q_WS_X11
@ -155,11 +151,7 @@ int main(int argc, char *argv[])
cmd = service->exec(); cmd = service->exec();
QHash<QChar, QString> keyMap; QHash<QChar, QString> keyMap;
#ifdef Q_WS_WIN
keyMap.insert('w', QString::number((quintptr)windowId));
#else
keyMap.insert('w', QString::number(windowId)); keyMap.insert('w', QString::number(windowId));
#endif
const QStringList words = KShell::splitArgs(KMacroExpander::expandMacrosShellQuote(cmd, keyMap)); const QStringList words = KShell::splitArgs(KMacroExpander::expandMacrosShellQuote(cmd, keyMap));
if (!words.isEmpty()) { if (!words.isEmpty()) {
QString exeFile = KStandardDirs::findExe(words.first()); QString exeFile = KStandardDirs::findExe(words.first());

View file

@ -31,9 +31,6 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif #endif
#ifdef Q_WS_WIN
#include <windows.h>
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -58,9 +55,6 @@ bool KScreenSaver::event(QEvent* e)
if ((e->type() == QEvent::Resize) && embeddedWidget) if ((e->type() == QEvent::Resize) && embeddedWidget)
{ {
embeddedWidget->resize( size() ); embeddedWidget->resize( size() );
#ifdef Q_WS_WIN
SetWindowPos(embeddedWidget->winId(), HWND_TOP, 0, 0, size().width(), size().height(), 0 );
#endif
} }
return r; return r;
} }
@ -71,18 +65,6 @@ void KScreenSaver::embed( QWidget *w )
QApplication::sendPostedEvents(); QApplication::sendPostedEvents();
#if defined(Q_WS_X11) //FIXME #if defined(Q_WS_X11) //FIXME
XReparentWindow(QX11Info::display(), w->winId(), winId(), 0, 0); 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 #endif
w->setGeometry( 0, 0, width(), height() ); w->setGeometry( 0, 0, width(), height() );
embeddedWidget = w; embeddedWidget = w;

View file

@ -153,13 +153,11 @@ int kScreenSaverMain( int argc, char** argv, KScreenSaverInterface& screenSaverI
if (!pipe(termPipe)) if (!pipe(termPipe))
{ {
#ifndef Q_WS_WIN
struct sigaction sa; struct sigaction sa;
sa.sa_handler = termHandler; sa.sa_handler = termHandler;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
sigaction(SIGTERM, &sa, 0); sigaction(SIGTERM, &sa, 0);
#endif
QSocketNotifier *sn = new QSocketNotifier(termPipe[0], QSocketNotifier::Read, &app); QSocketNotifier *sn = new QSocketNotifier(termPipe[0], QSocketNotifier::Read, &app);
QObject::connect(sn, SIGNAL(activated(int)), &app, SLOT(quit())); 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")) if (args->isSet("window-id"))
{ {
#ifdef Q_WS_WIN
saveWin = (HWND)(args->getOption("window-id").toULong());
#else
saveWin = args->getOption("window-id").toInt(); saveWin = args->getOption("window-id").toInt();
#endif
} }
#ifdef Q_WS_X11 //FIXME #ifdef Q_WS_X11 //FIXME

View file

@ -168,13 +168,8 @@
Global colors Global colors
*****************************************************************************/ *****************************************************************************/
#if defined(Q_WS_WIN)
#define COLOR0_PIX 0x00ffffff
#define COLOR1_PIX 0
#else
#define COLOR0_PIX 0 #define COLOR0_PIX 0
#define COLOR1_PIX 1 #define COLOR1_PIX 1
#endif
static QColor stdcol[19]; static QColor stdcol[19];
@ -913,13 +908,7 @@ uint QColor::pixel() const
if ( isDirty() ) if ( isDirty() )
return ((QColor*)this)->alloc(); return ((QColor*)this)->alloc();
else if ( colormodel == d8 ) 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; return d.d8.pix;
#endif
else else
return d.d32.pix; return d.d32.pix;
} }

View file

@ -143,13 +143,6 @@ public:
static int currentAllocContext(); static int currentAllocContext();
static void destroyAllocContext( int ); 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 initialize();
static void cleanup(); static void cleanup();
@ -170,9 +163,6 @@ private:
static QColor* globalColors(); static QColor* globalColors();
static bool color_init; static bool color_init;
static bool globals_init; static bool globals_init;
#if defined(Q_WS_WIN)
static HPALETTE hpal;
#endif
static enum ColorModel { d8, d32 } colormodel; static enum ColorModel { d8, d32 } colormodel;
union { union {
QRgb argb; QRgb argb;

View file

@ -214,11 +214,6 @@ public:
WWinOwnDC = 0x00000000, WWinOwnDC = 0x00000000,
WMacNoSheet = 0x00000000, WMacNoSheet = 0x00000000,
WMacDrawer = 0x00000000, WMacDrawer = 0x00000000,
#elif defined(Q_WS_MAC)
WX11BypassWM = 0x00000000,
WWinOwnDC = 0x00000000,
WMacNoSheet = 0x01000000,
WMacDrawer = 0x20000000,
#else #else
WX11BypassWM = 0x00000000, WX11BypassWM = 0x00000000,
WWinOwnDC = 0x01000000, WWinOwnDC = 0x01000000,
@ -893,11 +888,7 @@ public:
// "handle" type for system objects. Documented as \internal in // "handle" type for system objects. Documented as \internal in
// qapplication.cpp // qapplication.cpp
#if defined(Q_WS_MAC) #if defined(Q_WS_X11)
typedef void * HANDLE;
#elif defined(Q_WS_WIN)
typedef void *HANDLE;
#elif defined(Q_WS_X11)
typedef unsigned long HANDLE; typedef unsigned long HANDLE;
#elif defined(Q_WS_QWS) #elif defined(Q_WS_QWS)
typedef void * HANDLE; typedef void * HANDLE;

View file

@ -93,13 +93,8 @@ public:
private: private:
static void warningDivByZero(); static void warningDivByZero();
#if defined(Q_WS_MAC)
QCOORD yp;
QCOORD xp;
#else
QCOORD xp; QCOORD xp;
QCOORD yp; QCOORD yp;
#endif
}; };

View file

@ -145,17 +145,10 @@ private:
#if defined(Q_WS_X11) || defined(Q_OS_TEMP) #if defined(Q_WS_X11) || defined(Q_OS_TEMP)
friend void qt_setCoords( QRect *r, int xp1, int yp1, int xp2, int yp2 ); friend void qt_setCoords( QRect *r, int xp1, int yp1, int xp2, int yp2 );
#endif #endif
#if defined(Q_WS_MAC)
QCOORD y1;
QCOORD x1;
QCOORD y2;
QCOORD x2;
#else
QCOORD x1; QCOORD x1;
QCOORD y1; QCOORD y1;
QCOORD x2; QCOORD x2;
QCOORD y2; QCOORD y2;
#endif
}; };
Q_EXPORT bool operator==( const QRect &, const QRect & ); Q_EXPORT bool operator==( const QRect &, const QRect & );

View file

@ -49,10 +49,6 @@
#include <QtGui/QStyleOptionSlider> #include <QtGui/QStyleOptionSlider>
#include <QtGui/QToolButton> #include <QtGui/QToolButton>
#ifdef Q_OS_WIN
/* need windows.h include for Sleep function*/
#include <windows.h>
#endif
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#include <ctime> #include <ctime>
@ -796,12 +792,8 @@ namespace Oxygen
int ms( 10 ); int ms( 10 );
// sleep // sleep
#ifdef Q_OS_WIN
Sleep(uint(ms));
#else
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
nanosleep(&ts, NULL); nanosleep(&ts, NULL);
#endif
} }

View file

@ -305,10 +305,6 @@ namespace Oxygen
{ {
widget->setAttribute( Qt::WA_TranslucentBackground ); 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<QAbstractItemView*>( widget ) ) if( QAbstractItemView *itemView = qobject_cast<QAbstractItemView*>( widget ) )
@ -390,10 +386,6 @@ namespace Oxygen
widget->setBackgroundRole( QPalette::NoRole ); widget->setBackgroundRole( QPalette::NoRole );
widget->setAttribute( Qt::WA_TranslucentBackground ); 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<QScrollBar*>( widget ) ) { } else if( qobject_cast<QScrollBar*>( widget ) ) {
@ -431,19 +423,11 @@ namespace Oxygen
} else if( qobject_cast<QMenu*>( widget ) ) { } else if( qobject_cast<QMenu*>( widget ) ) {
widget->setAttribute( Qt::WA_TranslucentBackground ); 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" ) ) { } else if( widget->inherits( "QComboBoxPrivateContainer" ) ) {
addEventFilter( widget ); addEventFilter( widget );
widget->setAttribute( Qt::WA_TranslucentBackground ); 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<QFrame*>( widget ) && widget->parent() && widget->parent()->inherits( "KTitleWidget" ) ) { } else if( qobject_cast<QFrame*>( widget ) && widget->parent() && widget->parent()->inherits( "KTitleWidget" ) ) {
@ -1312,9 +1296,7 @@ namespace Oxygen
helper().renderWindowBackground( &painter, r, dockWidget, color ); helper().renderWindowBackground( &painter, r, dockWidget, color );
#ifndef Q_WS_WIN
helper().drawFloatFrame( &painter, r, color, !helper().compositingActive() ); helper().drawFloatFrame( &painter, r, color, !helper().compositingActive() );
#endif
} else { } 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 ); if( helper().compositingActive() ) helper().drawFloatFrame( &painter, r.adjusted( -1, -1, 1, 1 ), color, false );
else helper().drawFloatFrame( &painter, r, color, true ); else helper().drawFloatFrame( &painter, r, color, true );
#endif
// do not propagate // do not propagate
return true; return true;

View file

@ -35,9 +35,7 @@
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#ifndef Q_OS_WIN
extern char **environ; extern char **environ;
#endif
KWalletExecuter::KWalletExecuter(QObject* parent): QObject(parent) KWalletExecuter::KWalletExecuter(QObject* parent): QObject(parent)
{ {

View file

@ -40,10 +40,6 @@
#include "sha1.h" #include "sha1.h"
#include "cbc.h" #include "cbc.h"
#ifdef Q_OS_WIN
#include <windows.h>
#include <wincrypt.h>
#endif
#define KWALLET_CIPHER_BLOWFISH_CBC 0 #define KWALLET_CIPHER_BLOWFISH_CBC 0
#define KWALLET_CIPHER_3DES_CBC 1 // unsupported #define KWALLET_CIPHER_3DES_CBC 1 // unsupported
@ -57,26 +53,6 @@ namespace KWallet {
static int getRandomBlock(QByteArray& randBlock) { 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<DWORD>(randBlock.size()),
(BYTE*)randBlock.data())) {
return -3; // read error
}
// release the crypto context
CryptReleaseContext(hProv, 0);
return randBlock.size();
#else
// First try /dev/urandom // First try /dev/urandom
if (QFile::exists("/dev/urandom")) { if (QFile::exists("/dev/urandom")) {
@ -136,7 +112,6 @@ static int getRandomBlock(QByteArray& randBlock) {
// Couldn't get any random data!! // Couldn't get any random data!!
return -1; return -1;
#endif
} }

View file

@ -45,10 +45,6 @@
#include <assert.h> #include <assert.h>
// quick fix to get random numbers on win32 // quick fix to get random numbers on win32
#ifdef Q_OS_WIN //krazy:exclude=cpp
#include <windows.h>
#include <wincrypt.h>
#endif
#define KWALLET_VERSION_MAJOR 0 #define KWALLET_VERSION_MAJOR 0
#define KWALLET_VERSION_MINOR 1 #define KWALLET_VERSION_MINOR 1

View file

@ -50,11 +50,7 @@ namespace KSysGuard
* *
* @author John Tapsell <tapsell@kde.org> * @author John Tapsell <tapsell@kde.org>
*/ */
#ifdef Q_WS_WIN
class Processes : public QObject
#else
class KDE_EXPORT Processes : public QObject class KDE_EXPORT Processes : public QObject
#endif
{ {
Q_OBJECT Q_OBJECT

View file

@ -30,13 +30,7 @@
class QModelIndex; 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 #define KSYSGUARD_EXPORT KDE_EXPORT
#endif
class KSYSGUARD_EXPORT ProcessFilter : public QSortFilterProxyModel class KSYSGUARD_EXPORT ProcessFilter : public QSortFilterProxyModel
{ {

View file

@ -36,13 +36,7 @@ namespace KSysGuard {
class ProcessModelPrivate; 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 #define KSYSGUARD_EXPORT KDE_EXPORT
#endif
class KSYSGUARD_EXPORT ProcessModel : public QAbstractItemModel class KSYSGUARD_EXPORT ProcessModel : public QAbstractItemModel
{ {

View file

@ -44,9 +44,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <QX11Info> #include <QX11Info>
#endif #endif
#ifdef Q_WS_WIN
#include <windows.h>
#endif
#include <KActivities/Consumer> #include <KActivities/Consumer>
@ -517,11 +514,9 @@ bool TaskManager::isOnTop(const Task *task) const
continue; continue;
} }
#ifndef Q_WS_WIN
if (!t->isIconified() && (t->isAlwaysOnTop() == task->isAlwaysOnTop())) { if (!t->isIconified() && (t->isAlwaysOnTop() == task->isAlwaysOnTop())) {
return false; return false;
} }
#endif
} }
return false; return false;

View file

@ -151,7 +151,6 @@ void LeaveModel::updateModel()
bool addSystemSession = false; bool addSystemSession = false;
//FIXME: the proper fix is to implement the KWorkSpace methods for Windows //FIXME: the proper fix is to implement the KWorkSpace methods for Windows
#ifndef Q_WS_WIN
QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates(); QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates();
if (spdMethods.contains(Solid::PowerManagement::StandbyState)) { if (spdMethods.contains(Solid::PowerManagement::StandbyState)) {
QStandardItem *standbyOption = createStandardItem("leave:/standby"); QStandardItem *standbyOption = createStandardItem("leave:/standby");
@ -186,7 +185,6 @@ void LeaveModel::updateModel()
addSystemSession = true; addSystemSession = true;
} }
} }
#endif
appendRow(sessionOptions); appendRow(sessionOptions);
if (addSystemSession) { if (addSystemSession) {

View file

@ -764,7 +764,6 @@ void MenuLauncherApplet::showMenu(bool pressed)
leavemodel->updateModel(); leavemodel->updateModel();
d->addModel(leavemodel, Leave, Kickoff::MenuView::MergeFirstLevel, Kickoff::MenuView::Name); d->addModel(leavemodel, Leave, Kickoff::MenuView::MergeFirstLevel, Kickoff::MenuView::Name);
} else { } else {
#ifndef Q_WS_WIN
QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates(); QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates();
if (vtname == "Standby") { if (vtname == "Standby") {
if (spdMethods.contains(Solid::PowerManagement::StandbyState)) if (spdMethods.contains(Solid::PowerManagement::StandbyState))
@ -782,7 +781,6 @@ void MenuLauncherApplet::showMenu(bool pressed)
if (KWorkSpace::canShutDown(KWorkSpace::ShutdownConfirmDefault, KWorkSpace::ShutdownTypeHalt)) if (KWorkSpace::canShutDown(KWorkSpace::ShutdownConfirmDefault, KWorkSpace::ShutdownTypeHalt))
menuview->addAction(KIcon(d->viewIcon(Shutdown)), d->viewText(Shutdown))->setData(KUrl("leave:/shutdown")); menuview->addAction(KIcon(d->viewIcon(Shutdown)), d->viewText(Shutdown))->setData(KUrl("leave:/shutdown"));
} }
#endif
} }
} }
} }

View file

@ -45,12 +45,6 @@
#include "plasmaapp.h" #include "plasmaapp.h"
#include "plasma-shell-desktop.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) DesktopView::DesktopView(Plasma::Containment *containment, int id, QWidget *parent)
: Plasma::View(containment, id, parent), : Plasma::View(containment, id, parent),
@ -71,14 +65,7 @@ DesktopView::DesktopView(Plasma::Containment *containment, int id, QWidget *pare
*/ */
//setFocusPolicy(Qt::NoFocus); //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); setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
#endif
checkDesktopAffiliation(); checkDesktopAffiliation();
@ -314,7 +301,6 @@ void DesktopView::toolBoxOpened(bool open)
return; return;
} }
#ifndef Q_WS_WIN
NETRootInfo info(QX11Info::display(), NET::Supported); NETRootInfo info(QX11Info::display(), NET::Supported);
if (!info.isSupported(NET::WM2ShowingDesktop)) { if (!info.isSupported(NET::WM2ShowingDesktop)) {
return; return;
@ -329,7 +315,6 @@ void DesktopView::toolBoxOpened(bool open)
} }
info.setShowingDesktop(open); info.setShowingDesktop(open);
#endif
} }
void DesktopView::showWidgetExplorer() void DesktopView::showWidgetExplorer()

View file

@ -231,9 +231,6 @@ PanelView::PanelView(Plasma::Containment *panel, int id, QWidget *parent)
pal.setBrush(backgroundRole(), Qt::transparent); pal.setBrush(backgroundRole(), Qt::transparent);
setPalette(pal); setPalette(pal);
#ifdef Q_WS_WIN
registerAccessBar(true);
#endif
KConfigGroup viewConfig = config(); KConfigGroup viewConfig = config();
KConfigGroup sizes = KConfigGroup(&viewConfig, "Sizes"); KConfigGroup sizes = KConfigGroup(&viewConfig, "Sizes");
@ -283,9 +280,6 @@ PanelView::~PanelView()
delete m_glowBar; delete m_glowBar;
destroyUnhideTrigger(); destroyUnhideTrigger();
#ifdef Q_WS_WIN
registerAccessBar(false);
#endif
} }
void PanelView::setContainment(Plasma::Containment *containment) void PanelView::setContainment(Plasma::Containment *containment)
@ -418,9 +412,6 @@ void PanelView::setLocation(Plasma::Location location)
c->resize(panelWidth, panelHeight); c->resize(panelWidth, panelHeight);
c->setMinimumSize(min); c->setMinimumSize(min);
c->setMaximumSize(max); c->setMaximumSize(max);
#ifdef Q_WS_WIN
appBarPosChanged();
#endif
const QRect screenRect = PlasmaApp::self()->corona()->screenGeometry(c->screen()); const QRect screenRect = PlasmaApp::self()->corona()->screenGeometry(c->screen());
pinchContainment(screenRect); pinchContainment(screenRect);
KWindowSystem::setOnAllDesktops(winId(), true); KWindowSystem::setOnAllDesktops(winId(), true);
@ -1152,9 +1143,6 @@ void PanelView::resizeEvent(QResizeEvent *event)
recreateUnhideTrigger(); recreateUnhideTrigger();
m_strutsTimer->stop(); m_strutsTimer->stop();
m_strutsTimer->start(STRUTSTIMERDELAY); m_strutsTimer->start(STRUTSTIMERDELAY);
#ifdef Q_WS_WIN
appBarPosChanged();
#endif
if (containment()) { if (containment()) {
foreach (Plasma::Applet *applet, containment()->applets()) { foreach (Plasma::Applet *applet, containment()->applets()) {

View file

@ -32,10 +32,6 @@
#include <fixx11h.h> #include <fixx11h.h>
#endif #endif
#ifdef Q_WS_WIN
#include <windows.h>
#include <shellapi.h>
#endif
class QWidget; class QWidget;
class QTimeLine; class QTimeLine;
@ -217,14 +213,6 @@ private:
void positionSpacer(const QPoint pos); void positionSpacer(const QPoint pos);
bool hasPopup(); 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: private Q_SLOTS:
void immutabilityChanged(Plasma::ImmutabilityType immutability); void immutabilityChanged(Plasma::ImmutabilityType immutability);

View file

@ -20,13 +20,6 @@
#include "plasmaapp.h" #include "plasmaapp.h"
#ifdef Q_WS_WIN
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0500
#include <windows.h>
#endif
#include <unistd.h> #include <unistd.h>
@ -239,15 +232,6 @@ PlasmaApp::PlasmaApp()
len = sizeof(memorySize); len = sizeof(memorySize);
sysctl(mib, 2, &memorySize, &len, NULL, 0); sysctl(mib, 2, &memorySize, &len, NULL, 0);
memorySize /= 1024; 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 #endif
// If you have no suitable sysconf() interface and are not FreeBSD, // If you have no suitable sysconf() interface and are not FreeBSD,
// then you are out of luck and get a compile error. // then you are out of luck and get a compile error.

View file

@ -46,9 +46,6 @@
#include <kworkspace/kworkspace.h> #include <kworkspace/kworkspace.h>
#ifdef Q_OS_WIN
#include <windows.h>
#endif
class EmptyGraphicsItem : public QGraphicsWidget class EmptyGraphicsItem : public QGraphicsWidget
{ {
@ -806,13 +803,9 @@ void DesktopToolBox::lockScreen()
return; return;
} }
#ifndef Q_OS_WIN
const QString interface("org.freedesktop.ScreenSaver"); const QString interface("org.freedesktop.ScreenSaver");
QDBusInterface screensaver(interface, "/ScreenSaver"); QDBusInterface screensaver(interface, "/ScreenSaver");
screensaver.asyncCall("Lock"); screensaver.asyncCall("Lock");
#else
LockWorkStation();
#endif // !Q_OS_WIN
} }
void DesktopToolBox::startLogout() void DesktopToolBox::startLogout()

View file

@ -39,10 +39,6 @@
#include "krunner_interface.h" #include "krunner_interface.h"
#include "screensaver_interface.h" #include "screensaver_interface.h"
#ifdef Q_OS_WIN
#define _WIN32_WINNT 0x0500 // require NT 5.0 (win 2k pro)
#include <windows.h>
#endif // Q_OS_WIN
ContextMenu::ContextMenu(QObject *parent, const QVariantList &args) ContextMenu::ContextMenu(QObject *parent, const QVariantList &args)
: Plasma::ContainmentActions(parent, args), : Plasma::ContainmentActions(parent, args),
@ -208,16 +204,12 @@ void ContextMenu::lockScreen()
return; return;
} }
#ifndef Q_OS_WIN
QString interface("org.freedesktop.ScreenSaver"); QString interface("org.freedesktop.ScreenSaver");
org::freedesktop::ScreenSaver screensaver(interface, "/ScreenSaver", org::freedesktop::ScreenSaver screensaver(interface, "/ScreenSaver",
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
if (screensaver.isValid()) { if (screensaver.isValid()) {
screensaver.Lock(); screensaver.Lock();
} }
#else
LockWorkStation();
#endif // !Q_OS_WIN
} }
void ContextMenu::startLogout() void ContextMenu::startLogout()

View file

@ -364,12 +364,10 @@ int DialogProxy::windowFlags() const
return (int)m_flags; return (int)m_flags;
} }
#ifndef Q_WS_WIN
qulonglong DialogProxy::windowId() const qulonglong DialogProxy::windowId() const
{ {
return m_dialog->winId(); return m_dialog->winId();
} }
#endif
void DialogProxy::setWindowFlags(const int flags) void DialogProxy::setWindowFlags(const int flags)
{ {

View file

@ -146,12 +146,10 @@ class DialogProxy : public QDeclarativeItem
*/ */
Q_PROPERTY(int location READ location WRITE setLocation NOTIFY locationChanged) 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 //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. * Window ID of the dialog window.
**/ **/
Q_PROPERTY(qulonglong windowId READ windowId CONSTANT) Q_PROPERTY(qulonglong windowId READ windowId CONSTANT)
#endif
public: public:
enum WidgetAttribute { enum WidgetAttribute {
@ -193,9 +191,7 @@ public:
QObject *margins() const; QObject *margins() const;
#ifndef Q_WS_WIN
qulonglong windowId() const; qulonglong windowId() const;
#endif
/** /**
* @returns The suggested screen position for the popup * @returns The suggested screen position for the popup