diff -ruN kile-2.1.2.orig/src/main.cpp kile-2.1.2/src/main.cpp --- kile-2.1.2.orig/src/main.cpp 2012-04-22 18:54:51.000000000 +0200 +++ kile-2.1.2/src/main.cpp 2012-06-19 00:10:46.096292174 +0200 @@ -43,19 +43,19 @@ * Complete a relative paths to absolute ones. * Also accepts URLs of the form file:relativepath. */ -QString completePath(const QString &path) +QString completePath(const QString &path, const QString& currentPath) { QString fullpath(path); KILE_DEBUG() << "==complete path is " << path; - if( QDir::isRelativePath(path) ) { + if(QDir::isRelativePath(path)) { if(path.startsWith("file:")) { KUrl url(path); - url.setFileName(completePath(url.toLocalFile())); + url.setFileName(completePath(url.toLocalFile(), currentPath)); fullpath = url.url(); } else if(path.indexOf(QRegExp("^[a-z]+:")) == -1) { - fullpath = QDir::currentPath() + QDir::separator() + path; + fullpath = currentPath + QDir::separator() + path; } } @@ -138,6 +138,10 @@ KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); bool running = false; + // we save the current path here to avoid problems when it's (erroneously) changed later + // (for instance, when a new KonsoleWidget is created, see #301808) + const QString currentPath = QDir::currentPath(); + // this has to go before the DBus connection KApplication app; @@ -151,13 +155,13 @@ for(int i = 0; i < args->count(); ++i) { //FIXME: check whether this can be used to open Urls if(isProject(args->arg(i))) { - kile->openProject(completePath(args->arg(i))); + kile->openProject(completePath(args->arg(i), currentPath)); } else if(args->arg(i) == "-"){ kile->openDocument(readDataFromStdin()); } else { - kile->openDocument(completePath(args->arg(i))); + kile->openDocument(completePath(args->arg(i), currentPath)); } } @@ -175,16 +179,16 @@ for ( int i = 0; i < args->count(); ++i ) { QString path = args->arg(i); - path = completePath(path); + path = completePath(path, currentPath); - if ( isProject(args->arg(i)) ){ - interface->call("openProject",path); + if (isProject(args->arg(i))) { + interface->call("openProject", path); } - else if(args->arg(i) == "-"){ - interface->call("openDocument",readDataFromStdin()); + else if(args->arg(i) == "-") { + interface->call("openDocument", readDataFromStdin()); } else { - interface->call("openDocument",path); + interface->call("openDocument", path); } } diff -ruN kile-2.1.2.orig/src/widgets/konsolewidget.cpp kile-2.1.2/src/widgets/konsolewidget.cpp --- kile-2.1.2.orig/src/widgets/konsolewidget.cpp 2012-04-22 18:54:51.000000000 +0200 +++ kile-2.1.2/src/widgets/konsolewidget.cpp 2012-06-19 00:12:18.451297729 +0200 @@ -78,8 +78,6 @@ layout()->addWidget(m_part->widget()); setFocusProxy(m_part->widget()); connect(m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed())); - - m_term->showShellInDir(QString()); }