diff --git a/konsole/konsole.cpp b/konsole/konsole.cpp index 12651c6cd..5f4be96a4 100644 --- a/konsole/konsole.cpp +++ b/konsole/konsole.cpp @@ -1464,7 +1464,7 @@ void Konsole::slotSaveSessionsProfile() i18n( "Enter name under which the profile should be saved:" ), QString(), &ok, this ); if ( ok ) { - QString path = locateLocal( "data", + QString path = KStandardDirs::locateLocal( "data", QString::fromLatin1( "konsole/profiles/" ) + prof, KGlobal::instance() ); @@ -2731,7 +2731,7 @@ KSimpleConfig *Konsole::defaultSession() void Konsole::setDefaultSession(const QString &filename) { delete m_defaultSession; - m_defaultSession = new KSimpleConfig(locate("appdata", filename), true /* read only */); + m_defaultSession = new KSimpleConfig(KStandardDirs::locate("appdata", filename), true /* read only */); m_defaultSession->setDesktopGroup(); b_showstartuptip = m_defaultSession->readEntry("Tips", QVariant(true)).toBool(); @@ -2802,7 +2802,7 @@ QString Konsole::newSession(const QString &type) if (type.isEmpty()) co = defaultSession(); else - co = new KSimpleConfig(locate("appdata", type + ".desktop"), true /* read only */); + co = new KSimpleConfig(KStandardDirs::locate("appdata", type + ".desktop"), true /* read only */); return newSession(co); } @@ -3145,7 +3145,7 @@ void Konsole::moveSessionLeft() tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); QString title = se->Title(); - createSessionTab(se->widget(), iconSetForSession(se), + createSessionTab(se->widget(), iconSetForSession(se), title.replace('&', "&&"), position-1); tabwidget->setCurrentIndex( tabwidget->indexOf( se->widget() )); tabwidget->setTabTextColor(tabwidget->indexOf(se->widget()),oldcolor); @@ -3178,7 +3178,7 @@ void Konsole::moveSessionRight() tabwidget->removePage(se->widget()); tabwidget->blockSignals(false); QString title = se->Title(); - createSessionTab(se->widget(), iconSetForSession(se), + createSessionTab(se->widget(), iconSetForSession(se), title.replace('&', "&&"), position+1); tabwidget->setCurrentIndex( tabwidget->indexOf( se->widget() ) ); tabwidget->setTabTextColor(tabwidget->indexOf(se->widget()),oldcolor); @@ -3352,14 +3352,14 @@ void Konsole::addSessionCommand(const QString &path) { KSimpleConfig* co; if (path.isEmpty()) - co = new KSimpleConfig(locate("appdata", "shell.desktop"), true /* read only */); + co = new KSimpleConfig(KStandardDirs::locate("appdata", "shell.desktop"), true /* read only */); else co = new KSimpleConfig(path,true); co->setDesktopGroup(); QString typ = co->readEntry("Type"); QString txt = co->readEntry("Name"); - // try to locate the binary + // try to KStandardDirs::locate the binary QString exec= co->readPathEntry("Exec"); if (exec.startsWith("su -c \'")) { exec = exec.mid(7,exec.length()-8); @@ -4193,7 +4193,7 @@ SizeDialog::SizeDialog(const unsigned int columns, { setCaption( i18n("Size Configuration") ); setButtons( Help | Default | Ok | Cancel ); - + QFrame *mainFrame = new QFrame; setMainWidget( mainFrame ); diff --git a/konsole/konsolebookmarkhandler.cpp b/konsole/konsolebookmarkhandler.cpp index 997eb6a61..f1b32973d 100644 --- a/konsole/konsolebookmarkhandler.cpp +++ b/konsole/konsolebookmarkhandler.cpp @@ -41,26 +41,26 @@ KonsoleBookmarkHandler::KonsoleBookmarkHandler( Konsole *konsole, bool toplevel // KDE3.5 - Konsole's bookmarks are now in konsole/bookmarks.xml // TODO: Consider removing for KDE4 - QString new_bm_file = locateLocal( "data", "konsole/bookmarks.xml" ); + QString new_bm_file = KStandardDirs::locateLocal( "data", "konsole/bookmarks.xml" ); if ( !QFile::exists( new_bm_file ) ) { - QString old_bm_file = locateLocal( "data", "kfile/bookmarks.xml" ); + QString old_bm_file = KStandardDirs::locateLocal( "data", "kfile/bookmarks.xml" ); if ( QFile::exists( old_bm_file ) ) - // We want sync here... - if ( !KIO::NetAccess::copy( KUrl( old_bm_file ), + // We want sync here... + if ( !KIO::NetAccess::copy( KUrl( old_bm_file ), KUrl ( new_bm_file ), 0 ) ) { kWarning()<setEditorOptions(kapp->caption(), false); manager->setUpdate( true ); manager->setShowNSBookmarks( false ); - + connect( manager, SIGNAL( changed(const QString &, const QString &) ), SLOT( slotBookmarksChanged(const QString &, const QString &) ) ); diff --git a/konsole/main.cpp b/konsole/main.cpp index 96c0137ee..aa5ae632f 100644 --- a/konsole/main.cpp +++ b/konsole/main.cpp @@ -396,7 +396,7 @@ extern "C" int KDE_EXPORT kdemain(int argc, char* argv[]) QString profile = ""; if (args->isSet("profile")) { profile = args->getOption("profile"); - QString path = locate( "data", "konsole/profiles/" + profile ); + QString path = KStandardDirs::locate( "data", "konsole/profiles/" + profile ); if ( QFile::exists( path ) ) sessionconfig=new KConfig( path, true ); else diff --git a/konsole/schema.cpp b/konsole/schema.cpp index d0ef96079..a73f46eb7 100644 --- a/konsole/schema.cpp +++ b/konsole/schema.cpp @@ -135,7 +135,7 @@ ColorSchema::ColorSchema(const QString& pathname) { //start with a valid time, aleXXX *lastRead = QDateTime::currentDateTime(); - QString fPath = pathname.startsWith("/") ? pathname : locate("data", "konsole/"+pathname); + QString fPath = pathname.startsWith("/") ? pathname : KStandardDirs::locate("data", "konsole/"+pathname); if (fPath.isEmpty() || !QFile::exists(fPath)) { fRelPath.clear(); @@ -294,7 +294,7 @@ static int random_hue = -1; bool ColorSchema::rereadSchemaFile() { - QString fPath = fRelPath.isEmpty() ? "" : (fRelPath.startsWith("/") ? fRelPath : locate("data", "konsole/"+fRelPath)); + QString fPath = fRelPath.isEmpty() ? "" : (fRelPath.startsWith("/") ? fRelPath : KStandardDirs::locate("data", "konsole/"+fRelPath)); if (fPath.isEmpty() || !QFile::exists(fPath)) return false; @@ -336,7 +336,7 @@ bool ColorSchema::rereadSchemaFile() continue; QString qline(line); - m_imagePath = locate("wallpaper", qline.mid( qline.indexOf(" ",7)+1 ) ); + m_imagePath = KStandardDirs::locate("wallpaper", qline.mid( qline.indexOf(" ",7)+1 ) ); m_alignment = attr; } if (!strncmp(line,"transparency",12)) @@ -415,7 +415,7 @@ bool ColorSchema::rereadSchemaFile() bool ColorSchema::hasSchemaFileChanged() const { - QString fPath = fRelPath.isEmpty() ? "" : locate("data", "konsole/"+fRelPath); + QString fPath = fRelPath.isEmpty() ? "" : KStandardDirs::locate("data", "konsole/"+fRelPath); //KONSOLEDEBUG << "Checking schema file " << fPath << endl; diff --git a/settings/schemaeditor.cpp b/settings/schemaeditor.cpp index 80f64c264..f833706e1 100644 --- a/settings/schemaeditor.cpp +++ b/settings/schemaeditor.cpp @@ -132,7 +132,7 @@ QString SchemaEditor::schema() void SchemaEditor::setSchema(QString sch) { defaultSchema = sch; - sch = locate("data", "konsole/"+sch); + sch = KStandardDirs::locate("data", "konsole/"+sch); int sc = -1; for (int i = 0; i < (int) schemaList->count(); i++) @@ -309,7 +309,7 @@ void SchemaEditor::removeCurrent() QString base = ((SchemaListBoxText *) schemaList->item(i))->filename(); // Query if system schemas should be removed - if (locateLocal("data", "konsole/" + base.section('/', -1)) != base) { + if (KStandardDirs::locateLocal("data", "konsole/" + base.section('/', -1)) != base) { int code = KMessageBox::warningContinueCancel(this, i18n("You are trying to remove a system schema. Are you sure?"), i18n("Removing System Schema"), @@ -455,10 +455,10 @@ QString SchemaEditor::readSchemaTitle(const QString & file) */ - QString fPath = locate("data", "konsole/" + file); + QString fPath = KStandardDirs::locate("data", "konsole/" + file); if (fPath.isNull()) - fPath = locate("data", file); + fPath = KStandardDirs::locate("data", file); if (fPath.isNull()) return 0; @@ -536,11 +536,11 @@ void SchemaEditor::readSchema(int num) } - QString fPath = locate("data", "konsole/" + + QString fPath = KStandardDirs::locate("data", "konsole/" + ((SchemaListBoxText *) schemaList->item(num))->filename()); if (fPath.isNull()) - fPath = locate("data", + fPath = KStandardDirs::locate("data", ((SchemaListBoxText *) schemaList->item(num))->filename()); if (fPath.isNull()) { @@ -592,7 +592,7 @@ void SchemaEditor::readSchema(int num) continue; QString qline(line); - backgndLine->setText(locate("wallpaper", qline.mid( qline.indexOf(" ",7)+1 ) )); + backgndLine->setText(KStandardDirs::locate("wallpaper", qline.mid( qline.indexOf(" ",7)+1 ) )); modeCombo->setCurrentIndex(attr - 2); } diff --git a/settings/sessioneditor.cpp b/settings/sessioneditor.cpp index 322150216..5a454f747 100644 --- a/settings/sessioneditor.cpp +++ b/settings/sessioneditor.cpp @@ -125,10 +125,10 @@ void SessionEditor::loadAllKeytab() QString SessionEditor::readKeymapTitle(const QString & file) { - QString fPath = locate("data", "konsole/" + file); + QString fPath = KStandardDirs::locate("data", "konsole/" + file); if (fPath.isNull()) - fPath = locate("data", file); + fPath = KStandardDirs::locate("data", file); removeButton->setEnabled( QFileInfo (fPath).isWritable () ); if (fPath.isNull()) @@ -358,7 +358,7 @@ void SessionEditor::removeCurrent() QString base = ((SessionListBoxText *)sessionList->item( sessionList->currentItem() ))->filename(); // Query if system sessions should be removed - if (locateLocal("data", "konsole/" + base.section('/', -1)) != base) { + if (KStandardDirs::locateLocal("data", "konsole/" + base.section('/', -1)) != base) { int code = KMessageBox::warningContinueCancel(this, i18n("You are trying to remove a system session. Are you sure?"), i18n("Removing System Session"),