Fix visibility of krandr and krsync libraries

pull/16/head
Timothy Pearson 13 years ago
parent 91f3b7f8f8
commit b477a57673

@ -53,7 +53,7 @@ public:
XRRScreenConfiguration* config; XRRScreenConfiguration* config;
}; };
RandRScreen::RandRScreen(int screenIndex) KDE_EXPORT RandRScreen::RandRScreen(int screenIndex)
: d(new RandRScreenPrivate()) : d(new RandRScreenPrivate())
, m_screen(screenIndex) , m_screen(screenIndex)
, m_shownDialog(NULL) , m_shownDialog(NULL)
@ -62,12 +62,12 @@ RandRScreen::RandRScreen(int screenIndex)
setOriginal(); setOriginal();
} }
RandRScreen::~RandRScreen() KDE_EXPORT RandRScreen::~RandRScreen()
{ {
delete d; delete d;
} }
void RandRScreen::loadSettings() KDE_EXPORT void RandRScreen::loadSettings()
{ {
if (d->config) if (d->config)
XRRFreeScreenConfigInfo(d->config); XRRFreeScreenConfigInfo(d->config);
@ -124,14 +124,14 @@ void RandRScreen::loadSettings()
} }
} }
void RandRScreen::setOriginal() KDE_EXPORT void RandRScreen::setOriginal()
{ {
m_originalSize = m_currentSize; m_originalSize = m_currentSize;
m_originalRotation = m_currentRotation; m_originalRotation = m_currentRotation;
m_originalRefreshRate = m_currentRefreshRate; m_originalRefreshRate = m_currentRefreshRate;
} }
bool RandRScreen::applyProposed() KDE_EXPORT bool RandRScreen::applyProposed()
{ {
//kdDebug() << k_funcinfo << " size " << (SizeID)proposedSize() << ", rotation " << proposedRotation() << ", refresh " << refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) << endl; //kdDebug() << k_funcinfo << " size " << (SizeID)proposedSize() << ", rotation " << proposedRotation() << ", refresh " << refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) << endl;
@ -175,7 +175,7 @@ bool RandRScreen::applyProposed()
return false; return false;
} }
bool RandRScreen::applyProposedAndConfirm() KDE_EXPORT bool RandRScreen::applyProposedAndConfirm()
{ {
if (proposedChanged()) { if (proposedChanged()) {
setOriginal(); setOriginal();
@ -194,7 +194,7 @@ bool RandRScreen::applyProposedAndConfirm()
return true; return true;
} }
bool RandRScreen::confirm() KDE_EXPORT bool RandRScreen::confirm()
{ {
// uncomment the line below and edit out the KTimerDialog stuff to get // uncomment the line below and edit out the KTimerDialog stuff to get
// a version which works on today's tdelibs (no accept dialog is presented) // a version which works on today's tdelibs (no accept dialog is presented)
@ -228,19 +228,19 @@ bool RandRScreen::confirm()
return acceptDialog.exec(); return acceptDialog.exec();
} }
void RandRScreen::shownDialogDestroyed() KDE_EXPORT void RandRScreen::shownDialogDestroyed()
{ {
m_shownDialog = NULL; m_shownDialog = NULL;
disconnect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized())); disconnect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized()));
} }
void RandRScreen::desktopResized() KDE_EXPORT void RandRScreen::desktopResized()
{ {
if( m_shownDialog != NULL ) if( m_shownDialog != NULL )
KDialog::centerOnScreen(m_shownDialog, m_screen); KDialog::centerOnScreen(m_shownDialog, m_screen);
} }
TQString RandRScreen::changedMessage() const KDE_EXPORT TQString RandRScreen::changedMessage() const
{ {
if (currentRefreshRate() == -1) if (currentRefreshRate() == -1)
return i18n("New configuration:\nResolution: %1 x %2\nOrientation: %3") return i18n("New configuration:\nResolution: %1 x %2\nOrientation: %3")
@ -255,24 +255,24 @@ TQString RandRScreen::changedMessage() const
.arg(currentRefreshRateDescription()); .arg(currentRefreshRateDescription());
} }
bool RandRScreen::changedFromOriginal() const KDE_EXPORT bool RandRScreen::changedFromOriginal() const
{ {
return m_currentSize != m_originalSize || m_currentRotation != m_originalRotation || m_currentRefreshRate != m_originalRefreshRate; return m_currentSize != m_originalSize || m_currentRotation != m_originalRotation || m_currentRefreshRate != m_originalRefreshRate;
} }
void RandRScreen::proposeOriginal() KDE_EXPORT void RandRScreen::proposeOriginal()
{ {
m_proposedSize = m_originalSize; m_proposedSize = m_originalSize;
m_proposedRotation = m_originalRotation; m_proposedRotation = m_originalRotation;
m_proposedRefreshRate = m_originalRefreshRate; m_proposedRefreshRate = m_originalRefreshRate;
} }
bool RandRScreen::proposedChanged() const KDE_EXPORT bool RandRScreen::proposedChanged() const
{ {
return m_currentSize != m_proposedSize || m_currentRotation != m_proposedRotation || m_currentRefreshRate != m_proposedRefreshRate; return m_currentSize != m_proposedSize || m_currentRotation != m_proposedRotation || m_currentRefreshRate != m_proposedRefreshRate;
} }
TQString RandRScreen::rotationName(int rotation, bool pastTense, bool capitalised) KDE_EXPORT TQString RandRScreen::rotationName(int rotation, bool pastTense, bool capitalised)
{ {
if (!pastTense) if (!pastTense)
switch (rotation) { switch (rotation) {
@ -326,7 +326,7 @@ TQString RandRScreen::rotationName(int rotation, bool pastTense, bool capitalise
} }
} }
TQPixmap RandRScreen::rotationIcon(int rotation) const KDE_EXPORT TQPixmap RandRScreen::rotationIcon(int rotation) const
{ {
// Adjust icons for current screen orientation // Adjust icons for current screen orientation
if (!(m_currentRotation & RR_Rotate_0) && rotation & (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)) { if (!(m_currentRotation & RR_Rotate_0) && rotation & (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)) {
@ -365,20 +365,23 @@ TQPixmap RandRScreen::rotationIcon(int rotation) const
} }
} }
TQString RandRScreen::currentRotationDescription() const KDE_EXPORT TQString RandRScreen::currentRotationDescription() const
{ {
TQString ret = rotationName(m_currentRotation & RotateMask); TQString ret = rotationName(m_currentRotation & RotateMask);
if (m_currentRotation != m_currentRotation & RotateMask) if (m_currentRotation != (m_currentRotation & RotateMask)) {
if (m_currentRotation & RR_Rotate_0) if (m_currentRotation & RR_Rotate_0) {
ret = rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, true); ret = rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, true);
else }
else {
ret += ", " + rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, false); ret += ", " + rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, false);
}
}
return ret; return ret;
} }
int RandRScreen::rotationIndexToDegree(int rotation) const KDE_EXPORT int RandRScreen::rotationIndexToDegree(int rotation) const
{ {
switch (rotation & RotateMask) { switch (rotation & RotateMask) {
case RR_Rotate_90: case RR_Rotate_90:
@ -395,7 +398,7 @@ int RandRScreen::rotationIndexToDegree(int rotation) const
} }
} }
int RandRScreen::rotationDegreeToIndex(int degree) const KDE_EXPORT int RandRScreen::rotationDegreeToIndex(int degree) const
{ {
switch (degree) { switch (degree) {
case 90: case 90:
@ -412,27 +415,27 @@ int RandRScreen::rotationDegreeToIndex(int degree) const
} }
} }
int RandRScreen::currentPixelWidth() const KDE_EXPORT int RandRScreen::currentPixelWidth() const
{ {
return m_pixelSizes[m_currentSize].width(); return m_pixelSizes[m_currentSize].width();
} }
int RandRScreen::currentPixelHeight() const KDE_EXPORT int RandRScreen::currentPixelHeight() const
{ {
return m_pixelSizes[m_currentSize].height(); return m_pixelSizes[m_currentSize].height();
} }
int RandRScreen::currentMMWidth() const KDE_EXPORT int RandRScreen::currentMMWidth() const
{ {
return m_pixelSizes[m_currentSize].width(); return m_pixelSizes[m_currentSize].width();
} }
int RandRScreen::currentMMHeight() const KDE_EXPORT int RandRScreen::currentMMHeight() const
{ {
return m_pixelSizes[m_currentSize].height(); return m_pixelSizes[m_currentSize].height();
} }
TQStringList RandRScreen::refreshRates(int size) const KDE_EXPORT TQStringList RandRScreen::refreshRates(int size) const
{ {
int nrates; int nrates;
TQStringList ret; TQStringList ret;
@ -459,22 +462,22 @@ TQStringList RandRScreen::refreshRates(int size) const
return ret; return ret;
} }
TQString RandRScreen::refreshRateDirectDescription(int rate) const KDE_EXPORT TQString RandRScreen::refreshRateDirectDescription(int rate) const
{ {
return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(rate); return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(rate);
} }
TQString RandRScreen::refreshRateIndirectDescription(int size, int index) const KDE_EXPORT TQString RandRScreen::refreshRateIndirectDescription(int size, int index) const
{ {
return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(refreshRateIndexToHz(size, index)); return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(refreshRateIndexToHz(size, index));
} }
TQString RandRScreen::refreshRateDescription(int size, int index) const KDE_EXPORT TQString RandRScreen::refreshRateDescription(int size, int index) const
{ {
return refreshRates(size)[index]; return refreshRates(size)[index];
} }
bool RandRScreen::proposeRefreshRate(int index) KDE_EXPORT bool RandRScreen::proposeRefreshRate(int index)
{ {
if (index >= 0 && (int)refreshRates(proposedSize()).count() > index) { if (index >= 0 && (int)refreshRates(proposedSize()).count() > index) {
m_proposedRefreshRate = index; m_proposedRefreshRate = index;
@ -484,22 +487,22 @@ bool RandRScreen::proposeRefreshRate(int index)
return false; return false;
} }
int RandRScreen::currentRefreshRate() const KDE_EXPORT int RandRScreen::currentRefreshRate() const
{ {
return m_currentRefreshRate; return m_currentRefreshRate;
} }
TQString RandRScreen::currentRefreshRateDescription() const KDE_EXPORT TQString RandRScreen::currentRefreshRateDescription() const
{ {
return refreshRateIndirectDescription(m_currentSize, m_currentRefreshRate); return refreshRateIndirectDescription(m_currentSize, m_currentRefreshRate);
} }
int RandRScreen::proposedRefreshRate() const KDE_EXPORT int RandRScreen::proposedRefreshRate() const
{ {
return m_proposedRefreshRate; return m_proposedRefreshRate;
} }
int RandRScreen::refreshRateHzToIndex(int size, int hz) const KDE_EXPORT int RandRScreen::refreshRateHzToIndex(int size, int hz) const
{ {
int nrates; int nrates;
short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates); short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates);
@ -515,7 +518,7 @@ int RandRScreen::refreshRateHzToIndex(int size, int hz) const
return -1; return -1;
} }
int RandRScreen::refreshRateIndexToHz(int size, int index) const KDE_EXPORT int RandRScreen::refreshRateIndexToHz(int size, int index) const
{ {
int nrates; int nrates;
short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates); short* rates = XRRRates(qt_xdisplay(), m_screen, (SizeID)size, &nrates);
@ -530,22 +533,22 @@ int RandRScreen::refreshRateIndexToHz(int size, int index) const
return rates[index]; return rates[index];
} }
int RandRScreen::numSizes() const KDE_EXPORT int RandRScreen::numSizes() const
{ {
return m_pixelSizes.count(); return m_pixelSizes.count();
} }
const TQSize& RandRScreen::pixelSize(int index) const KDE_EXPORT const TQSize& RandRScreen::pixelSize(int index) const
{ {
return m_pixelSizes[index]; return m_pixelSizes[index];
} }
const TQSize& RandRScreen::mmSize(int index) const KDE_EXPORT const TQSize& RandRScreen::mmSize(int index) const
{ {
return m_mmSizes[index]; return m_mmSizes[index];
} }
int RandRScreen::sizeIndex(TQSize pixelSize) const KDE_EXPORT int RandRScreen::sizeIndex(TQSize pixelSize) const
{ {
for (uint i = 0; i < m_pixelSizes.count(); i++) for (uint i = 0; i < m_pixelSizes.count(); i++)
if (m_pixelSizes[i] == pixelSize) if (m_pixelSizes[i] == pixelSize)
@ -554,37 +557,37 @@ int RandRScreen::sizeIndex(TQSize pixelSize) const
return -1; return -1;
} }
int RandRScreen::rotations() const KDE_EXPORT int RandRScreen::rotations() const
{ {
return m_rotations; return m_rotations;
} }
int RandRScreen::currentRotation() const KDE_EXPORT int RandRScreen::currentRotation() const
{ {
return m_currentRotation; return m_currentRotation;
} }
int RandRScreen::currentSize() const KDE_EXPORT int RandRScreen::currentSize() const
{ {
return m_currentSize; return m_currentSize;
} }
int RandRScreen::proposedRotation() const KDE_EXPORT int RandRScreen::proposedRotation() const
{ {
return m_proposedRotation; return m_proposedRotation;
} }
void RandRScreen::proposeRotation(int newRotation) KDE_EXPORT void RandRScreen::proposeRotation(int newRotation)
{ {
m_proposedRotation = newRotation & OrientationMask; m_proposedRotation = newRotation & OrientationMask;
} }
int RandRScreen::proposedSize() const KDE_EXPORT int RandRScreen::proposedSize() const
{ {
return m_proposedSize; return m_proposedSize;
} }
bool RandRScreen::proposeSize(int newSize) KDE_EXPORT bool RandRScreen::proposeSize(int newSize)
{ {
if ((int)m_pixelSizes.count() > newSize) { if ((int)m_pixelSizes.count() > newSize) {
m_proposedSize = newSize; m_proposedSize = newSize;
@ -594,7 +597,7 @@ bool RandRScreen::proposeSize(int newSize)
return false; return false;
} }
void RandRScreen::load(KConfig& config) KDE_EXPORT void RandRScreen::load(KConfig& config)
{ {
config.setGroup(TQString("Screen%1").arg(m_screen)); config.setGroup(TQString("Screen%1").arg(m_screen));
@ -604,7 +607,7 @@ void RandRScreen::load(KConfig& config)
proposeRotation(rotationDegreeToIndex(config.readNumEntry("rotation", 0)) + (config.readBoolEntry("reflectX") ? ReflectX : 0) + (config.readBoolEntry("reflectY") ? ReflectY : 0)); proposeRotation(rotationDegreeToIndex(config.readNumEntry("rotation", 0)) + (config.readBoolEntry("reflectX") ? ReflectX : 0) + (config.readBoolEntry("reflectY") ? ReflectY : 0));
} }
void RandRScreen::save(KConfig& config) const KDE_EXPORT void RandRScreen::save(KConfig& config) const
{ {
config.setGroup(TQString("Screen%1").arg(m_screen)); config.setGroup(TQString("Screen%1").arg(m_screen));
config.writeEntry("width", currentPixelWidth()); config.writeEntry("width", currentPixelWidth());
@ -615,7 +618,7 @@ void RandRScreen::save(KConfig& config) const
config.writeEntry("reflectY", (bool)(currentRotation() & ReflectMask) == ReflectY); config.writeEntry("reflectY", (bool)(currentRotation() & ReflectMask) == ReflectY);
} }
RandRDisplay::RandRDisplay() KDE_EXPORT RandRDisplay::RandRDisplay()
: m_valid(true) : m_valid(true)
{ {
// Check extension // Check extension
@ -658,76 +661,76 @@ RandRDisplay::RandRDisplay()
setCurrentScreen(TQApplication::desktop()->primaryScreen()); setCurrentScreen(TQApplication::desktop()->primaryScreen());
} }
bool RandRDisplay::isValid() const KDE_EXPORT bool RandRDisplay::isValid() const
{ {
return m_valid; return m_valid;
} }
const TQString& RandRDisplay::errorCode() const KDE_EXPORT const TQString& RandRDisplay::errorCode() const
{ {
return m_errorCode; return m_errorCode;
} }
int RandRDisplay::eventBase() const KDE_EXPORT int RandRDisplay::eventBase() const
{ {
return m_eventBase; return m_eventBase;
} }
int RandRDisplay::screenChangeNotifyEvent() const KDE_EXPORT int RandRDisplay::screenChangeNotifyEvent() const
{ {
return m_eventBase + RRScreenChangeNotify; return m_eventBase + RRScreenChangeNotify;
} }
int RandRDisplay::errorBase() const KDE_EXPORT int RandRDisplay::errorBase() const
{ {
return m_errorBase; return m_errorBase;
} }
const TQString& RandRDisplay::version() const KDE_EXPORT const TQString& RandRDisplay::version() const
{ {
return m_version; return m_version;
} }
void RandRDisplay::setCurrentScreen(int index) KDE_EXPORT void RandRDisplay::setCurrentScreen(int index)
{ {
m_currentScreenIndex = index; m_currentScreenIndex = index;
m_currentScreen = m_screens.at(m_currentScreenIndex); m_currentScreen = m_screens.at(m_currentScreenIndex);
Q_ASSERT(m_currentScreen); Q_ASSERT(m_currentScreen);
} }
int RandRDisplay::screenIndexOfWidget(TQWidget* widget) KDE_EXPORT int RandRDisplay::screenIndexOfWidget(TQWidget* widget)
{ {
int ret = TQApplication::desktop()->screenNumber(widget); int ret = TQApplication::desktop()->screenNumber(widget);
return ret != -1 ? ret : TQApplication::desktop()->primaryScreen(); return ret != -1 ? ret : TQApplication::desktop()->primaryScreen();
} }
int RandRDisplay::currentScreenIndex() const KDE_EXPORT int RandRDisplay::currentScreenIndex() const
{ {
return m_currentScreenIndex; return m_currentScreenIndex;
} }
void RandRDisplay::refresh() KDE_EXPORT void RandRDisplay::refresh()
{ {
for (RandRScreen* s = m_screens.first(); s; s = m_screens.next()) for (RandRScreen* s = m_screens.first(); s; s = m_screens.next())
s->loadSettings(); s->loadSettings();
} }
int RandRDisplay::numScreens() const KDE_EXPORT int RandRDisplay::numScreens() const
{ {
return m_numScreens; return m_numScreens;
} }
RandRScreen* RandRDisplay::screen(int index) KDE_EXPORT RandRScreen* RandRDisplay::screen(int index)
{ {
return m_screens.at(index); return m_screens.at(index);
} }
RandRScreen* RandRDisplay::currentScreen() KDE_EXPORT RandRScreen* RandRDisplay::currentScreen()
{ {
return m_currentScreen; return m_currentScreen;
} }
bool RandRDisplay::loadDisplay(KConfig& config, bool loadScreens) KDE_EXPORT bool RandRDisplay::loadDisplay(KConfig& config, bool loadScreens)
{ {
if (loadScreens) if (loadScreens)
for (RandRScreen* s = m_screens.first(); s; s = m_screens.next()) for (RandRScreen* s = m_screens.first(); s; s = m_screens.next())
@ -736,19 +739,19 @@ bool RandRDisplay::loadDisplay(KConfig& config, bool loadScreens)
return applyOnStartup(config); return applyOnStartup(config);
} }
bool RandRDisplay::applyOnStartup(KConfig& config) KDE_EXPORT bool RandRDisplay::applyOnStartup(KConfig& config)
{ {
config.setGroup("Display"); config.setGroup("Display");
return config.readBoolEntry("ApplyOnStartup", false); return config.readBoolEntry("ApplyOnStartup", false);
} }
bool RandRDisplay::syncTrayApp(KConfig& config) KDE_EXPORT bool RandRDisplay::syncTrayApp(KConfig& config)
{ {
config.setGroup("Display"); config.setGroup("Display");
return config.readBoolEntry("SyncTrayApp", false); return config.readBoolEntry("SyncTrayApp", false);
} }
void RandRDisplay::saveDisplay(KConfig& config, bool applyOnStartup, bool syncTrayApp) KDE_EXPORT void RandRDisplay::saveDisplay(KConfig& config, bool applyOnStartup, bool syncTrayApp)
{ {
Q_ASSERT(!config.isReadOnly()); Q_ASSERT(!config.isReadOnly());
@ -760,7 +763,7 @@ void RandRDisplay::saveDisplay(KConfig& config, bool applyOnStartup, bool syncTr
s->save(config); s->save(config);
} }
void RandRDisplay::applyProposed(bool confirm) KDE_EXPORT void RandRDisplay::applyProposed(bool confirm)
{ {
for (int screenIndex = 0; screenIndex < numScreens(); screenIndex++) { for (int screenIndex = 0; screenIndex < numScreens(); screenIndex++) {
if (screen(screenIndex)->proposedChanged()) { if (screen(screenIndex)->proposedChanged()) {
@ -772,12 +775,12 @@ void RandRDisplay::applyProposed(bool confirm)
} }
} }
bool RandRDisplay::showTestConfigurationDialog() KDE_EXPORT bool RandRDisplay::showTestConfigurationDialog()
{ {
return screen(0)->showTestConfigurationDialog(); return screen(0)->showTestConfigurationDialog();
} }
bool RandRScreen::showTestConfigurationDialog() KDE_EXPORT bool RandRScreen::showTestConfigurationDialog()
{ {
// uncomment the line below and edit out the KTimerDialog stuff to get // uncomment the line below and edit out the KTimerDialog stuff to get
// a version which works on today's tdelibs (no accept dialog is presented) // a version which works on today's tdelibs (no accept dialog is presented)
@ -811,7 +814,7 @@ bool RandRScreen::showTestConfigurationDialog()
return acceptDialog.exec(); return acceptDialog.exec();
} }
int RandRScreen::pixelCount( int index ) const KDE_EXPORT int RandRScreen::pixelCount( int index ) const
{ {
TQSize sz = pixelSize(index); TQSize sz = pixelSize(index);
return sz.width() * sz.height(); return sz.width() * sz.height();

@ -60,8 +60,8 @@
#define CONFIGURATION_FILE_SEPARATOR ';' #define CONFIGURATION_FILE_SEPARATOR ';'
KRsync::KRsync (TQObject* parent, const char* name) KDE_EXPORT KRsync::KRsync (TQObject* parent, const char* name)
: TQObject (parent, name), m_bSettingsLoaded(false), m_progressDialog(false), m_progressDialogExists(false), m_bInSpecialSync(false) : TQObject (parent, name), m_progressDialog(false), m_progressDialogExists(false), m_bSettingsLoaded(false), m_bInSpecialSync(false)
{ {
loadSettings(); loadSettings();
@ -77,14 +77,11 @@ KRsync::KRsync (TQObject* parent, const char* name)
redirectPass = ""; // FIXME: just a workaround for konq deficiencies redirectPass = ""; // FIXME: just a workaround for konq deficiencies
} }
KRsync::~KRsync() KDE_EXPORT KRsync::~KRsync()
{ {
} }
static char *rsyncPath = NULL;
static char *suPath = NULL;
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)
@ -153,7 +150,7 @@ close_master:
/** /**
creates the unidirectional sync subprocess creates the unidirectional sync subprocess
*/ */
bool KRsync::syncUnidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) { KDE_EXPORT bool KRsync::syncUnidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) {
int fd[2]; int fd[2];
int rc, flags; int rc, flags;
thisFn = TQString(); thisFn = TQString();
@ -216,7 +213,9 @@ bool KRsync::syncUnidirectional(TQString synccommand, TQString syncflags, int pa
if (dev) close(open(dev, O_WRONLY, 0)); if (dev) close(open(dev, O_WRONLY, 0));
setpgid(0,0); setpgid(0,0);
system(execstring.ascii()); if (system(execstring.ascii()) < 0) {
// ERROR
}
#undef common_args #undef common_args
myDebug( << "could not exec! " << strerror(errno) << endl); myDebug( << "could not exec! " << strerror(errno) << endl);
::exit(-1); ::exit(-1);
@ -290,7 +289,7 @@ bool KRsync::syncUnidirectional(TQString synccommand, TQString syncflags, int pa
/** /**
creates the bidirectional sync subprocess creates the bidirectional sync subprocess
*/ */
bool KRsync::syncBidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) { KDE_EXPORT bool KRsync::syncBidirectional(TQString synccommand, TQString syncflags, int parameter_order, TQString localfolder, TQString remotepath) {
int fd[2]; int fd[2];
int rc, flags; int rc, flags;
thisFn = TQString(); thisFn = TQString();
@ -353,7 +352,9 @@ bool KRsync::syncBidirectional(TQString synccommand, TQString syncflags, int par
if (dev) close(open(dev, O_WRONLY, 0)); if (dev) close(open(dev, O_WRONLY, 0));
setpgid(0,0); setpgid(0,0);
system(execstring.ascii()); if (system(execstring.ascii()) < 0) {
// ERROR
}
#undef common_args #undef common_args
myDebug( << "could not exec! " << strerror(errno) << endl); myDebug( << "could not exec! " << strerror(errno) << endl);
::exit(-1); ::exit(-1);
@ -427,7 +428,7 @@ bool KRsync::syncBidirectional(TQString synccommand, TQString syncflags, int par
/** /**
writes one chunk of data to stdin of child process writes one chunk of data to stdin of child process
*/ */
void KRsync::writeChild(const char *buf, KIO::fileoffset_t len) { KDE_EXPORT void KRsync::writeChild(const char *buf, KIO::fileoffset_t len) {
if (outBufPos >= 0 && outBuf) { if (outBufPos >= 0 && outBuf) {
#if 0 #if 0
TQString debug; TQString debug;
@ -444,7 +445,7 @@ void KRsync::writeChild(const char *buf, KIO::fileoffset_t len) {
/** /**
manages initial communication setup including password queries manages initial communication setup including password queries
*/ */
int KRsync::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) { KDE_EXPORT int KRsync::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
TQString buf; TQString buf;
buf.setLatin1(buffer,len); buf.setLatin1(buffer,len);
int pos; int pos;
@ -559,7 +560,7 @@ int KRsync::establishConnectionRsync(char *buffer, KIO::fileoffset_t len) {
/** /**
manages initial communication setup including password queries manages initial communication setup including password queries
*/ */
int KRsync::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, TQString localfolder, TQString remotepath) { KDE_EXPORT int KRsync::establishConnectionUnison(char *buffer, KIO::fileoffset_t len, TQString localfolder, TQString remotepath) {
TQString buf; TQString buf;
buf.setLatin1(buffer,len); buf.setLatin1(buffer,len);
int pos; int pos;
@ -743,7 +744,7 @@ Forced close of the connection
This function gets called from the application side of the universe, This function gets called from the application side of the universe,
it shouldn't send any response. it shouldn't send any response.
*/ */
void KRsync::closeConnection(){ KDE_EXPORT void KRsync::closeConnection(){
myDebug( << "closeConnection()" << endl); myDebug( << "closeConnection()" << endl);
shutdownConnection(true, false); shutdownConnection(true, false);
} }
@ -751,7 +752,7 @@ void KRsync::closeConnection(){
/** /**
Closes the connection Closes the connection
*/ */
void KRsync::shutdownConnection(bool forced, bool wait){ KDE_EXPORT void KRsync::shutdownConnection(bool forced, bool wait){
if (childPid) { if (childPid) {
kill(childPid,SIGTERM); // We may not have permission... kill(childPid,SIGTERM); // We may not have permission...
childPid = 0; childPid = 0;
@ -772,7 +773,7 @@ void KRsync::shutdownConnection(bool forced, bool wait){
// //
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void KRsync::saveSettings() KDE_EXPORT void KRsync::saveSettings()
{ {
KConfig cfg ("rsyncrc", false, false); KConfig cfg ("rsyncrc", false, false);
cfg.setGroup ("General"); cfg.setGroup ("General");
@ -781,7 +782,7 @@ void KRsync::saveSettings()
cfg.sync(); cfg.sync();
} }
void KRsync::loadSettings() KDE_EXPORT void KRsync::loadSettings()
{ {
if (m_bSettingsLoaded) if (m_bSettingsLoaded)
return; return;
@ -795,7 +796,7 @@ void KRsync::loadSettings()
m_bSettingsLoaded = true; m_bSettingsLoaded = true;
} }
void KRsync::executeLogoutAutoSync() KDE_EXPORT void KRsync::executeLogoutAutoSync()
{ {
for (TQStringList::Iterator i(cfgautosync_onlogout_list.begin()); i != cfgautosync_onlogout_list.end(); ++i) { for (TQStringList::Iterator i(cfgautosync_onlogout_list.begin()); i != cfgautosync_onlogout_list.end(); ++i) {
setCurrentDirectoryURL(*i); setCurrentDirectoryURL(*i);
@ -805,7 +806,7 @@ void KRsync::executeLogoutAutoSync()
} }
} }
TQString KRsync::findLocalFolderByName(TQString folderurl) KDE_EXPORT TQString KRsync::findLocalFolderByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -824,7 +825,7 @@ TQString KRsync::findLocalFolderByName(TQString folderurl)
return NULL; return NULL;
} }
TQString KRsync::findSyncMethodByName(TQString folderurl) KDE_EXPORT TQString KRsync::findSyncMethodByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -843,7 +844,7 @@ TQString KRsync::findSyncMethodByName(TQString folderurl)
return NULL; return NULL;
} }
TQString KRsync::findLoginSyncEnabledByName(TQString folderurl) KDE_EXPORT TQString KRsync::findLoginSyncEnabledByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -862,7 +863,7 @@ TQString KRsync::findLoginSyncEnabledByName(TQString folderurl)
return NULL; return NULL;
} }
TQString KRsync::findLogoutSyncEnabledByName(TQString folderurl) KDE_EXPORT TQString KRsync::findLogoutSyncEnabledByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -881,7 +882,7 @@ TQString KRsync::findLogoutSyncEnabledByName(TQString folderurl)
return NULL; return NULL;
} }
TQString KRsync::findTimedSyncEnabledByName(TQString folderurl) KDE_EXPORT TQString KRsync::findTimedSyncEnabledByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -900,7 +901,7 @@ TQString KRsync::findTimedSyncEnabledByName(TQString folderurl)
return NULL; return NULL;
} }
int KRsync::deleteLocalFolderByName(TQString folderurl) KDE_EXPORT int KRsync::deleteLocalFolderByName(TQString folderurl)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -920,7 +921,7 @@ int KRsync::deleteLocalFolderByName(TQString folderurl)
return 1; return 1;
} }
int KRsync::addLocalFolderByName(TQString folderurl, TQString remoteurl, TQString syncmethod, TQString excludelist, TQString sync_on_login, TQString sync_on_logout, TQString sync_timed_interval) KDE_EXPORT int KRsync::addLocalFolderByName(TQString folderurl, TQString remoteurl, TQString syncmethod, TQString excludelist, TQString sync_on_login, TQString sync_on_logout, TQString sync_timed_interval)
{ {
TQString folderurl_stripped; TQString folderurl_stripped;
folderurl_stripped = folderurl; folderurl_stripped = folderurl;
@ -935,12 +936,12 @@ int KRsync::addLocalFolderByName(TQString folderurl, TQString remoteurl, TQStrin
return 1; return 1;
} }
void KRsync::setCurrentDirectoryURL (KURL url) KDE_EXPORT void KRsync::setCurrentDirectoryURL (KURL url)
{ {
m_pURL = url; m_pURL = url;
} }
void KRsync::slotSetup() KDE_EXPORT void KRsync::slotSetup()
{ {
KURL url = m_pURL; KURL url = m_pURL;
@ -948,7 +949,7 @@ void KRsync::slotSetup()
TQString localfolder = url.directory(true, true) + TQString("/") + url.fileName(true); TQString localfolder = url.directory(true, true) + TQString("/") + url.fileName(true);
TQString remotefolder = findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true)); TQString remotefolder = findLocalFolderByName(url.directory(true, true) + TQString("/") + url.fileName(true));
TQString syncmethod = findSyncMethodByName(url.directory(true, true) + TQString("/") + url.fileName(true)); TQString syncmethod = findSyncMethodByName(url.directory(true, true) + TQString("/") + url.fileName(true));
int syncint; int syncint = 1;
if (syncmethod == NULL) { if (syncmethod == NULL) {
syncint = 1; syncint = 1;
} }
@ -978,7 +979,7 @@ void KRsync::slotSetup()
connect (m_configDialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(slotSetupCancelled())); connect (m_configDialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(slotSetupCancelled()));
} }
void KRsync::slotSetupOK() KDE_EXPORT void KRsync::slotSetupOK()
{ {
KURL url = m_pURL; KURL url = m_pURL;
@ -1016,12 +1017,12 @@ void KRsync::slotSetupOK()
emit setupDone(); emit setupDone();
} }
void KRsync::slotSetupCancelled() KDE_EXPORT void KRsync::slotSetupCancelled()
{ {
emit setupDone(); emit setupDone();
} }
void KRsync::slotRsyncCancelled() KDE_EXPORT void KRsync::slotRsyncCancelled()
{ {
shutdownConnection(true, true); shutdownConnection(true, true);
if (m_progressDialogExists == true) { if (m_progressDialogExists == true) {
@ -1031,7 +1032,7 @@ void KRsync::slotRsyncCancelled()
emit transferDone(); emit transferDone();
} }
void KRsync::slotUnisonCancelled() KDE_EXPORT void KRsync::slotUnisonCancelled()
{ {
shutdownConnection(true, true); shutdownConnection(true, true);
if (m_progressDialogExists == true) { if (m_progressDialogExists == true) {
@ -1043,7 +1044,7 @@ void KRsync::slotUnisonCancelled()
emit transferDone(); emit transferDone();
} }
void KRsync::slotSync() KDE_EXPORT void KRsync::slotSync()
{ {
KURL url = m_pURL; KURL url = m_pURL;

@ -138,6 +138,7 @@ signals:
private: private:
KURL m_pURL; KURL m_pURL;
KProgressBoxDialog* m_progressDialog; KProgressBoxDialog* m_progressDialog;
RsyncConfigDialog* m_configDialog; RsyncConfigDialog* m_configDialog;

Loading…
Cancel
Save