当前位置: 首页>>代码示例>>C++>>正文


C++ KStandardDirs::saveLocation方法代码示例

本文整理汇总了C++中KStandardDirs::saveLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ KStandardDirs::saveLocation方法的具体用法?C++ KStandardDirs::saveLocation怎么用?C++ KStandardDirs::saveLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KStandardDirs的用法示例。


在下文中一共展示了KStandardDirs::saveLocation方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: findFileName

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;
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: getConfig

/*!
    \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;
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:34,代码来源:kmlexport.cpp

示例3: getFlightplanList

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 );

}
开发者ID:ac001,项目名称:ffs-central,代码行数:26,代码来源:win_flightplan.cpp

示例4: xmlBaseDir

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;
}
开发者ID:salt4pommes,项目名称:kraft-4.2,代码行数:12,代码来源:archiveman.cpp

示例5: saveWorkSheet

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;
}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:15,代码来源:Workspace.cpp

示例6: doRollBack

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();
	}
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例7: addWebSideBar

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()));
	}
}
开发者ID:,项目名称:,代码行数:40,代码来源:

示例8: main


//.........这里部分代码省略.........
	aboutData.addCredit("Wolfgang Stradner", I18N_NOOP("Very helpful and detailed testing"), "[email protected]", "");
	//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"), "[email protected]", "");
	//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;
}
开发者ID:bibletime,项目名称:historic-bibletime,代码行数:101,代码来源:main.cpp


注:本文中的KStandardDirs::saveLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。