Disable session management in tdeio slaves

This relates to Bug 760
pull/2/head
Timothy Pearson 11 years ago
parent 960cc8392d
commit 4bd0fd248f

@ -44,7 +44,7 @@ extern "C" {
putenv(strdup("SESSION_MANAGER="));
TDECmdLineArgs::init(argc, argv, "tdeio_home", 0, 0, 0, 0);
TDECmdLineArgs::addCmdLineOptions( options );
TDEApplication app( false, false );
TDEApplication app( false, false, false );
// We want to be anonymous even if we use DCOP
app.dcopClient()->attach();

@ -91,6 +91,7 @@ TDEBackend::~TDEBackend()
}
void TDEBackend::AddDeviceHandler(TDEGenericDevice *device) {
printf("[RAJA DEBUG 100.0] In TDEBackend::AddDeviceHandler for '%s'\n\r", device->uniqueID().ascii()); fflush(stdout);
if (device->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(device);
AddDevice(sdevice);
@ -98,6 +99,7 @@ void TDEBackend::AddDeviceHandler(TDEGenericDevice *device) {
}
void TDEBackend::RemoveDeviceHandler(TDEGenericDevice *device) {
printf("[RAJA DEBUG 100.0] In TDEBackend::RemoveDeviceHandler for '%s'\n\r", device->uniqueID().ascii()); fflush(stdout);
if (device->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(device);
RemoveDevice(sdevice);
@ -105,6 +107,7 @@ void TDEBackend::RemoveDeviceHandler(TDEGenericDevice *device) {
}
void TDEBackend::ModifyDeviceHandler(TDEGenericDevice *device) {
printf("[RAJA DEBUG 100.0] In TDEBackend::ModifyDeviceHandler for '%s'\n\r", device->uniqueID().ascii()); fflush(stdout);
if (device->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(device);
ModifyDevice(sdevice);
@ -1198,10 +1201,12 @@ TQString TDEBackend::unmount(const TQString &_udi)
// There is a possibility that the storage device was unceremoniously removed from the system immediately after it was unmounted
// There is no reliable way to know if this happened either!
// For now, see if the device node still exists
TQFileInfo checkDN(node);
if (!checkDN.exists()) {
m_mediaList.removeMedium(uid, true);
}
// RAJA FIXME
// Is this causing/masking the Eject/Unmount race condition?
// TQFileInfo checkDN(node);
// if (!checkDN.exists()) {
// m_mediaList.removeMedium(uid, true);
// }
return TQString();
}

@ -46,7 +46,7 @@ extern "C" {
putenv(strdup("SESSION_MANAGER="));
TDECmdLineArgs::init(argc, argv, "tdeio_media", 0, 0, 0, 0);
TDECmdLineArgs::addCmdLineOptions( options );
TDEApplication app( false, false );
TDEApplication app( false, false, false );
// We want to be anonymous even if we use DCOP
app.dcopClient()->attach();

@ -44,7 +44,7 @@ extern "C" {
putenv(strdup("SESSION_MANAGER="));
TDECmdLineArgs::init(argc, argv, "tdeio_remote", 0, 0, 0, 0);
TDECmdLineArgs::addCmdLineOptions( options );
TDEApplication app( false, false );
TDEApplication app( false, false, false );
// We want to be anonymous even if we use DCOP
app.dcopClient()->attach();

@ -45,7 +45,7 @@ extern "C" {
putenv(strdup("SESSION_MANAGER="));
TDECmdLineArgs::init(argc, argv, "tdeio_system", 0, 0, 0, 0);
TDECmdLineArgs::addCmdLineOptions( options );
TDEApplication app( false, false );
TDEApplication app( false, false, false );
// We want to be anonymous even if we use DCOP
app.dcopClient()->attach();

@ -98,16 +98,17 @@ int kdemain(int argc, char **argv)
#ifdef USE_KINSTANCE
TDEInstance instance("tdeio_thumbnail");
#else
// creating TDEApplication in a slave in not a very good idea,
// creating TDEApplication in a slave is not a very good idea,
// as dispatchLoop() doesn't allow it to process its messages,
// so it for example wouldn't reply to ksmserver - on the other
// hand, this slave uses QPixmaps for some reason, and they
// need QApplication
// and HTML previews need even TDEApplication :(
putenv(strdup("SESSION_MANAGER="));
// session management is therefore forcibly disabled on creation
// to prevent session management hangs and stalls
TDEApplication::disableAutoDcopRegistration();
TDEApplication app(argc, argv, "tdeio_thumbnail", false, true);
TDEApplication app(argc, argv, "tdeio_thumbnail", false, true, false);
#endif
if (argc != 4)

@ -54,11 +54,10 @@ extern "C" {
{
//TDEInstance instance( "tdeio_trash" );
// TDEApplication is necessary to use tdeio_file
putenv(strdup("SESSION_MANAGER="));
TDEApplication::disableAutoDcopRegistration();
TDECmdLineArgs::init(argc, argv, "tdeio_trash", 0, 0, 0, 0);
TDECmdLineArgs::addCmdLineOptions( options );
TDEApplication app( false, false );
TDEApplication app( false, false, false );
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
TrashProtocol slave( args->arg(0), args->arg(1), args->arg(2) );

Loading…
Cancel
Save