File oooqs-1.0_rc3-SuSE_wrapper.patch of Package OpenOffice_org-Quickstarter
--- oooqs/oooqs.cpp
+++ oooqs/oooqs.cpp
@@ -282,9 +282,20 @@
config->reparseConfiguration();
/** Set the values */
config->setGroup("General options");
- soffice = config->readEntry("exec", QDir::homeDirPath() + "/OpenOffice.org1.0");
+ soffice = config->readEntry("exec", "/usr/lib/ooo-*");
sofficeFound=false;
- if (QFile::exists(soffice+"/soffice")){
+
+ if (QFile::exists("/usr/bin/ooo-wrapper")) {
+ int i = soffice.findRev( "/usr/lib/ooo-",0);
+ if ((i == 0) ||
+ (((soffice == QString("/opt/OpenOffice.org")) ||
+ (soffice == QString("/opt/OpenOffice.org/"))) &&
+ (!QFile::exists("/opt/OpenOffice.org/program/soffice")))) {
+ soffice="/usr/bin/ooo-wrapper";
+ sofficeFound=true;
+ }
+ }
+ else if (QFile::exists(soffice+"/soffice")){
soffice+="/soffice";
sofficeFound=true;
}
@@ -431,7 +442,7 @@
/** The additional-group has to be loaded before the modules.
If not, it could happen that disabled radiobuttons are checked */
config->setGroup("General options");
- preferencesDialog->binary->setURL(config->readEntry("exec", "/opt/OpenOffice.org"));
+ preferencesDialog->binary->setURL(config->readEntry("exec", "/usr/lib/ooo-*"));
preferencesDialog->enableQuick->setChecked(quickstartEnabled);
preferencesDialog->maxEntries->setValue(recent->maxItems());
preferencesDialog->documents->setURL(config->readEntry("documents", QDir::homeDirPath()));
@@ -489,9 +500,7 @@
}
KProcess* process = new KProcess;
*process << soffice << params;
- for ( QStringList::Iterator it = params.begin(); it != params.end(); ++it ) {
- KMessageBox::information(this, *it);
- }
+
/** the exit Handler only works, if the father ist notified */
process->start(KProcess::NotifyOnExit,KProcess::NoCommunication);
connect( process, SIGNAL (processExited(KProcess*)), SLOT (delProcess(KProcess*)));
@@ -704,11 +713,21 @@
/** Asks the user if he wants to start spadmin as root or as the current user. */
void OooQs::startSPAdmin(){
KProcess* process = new KProcess;
- if (KMessageBox::questionYesNo(this, i18n("%1 printer administration needs to be started as root if you have installed %1 with the network-option. If you start it as a usual user, you won't be able to save your changed settings.\n\nDo you want to start it as root? (You'll need root's password)").arg(suite).arg(suite)) == 3){
- *process << "kdesu";
- }
+
KGlobal::config()->setGroup("General options");
- *process << KGlobal::config()->readEntry("exec") + "/spadmin";
+ QString exec_path = KGlobal::config()->readEntry("exec", "/usr/lib/ooo-*");
+ if (QFile::exists("/usr/sbin/oopadmin")) {
+ int i = exec_path.findRev( "/usr/lib/ooo-",0);
+ if ((i == 0) ||
+ (((exec_path == QString("/opt/OpenOffice.org")) ||
+ (exec_path == QString("/opt/OpenOffice.org/"))) &&
+ (!QFile::exists("/opt/OpenOffice.org/spadmin")))) {
+ *process << "/usr/sbin/oopadmin";
+ }
+ }
+ else {
+ *process << exec_path + "/spadmin";
+ }
process->start(KProcess::NotifyOnExit,KProcess::NoCommunication);
}
/** Returns soffice. */