mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
removed win and mac code
This commit is contained in:
parent
a3331afd2c
commit
0a82433c59
58 changed files with 6 additions and 613 deletions
|
@ -48,4 +48,4 @@ private:
|
|||
Plasma::Svg *m_svg;
|
||||
QPixmap m_buffer;
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -168,11 +168,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
|
|||
{
|
||||
QList<Debugger> 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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include <QApplication>
|
||||
#elif defined(Q_WS_MACX)
|
||||
#include "kglobalaccel_mac.h"
|
||||
#elif defined(Q_WS_WIN)
|
||||
#include "kglobalaccel_win.h"
|
||||
#else
|
||||
#include "kglobalaccel_qws.h"
|
||||
#endif
|
||||
|
|
|
@ -22,137 +22,3 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -27,13 +27,11 @@
|
|||
|
||||
#include <KDebug>
|
||||
|
||||
#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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -37,11 +37,7 @@
|
|||
#include <QImage>
|
||||
#include <QtCore/QScopedPointer>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <QtCore/QProcess>
|
||||
#else
|
||||
#include <kptyprocess.h>
|
||||
#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<QProcess> m_process;
|
||||
#else
|
||||
QScopedPointer<KPtyProcess> m_process;
|
||||
#endif
|
||||
QByteArray m_stdOut;
|
||||
QByteArray m_stdErr;
|
||||
QEventLoop* m_loop;
|
||||
|
|
|
@ -26,10 +26,8 @@
|
|||
#include <machine/param.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifndef Q_WS_WIN
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#endif
|
||||
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QFile>
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
#include <KUrlRequester>
|
||||
#include <KShell>
|
||||
|
||||
#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 );
|
||||
}
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
#include <KAboutData>
|
||||
|
||||
#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();
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
#include <KConfigGroup>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef KSYSTEMACTIVITYDIALOG__H
|
||||
#define KSYSTEMACTIVITYDIALOG__H
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
|
||||
#include <KDialog>
|
||||
|
||||
|
@ -58,6 +57,5 @@ class KSystemActivityDialog : public KDialog
|
|||
|
||||
KSysGuardProcessList m_processList;
|
||||
};
|
||||
#endif // not Q_WS_WIN
|
||||
|
||||
#endif // KSYSTEMACTIVITYDIALOG__H
|
||||
|
|
|
@ -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<QChar, QString> 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());
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#include <windows.h>
|
||||
#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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -93,13 +93,8 @@ public:
|
|||
private:
|
||||
static void warningDivByZero();
|
||||
|
||||
#if defined(Q_WS_MAC)
|
||||
QCOORD yp;
|
||||
QCOORD xp;
|
||||
#else
|
||||
QCOORD xp;
|
||||
QCOORD yp;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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 & );
|
||||
|
|
|
@ -49,10 +49,6 @@
|
|||
#include <QtGui/QStyleOptionSlider>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
/* need windows.h include for Sleep function*/
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <ctime>
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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<QAbstractItemView*>( 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<QScrollBar*>( widget ) ) {
|
||||
|
||||
|
@ -431,19 +423,11 @@ namespace Oxygen
|
|||
} else if( qobject_cast<QMenu*>( 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<QFrame*>( 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;
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
#include <kconfiggroup.h>
|
||||
#include <kstandarddirs.h>
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
KWalletExecuter::KWalletExecuter(QObject* parent): QObject(parent)
|
||||
{
|
||||
|
|
|
@ -40,10 +40,6 @@
|
|||
#include "sha1.h"
|
||||
#include "cbc.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#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<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
|
||||
if (QFile::exists("/dev/urandom")) {
|
||||
|
@ -136,7 +112,6 @@ static int getRandomBlock(QByteArray& randBlock) {
|
|||
// Couldn't get any random data!!
|
||||
return -1;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,10 +45,6 @@
|
|||
#include <assert.h>
|
||||
|
||||
// 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_MINOR 1
|
||||
|
|
|
@ -43,4 +43,4 @@ public slots:
|
|||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -50,11 +50,7 @@ namespace KSysGuard
|
|||
*
|
||||
* @author John Tapsell <tapsell@kde.org>
|
||||
*/
|
||||
#ifdef Q_WS_WIN
|
||||
class Processes : public QObject
|
||||
#else
|
||||
class KDE_EXPORT Processes : public QObject
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -44,9 +44,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <QX11Info>
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <KActivities/Consumer>
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
#include <fixx11h.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#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);
|
||||
|
|
|
@ -20,13 +20,6 @@
|
|||
|
||||
#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>
|
||||
|
||||
|
@ -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.
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
|
||||
#include <kworkspace/kworkspace.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#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()
|
||||
|
|
|
@ -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 <windows.h>
|
||||
#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()
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -29,4 +29,4 @@ class ColumnProxyModelTest : public QObject
|
|||
void testInit();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -23,4 +23,4 @@
|
|||
|
||||
#define kdbg_code 1207
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue