static QString findFileName(const QString* tmpl,bool universal, const QString &profile) { QString myFile, filename; KStandardDirs *dirs = KGlobal::dirs(); QString tmp = *tmpl; if (universal) { dirs->saveLocation("data", "konqsidebartng/kicker_entries/", true); tmp.prepend("/konqsidebartng/kicker_entries/"); } else { dirs->saveLocation("data", "konqsidebartng/" + profile + "/entries/", true); tmp.prepend("/konqsidebartng/" + profile + "/entries/"); } filename = tmp.arg(""); myFile = locateLocal("data", filename); if (QFile::exists(myFile)) { for (ulong l = 0; l < ULONG_MAX; l++) { filename = tmp.arg(l); myFile = locateLocal("data", filename); if (!QFile::exists(myFile)) { break; } else { myFile = QString::null; } } } return myFile; }
/*! \fn KmlExport::getConfig() */ int KmlExport::getConfig() { KConfig config("kipirc"); KConfigGroup group = config.group("KMLExport Settings"); m_localTarget = group.readEntry("localTarget", true); m_optimize_googlemap = group.readEntry("optimize_googlemap", false); m_iconSize = group.readEntry("iconSize", 33); // googlemapSize = group.readNumEntry("googlemapSize"); m_size = group.readEntry("size", 320); // UrlDestDir have to have the trailing m_baseDestDir = group.readEntry("baseDestDir", QString("/tmp/")); m_UrlDestDir = group.readEntry("UrlDestDir", QString("http://www.example.com/")); m_KMLFileName = group.readEntry("KMLFileName", QString("kmldocument")); m_altitudeMode = group.readEntry("Altitude Mode", 0); m_GPXtracks = group.readEntry("UseGPXTracks", false); m_GPXFile = group.readEntry("GPXFile", QString()); m_TimeZone = group.readEntry("Time Zone", 12); m_LineWidth = group.readEntry("Line Width", 4); m_GPXColor = group.readEntry("Track Color", "#17eeee" ); m_GPXOpacity = group.readEntry("Track Opacity", 64 ); m_GPXAltitudeMode = group.readEntry("GPX Altitude Mode", 0); KStandardDirs dir; m_tempDestDir = dir.saveLocation("tmp", "kipi-kmlrexportplugin-" + QString::number(getpid()) + '/'); m_imageDir = "images/"; m_googlemapSize = 32; return 1; }
void KFFWin_Flightplan::getFlightplanList( QStringList & list ) { KStandardDirs stddirs; QString dirname; QDir dir; dirname = stddirs.saveLocation( "data" ); dir.cd( dirname ); if ( !dir.exists( "kfreeflight" ) ) { dir.mkdir( "kfreeflight" ); } dir.cd( "kfreeflight" ); if ( !dir.exists( "flightplans" ) ) { dir.mkdir( "flightplans" ); } dir.cd( "flightplans" ); list = dir.entryList( QDir::Files, QDir::Name ); }
QString ArchiveMan::xmlBaseDir() const { KStandardDirs stdDirs; QString outputDir = KraftSettings::self()->pdfOutputDir(); if ( outputDir.isEmpty() ) { outputDir = stdDirs.saveLocation( "data", "kraft/archiveXml", true ); } if ( ! outputDir.endsWith( "/" ) ) outputDir += "/"; return outputDir; }
bool Workspace::saveWorkSheet( WorkSheet *sheet ) { if ( !sheet ) { KMessageBox::sorry( this, i18n( "You do not have a tab that could be saved." ) ); return false; } KStandardDirs* kstd = KGlobal::dirs(); QString fileName = kstd->saveLocation( "data", "ksysguard") + sheet->fileName(); if ( !sheet->save( fileName ) ) { return false; } return true; }
void addBackEnd::doRollBack() { if (KMessageBox::warningContinueCancel(m_parent, i18n("<qt>This removes all your entries from the sidebar and adds the system default ones.<BR><B>This procedure is irreversible</B><BR>Do you want to proceed?</qt>"))==KMessageBox::Continue) { KStandardDirs *dirs = KGlobal::dirs(); QString loc=dirs->saveLocation("data","konqsidebartng/" + m_currentProfile + "/",true); QDir dir(loc); QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks ); dirEntries.remove("."); dirEntries.remove(".."); for ( QStringList::Iterator it = dirEntries.begin(); it != dirEntries.end(); ++it ) { if ((*it)!="add") KIO::NetAccess::del(KURL( loc+(*it) ), m_parent); } emit initialCopyNeeded(); } }
void Sidebar_Widget::addWebSideBar(const KURL& url, const QString& /*name*/) { //kdDebug() << "Web sidebar entry to be added: " << url.url() // << " [" << name << "]" << endl; // Look for existing ones with this URL KStandardDirs *dirs = KGlobal::dirs(); QString list; dirs->saveLocation("data", m_relPath, true); list = locateLocal("data", m_relPath); // Go through list to see which ones exist. Check them for the URL QStringList files = QDir(list).entryList("websidebarplugin*.desktop"); for (QStringList::Iterator it = files.begin(); it != files.end(); ++it){ KSimpleConfig scf(list + *it, false); scf.setGroup("Desktop Entry"); if (scf.readPathEntry("URL", QString::null) == url.url()) { // We already have this one! KMessageBox::information(this, i18n("This entry already exists.")); return; } } QString tmpl = "websidebarplugin%1.desktop"; QString myFile = findFileName(&tmpl,m_universalMode,m_currentProfile); if (!myFile.isEmpty()) { KSimpleConfig scf(myFile, false); scf.setGroup("Desktop Entry"); scf.writeEntry("Type", "Link"); scf.writePathEntry("URL", url.url()); scf.writeEntry("Icon", "netscape"); scf.writeEntry("Name", i18n("Web SideBar Plugin")); scf.writeEntry("Open", "true"); scf.writeEntry("X-KDE-KonqSidebarModule", "konqsidebar_web"); scf.sync(); QTimer::singleShot(0,this,SLOT(updateButtons())); } }
int main(int argc, char* argv[]) { qInstallMsgHandler( myMessageOutput ); //create about data for this application static KCmdLineOptions options[] = { {"debug", I18N_NOOP("Enable debug messages"),0}, {"ignore-session", I18N_NOOP("Ignore the startup session that was saved when BibleTime was closed the last time."),0}, {"open-default-bible <key>", I18N_NOOP("Open the standard Bible with the given key. Use <random> to open at a random position."),0}, //{"install-local <path>", I18N_NOOP("Open the SwordSetup dialog to install works from <path>"),0}, {0,0,0} }; KAboutData aboutData( PACKAGE, "BibleTime", VERSION, I18N_NOOP("Bible study tool for KDE"), KAboutData::License_GPL_V2, I18N_NOOP("(c)1999-2007, The BibleTime Team"), I18N_NOOP("BibleTime is an easy to use but powerful Bible study tool for KDE.\n\nWe are looking for developers and translators.\nIf you'd like to join our team, please send an email to [email protected]."), "http://www.bibletime.info/", "*****@*****.**" ); /*********************************************** * Active developers (sorted by last name) * ************************************************/ // Project coordination aboutData.addAuthor("Joachim Ansorg", I18N_NOOP("Project coordinator"), "*****@*****.**", "http://www.joachim-ansorg.de/"); // Second main developer aboutData.addAuthor("Martin Gruner", I18N_NOOP("Frontend, backend"), "*****@*****.**", ""); // artwork aboutData.addAuthor("James Ots", I18N_NOOP("Crystal icons, crystal startlogo, webpage"), "*****@*****.**", "http://www.jamesots.com"); //inactiv /*********************************************** * Credits (sorted by last name) * ************************************************/ // Update to the Romanian GUI translation aboutData.addCredit("Horatiu Alexe", I18N_NOOP("Romanian translation"), ""); //highcolor icons, startlogo for BT <= 1.4 aboutData.addCredit("David Blue", I18N_NOOP("High contrast template"), "*****@*****.**"); //helped out with the installation manager aboutData.addCredit("Tim Brodie", I18N_NOOP("Installation manager"),"*****@*****.**", ""); //first set of icons and the first startup logos aboutData.addCredit("Timothy R. Butler", I18N_NOOP("Icons, startlogo"), "*****@*****.**", "http://www.uninetsolutions.com"); //GUI improvements aboutData.addCredit("Jim Campbell", I18N_NOOP("GUI"), "*****@*****.**", ""); //Indexed search, gui improvements aboutData.addCredit("Lee Carpenter", I18N_NOOP("GUI, instant search"),"Lee Carpenter <*****@*****.**>", "http://www.carpie.net"); //Translations into Traditional and Simplified Chinese aboutData.addCredit("Chun-shek Chan", I18N_NOOP("GUI translations into Traditional and Simplified Chinese"), "*****@*****.**", ""); //Binary packages of CLucene, BibleTime and Sword for Fedore, SUSE, Mandriva aboutData.addCredit("Jeremy Erickson", I18N_NOOP("Binary packages"), "", ""); //Started the Crosswire porject, also contributed some code aboutData.addCredit("Troy A. Griffits", I18N_NOOP("Founder of the Sword project"), "*****@*****.**", "http://www.crosswire.org/"); //Sponsored many years the www.bibletime.de domain! aboutData.addCredit("Thomas Hagedorn", I18N_NOOP("Sponsored our internet domain for many years"), "*****@*****.**", ""); //He provided us with the Bible Study HowTo aboutData.addCredit("Bob Harman", I18N_NOOP("Bible Study HowTo"), "*****@*****.**", ""); // and / or search for multiple words, other fixes and improvements aboutData.addCredit("Nikolay Igotti", I18N_NOOP("Search dialog enhancements"), "*****@*****.**", ""); // Language codes iso639-1, iso639-2 and SIL language codes aboutData.addCredit("SIL International", I18N_NOOP("Language codes and names"), "", "http://www.ethnologue.com/iso639"); //Patch for the mag delay (2007-03-22) aboutData.addCredit("Eeli Kaikkonen", I18N_NOOP("GUI improvements"),"*****@*****.**", ""); //Update the the Finnish GUI translation aboutData.addCredit("Ilpo Kantonen", I18N_NOOP("Finnish translation"),"", ""); //Smaller frontend enhancements aboutData.addCredit("Chris Kujawa", I18N_NOOP("Frontend"),"*****@*****.**", ""); //Update to the Czech GUI translation aboutData.addCredit("Pavel Lauko", I18N_NOOP("Czech translation"),"", ""); //Smaller searchdialog enhancements aboutData.addCredit("Mark Lybarger", I18N_NOOP("Searchdialog"), "*****@*****.**",""); //Polish GUI translation update aboutData.addCredit("Piotr Markiewicz", I18N_NOOP("Polish translation"), "*****@*****.**", ""); //Smaller frontend enhancements aboutData.addCredit("Luke Mauldin", I18N_NOOP("Frontend"), "*****@*****.**", ""); //translated parts of the russian website files aboutData.addCredit("Igor Rykhlin", I18N_NOOP("Russian website translation"), "", ""); // update to the Spanish website translation aboutData.addCredit("Gabriel PĂ©rez", I18N_NOOP("Spanish website translation updates"), "", ""); //Update to the russian website translation aboutData.addCredit("Igor Plisco", I18N_NOOP("Update to the russian website translation"), "", ""); // handbook documentation aboutData.addCredit("Fred Saalbach", I18N_NOOP("Documentation"), "*****@*****.**", ""); // Original Russian website translator aboutData.addCredit("Vlad Savitsky", I18N_NOOP("Russian website translation"), "", ""); // comitted search in default bible, opened modules, other smaller things aboutData.addCredit("Gary Sims", I18N_NOOP("Search dialog enhancements"), "*****@*****.**", ""); // Very helpful testing aboutData.addCredit("Wolfgang Stradner", I18N_NOOP("Very helpful and detailed testing"), "*****@*****.**", ""); //The first lead developer aboutData.addCredit("Torsten Uhlmann", I18N_NOOP("The first lead developer"), "", ""); //Update of the dutch website translation aboutData.addCredit("Johan van der Lingen", I18N_NOOP("Translation updates for the Dutch GUI, the website and the handbook"), "", ""); //French handbook translation aboutData.addCredit("Jean Van Schaftingen", I18N_NOOP("French handbook translation"), "", ""); //scoped_ptr and related classes aboutData.addCredit("David White", I18N_NOOP("Helpful source code additions"), "", "http://www.wesnoth.org/"); //Translated the GUI into Russian aboutData.addCredit("Dmitry Yurevich", I18N_NOOP("Translated the GUI into Russian"), "", ""); //The new keychooser for Bible modules aboutData.addCredit("Mark Zealey", I18N_NOOP("New Bible key choosers"), "*****@*****.**", ""); //Update to the Spanish GUI translation aboutData.addCredit("Esteban Zeller", I18N_NOOP("Spanish translation"), "", ""); //special message so the translator get his credits in the about box, don't remove this! QString dummy = I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"); //translator's name dummy = I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"); //translators eMail KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions( options ); BibleTimeApp app; KGlobal::dirs()->addResourceType("BT_pic", "share/apps/bibletime/pics"); KGlobal::dirs()->addResourceType("BT_DisplayTemplates", "share/apps/bibletime/display-templates"); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); // A binary option (on / off) if (args->isSet("debug")) { showDebugMessages = true; } if (kapp->isRestored()) { // qWarning("Restoring BibleTime"); //RESTORE( BibleTime ); int n = 1; while (KMainWindow::canBeRestored(n)){ if (KMainWindow::classNameOfToplevel(n) == QString("BibleTime")) { bibletime_ptr = new BibleTime; bibletime_ptr->restore(n); } n++; } bibletime_ptr->restoreWorkspace(); } else { const bool showIt = CBTConfig::get(CBTConfig::logo); if(showIt) { KStartupLogo::createSplash(); KStartupLogo::showSplash(); KStartupLogo::setStatusMessage( i18n("Starting BibleTime") + QString("...") ); } setSignalHandler(signalHandler); // compatibility stuff for 1.3, needs to be moved to better place later if (CBTConfig::get(CBTConfig::bibletimeVersion) != VERSION) { KStandardDirs stdDirs; QDir dir(stdDirs.saveLocation("data", "bibletime/")); if (!dir.exists("sessions/") && dir.exists("profiles/")) { //only old dir exists dir.rename("profiles", "sessions"); } } bibletime_ptr = new BibleTime(); // a new BibleTime version was installed (maybe a completely new installation) if (CBTConfig::get(CBTConfig::bibletimeVersion) != VERSION) { KStartupLogo::hideSplash(); CBTConfig::set(CBTConfig::bibletimeVersion, VERSION); bibletime_ptr->slotSettingsOptions(); } //The tip of the day if (CBTConfig::get(CBTConfig::tips)) { KStartupLogo::hideSplash(); bibletime_ptr->slotHelpTipOfDay(); } // restore the workspace and process command line options app.setMainWidget(bibletime_ptr); bibletime_ptr->show(); bibletime_ptr->processCommandline(); //must be done after the bibletime window is visible if (showIt) { KStartupLogo::hideSplash(); KStartupLogo::deleteSplash(); } } const int ret = app.exec(); delete bibletime_ptr; return ret; }