void KBlueTray::initConfig() {
	config = new KConfig("kbluetoothrc");
	confGroup = new KConfigGroup(config, "General");
	KConfigGroup obexServerConfig(config, "ObexServer");
	if(!obexServerConfig.hasKey("savePath")) {
		QString saveUrl;
		KDirSelectDialog dirs;
		if(dirs.exec() && dirs.url().isValid()) {
			saveUrl = dirs.url().path();
		}else{
			saveUrl = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
		}
		obexServerConfig.writeEntry("savePath",saveUrl);
		obexServerConfig.sync();
	}
	if(!obexServerConfig.hasKey("Autostart")) {
		obexServerConfig.writeEntry("Autostart", "true");
		obexServerConfig.sync();
	}
	if(!config->group("KBlueLock").hasKey("Device")) {
		config->group("KBlueLock").writeEntry("Device", "");
		config->group("KBlueLock").sync();
	}
	if(!config->group("KBlueLock").hasKey("LockEnabled")) {
		config->group("KBlueLock").writeEntry("LockEnabled", false);
		config->group("KBlueLock").sync();
	}
	if(!config->group("KBlueLock").hasKey("UnlockEnabled")) {
		config->group("KBlueLock").writeEntry("UnlockEnabled", true);
		config->group("KBlueLock").sync();
	}
}
Ejemplo n.º 2
0
void ContextHelp::requestItemDescriptionsDirectory()
{
	KDirSelectDialog * dlg = new KDirSelectDialog( itemLibrary()->itemDescriptionsDirectory(), true );
	if ( dlg->exec() == QDialog::Accepted )
	{
		itemLibrary()->setItemDescriptionsDirectory( dlg->url().path() );
	}
	delete dlg;
	return;
}