diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp
index b9628e0eb9bacc48bbf95efe5692fa7847c41507..5347536a5acc68e92585376ae173f3c91be8bea3 100644
--- a/src/plugins/coreplugin/coreimpl.cpp
+++ b/src/plugins/coreplugin/coreimpl.cpp
@@ -228,9 +228,9 @@ void CoreImpl::removeContextObject(IContext *context)
     m_mainwindow->removeContextObject(context);
 }
 
-void CoreImpl::openFiles(const QStringList &arguments, bool switchMode)
+void CoreImpl::openFiles(const QStringList &arguments, ICore::OpenFilesFlags flags)
 {
-    m_mainwindow->openFiles(arguments, switchMode);
+    m_mainwindow->openFiles(arguments, flags);
 }
 
 void CoreImpl::emitNewItemsDialogRequested()
diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h
index e926c9fdcb944f0ef7058027fee564a65aad0768..e8e114cbbabb5c16c9ba523b8e03d0b8b57b82c3 100644
--- a/src/plugins/coreplugin/coreimpl.h
+++ b/src/plugins/coreplugin/coreimpl.h
@@ -88,7 +88,7 @@ public:
     void addContextObject(IContext *context);
     void removeContextObject(IContext *context);
 
-    void openFiles(const QStringList &fileNames, bool switchMode);
+    void openFiles(const QStringList &fileNames, ICore::OpenFilesFlags flags);
 
     void emitNewItemsDialogRequested();
 
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index 9e8d03bfcca31dae0c5e597ea0ca623f9afd0cd8..a855b0d4262705aed0d6039f770370a5a14a5090 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -100,7 +100,7 @@ void CorePlugin::extensionsInitialized()
 
 void CorePlugin::remoteCommand(const QStringList & /* options */, const QStringList &args)
 {
-    m_mainWindow->openFiles(args, true);
+    m_mainWindow->openFiles(args, ICore::SwitchMode);
     m_mainWindow->activateWindow();
 }
 
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 0ea17b2b9e449639d0e837eb3a274b9b5fe8e5fe..cad242bbffe0e89e7a51775db5880977f62c7703 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -1179,31 +1179,53 @@ IEditor *EditorManager::openEditor(const QString &fileName, const QString &edito
     return openEditor(0, fileName, editorId, flags, newEditor);
 }
 
+int extractLineNumber(QString *fileName)
+{
+    int i = fileName->length() - 1;
+    for (; i >= 0; --i) {
+        if (!fileName->at(i).isNumber())
+            break;
+    }
+    if (i == -1)
+        return -1;
+    if (fileName->at(i) == ':' || fileName->at(i) == '+') {
+        int result = fileName->mid(i+1).toInt();
+        *fileName = fileName->left(i);
+        return result;
+    }
+    return -1;
+}
+
 IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName,
                         const QString &editorId, OpenEditorFlags flags, bool *newEditor)
 {
     if (debugEditorManager)
         qDebug() << Q_FUNC_INFO << fileName << editorId;
 
-    if (fileName.isEmpty())
+    QString fn = fileName;
+    int lineNumber = -1;
+    if (flags && EditorManager::CanContainLineNumber)
+        lineNumber = extractLineNumber(&fn);
+
+    if (fn.isEmpty())
         return 0;
 
     if (newEditor)
         *newEditor = false;
 
-    const QList<IEditor *> editors = editorsForFileName(fileName);
+    const QList<IEditor *> editors = editorsForFileName(fn);
     if (!editors.isEmpty())
         return activateEditor(view, editors.first(), flags);
 
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-    IEditor *editor = createEditor(editorId, fileName);
+    IEditor *editor = createEditor(editorId, fn);
     // If we could not open the file in the requested editor, fall
     // back to the default editor:
     if (!editor)
-        editor = createEditor(QString(), fileName);
-    if (!editor || !editor->open(fileName)) {
+        editor = createEditor(QString(), fn);
+    if (!editor || !editor->open(fn)) {
         QApplication::restoreOverrideCursor();
-        QMessageBox::critical(m_d->m_core->mainWindow(), tr("Opening File"), tr("Cannot open file %1!").arg(QDir::toNativeSeparators(fileName)));
+        QMessageBox::critical(m_d->m_core->mainWindow(), tr("Opening File"), tr("Cannot open file %1!").arg(QDir::toNativeSeparators(fn)));
         delete editor;
         editor = 0;
         return 0;
@@ -1216,6 +1238,10 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
     IEditor *result = activateEditor(view, editor, flags);
     if (editor == result)
         restoreEditorState(editor);
+
+    if (flags && EditorManager::CanContainLineNumber)
+        editor->gotoLine(lineNumber, -1);
+
     QApplication::restoreOverrideCursor();
     return result;
 }
diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h
index 68c22f1e34d48c33de965263d8eca44550712b11..65a5b1038c0decfbac21997397cb3c46de6ae7ce 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.h
+++ b/src/plugins/coreplugin/editormanager/editormanager.h
@@ -109,7 +109,8 @@ public:
     enum OpenEditorFlag {
         NoActivate = 1,
         IgnoreNavigationHistory = 2,
-        ModeSwitch = 4
+        ModeSwitch = 4,
+        CanContainLineNumber = 8
     };
     Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
 
diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h
index 3d8b7eb996e28889db7e95ef5e9fdcf557d2b25f..90dad36a9931bdf8f88f4acbdfe9ba2b0e9de61a 100644
--- a/src/plugins/coreplugin/editormanager/ieditor.h
+++ b/src/plugins/coreplugin/editormanager/ieditor.h
@@ -60,6 +60,7 @@ public:
 
     virtual int currentLine() const { return 0; }
     virtual int currentColumn() const { return 0; }
+    virtual void gotoLine(int line, int column = 0) { Q_UNUSED(line); Q_UNUSED(column); };
 
     virtual bool isTemporary() const = 0;
 
diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h
index b07ee409edfd0da404ede04e9c01b3dbb79aaa63..ad353f734c911b9f1c8f9bcd986b4e0a4bb09fe8 100644
--- a/src/plugins/coreplugin/icore.h
+++ b/src/plugins/coreplugin/icore.h
@@ -119,7 +119,8 @@ public:
     virtual void addContextObject(IContext *context) = 0;
     virtual void removeContextObject(IContext *context) = 0;
 
-    virtual void openFiles(const QStringList &fileNames, bool switchMode) = 0;
+    enum OpenFilesFlags { None = 0, SwitchMode = 1, CanContainLineNumbers = 2};
+    virtual void openFiles(const QStringList &fileNames, OpenFilesFlags flags = None) = 0;
 
 signals:
     void coreAboutToOpen();
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index c7a9c8a074aefd437101f9a85abb0e720c29fe3b..f32b3b2a18b0efad22729960b87911c060db9f74 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -416,7 +416,7 @@ void MainWindow::dropEvent(QDropEvent *event)
     QStringList files;
     if (isDesktopFileManagerDrop(event->mimeData(), &files)) {
         event->accept();
-        openFiles(files, true);
+        openFiles(files, ICore::SwitchMode);
     } else {
         event->ignore();
     }
@@ -793,7 +793,7 @@ void MainWindow::newFile()
 
 void MainWindow::openFile()
 {
-    openFiles(editorManager()->getOpenFileNames(), true);
+    openFiles(editorManager()->getOpenFileNames(), ICore::SwitchMode);
 }
 
 static QList<IFileFactory*> getNonEditorFileFactories()
@@ -823,7 +823,7 @@ static IFileFactory *findFileFactory(const QList<IFileFactory*> &fileFactories,
 }
 
 // opens either an editor or loads a project
-void MainWindow::openFiles(const QStringList &fileNames, bool switchMode)
+void MainWindow::openFiles(const QStringList &fileNames, ICore::OpenFilesFlags flags)
 {
     QList<IFileFactory*> nonEditorFileFactories = getNonEditorFileFactories();
 
@@ -832,13 +832,15 @@ void MainWindow::openFiles(const QStringList &fileNames, bool switchMode)
         const QString absoluteFilePath = fi.absoluteFilePath();
         if (IFileFactory *fileFactory = findFileFactory(nonEditorFileFactories, mimeDatabase(), fi)) {
             fileFactory->open(absoluteFilePath);
-            if (switchMode)
+            if (flags && ICore::SwitchMode)
                 Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
         } else {
-            EditorManager::OpenEditorFlag flags;
-            if (switchMode)
-                flags = EditorManager::ModeSwitch;
-            editorManager()->openEditor(absoluteFilePath, QString(), flags);
+            QFlags<EditorManager::OpenEditorFlag> emFlags;
+            if (flags && ICore::SwitchMode)
+                emFlags = EditorManager::ModeSwitch;
+            if (flags && ICore::CanContainLineNumbers)
+                emFlags |=  EditorManager::CanContainLineNumber;
+            editorManager()->openEditor(absoluteFilePath, QString(), emFlags);
         }
     }
 }
diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h
index 92adeceda6ddb2c105d61ad76b37bed39ece9948..bd1708607e182d2257c7363f4b8f00292072eee6 100644
--- a/src/plugins/coreplugin/mainwindow.h
+++ b/src/plugins/coreplugin/mainwindow.h
@@ -32,6 +32,7 @@
 
 #include "core_global.h"
 #include "icontext.h"
+#include "icore.h"
 #include "dialogs/iwizard.h"
 
 #include "eventfilteringmainwindow.h"
@@ -97,7 +98,7 @@ public:
     void removeContextObject(IContext *contex);
     void resetContext();
 
-    void openFiles(const QStringList &fileNames, bool switchMode);
+    void openFiles(const QStringList &fileNames, ICore::OpenFilesFlags flags);
 
     Core::ActionManager *actionManager() const;
     Core::FileManager *fileManager() const;
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 22cbc2dc830e57dfdf1e683ac8ca040b096634cc..0d1837596e8c41dac8028521ef50cb32059f0189 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -1240,7 +1240,18 @@ void ProjectExplorerPlugin::restoreSession()
     connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
     connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString)));
 
-    Core::ICore::instance()->openFiles(arguments, false);
+    QStringList combinedList;
+    // Converts "filename" "+45" or "filename" ":23"
+    // into     "filename+45"   and "filename:23"
+    foreach (const QString &str, arguments) {
+        if (!combinedList.isEmpty() && (str.startsWith("+") || str.startsWith(":"))) {
+            combinedList.last().append(str);
+        } else {
+            combinedList << str;
+        }
+    }
+
+    Core::ICore::instance()->openFiles(combinedList, Core::ICore::CanContainLineNumbers);
     updateActions();
 
 }
@@ -2375,7 +2386,7 @@ void ProjectExplorerPlugin::openOpenProjectDialog()
     const QString path = fileMananger->useProjectsDirectory() ? fileMananger->projectsDirectory() : QString();
     const QStringList files = fileMananger->getOpenFileNames(filters, path, &projectFilesFilter);
     if (!files.isEmpty())
-        Core::ICore::instance()->openFiles(files, true);
+        Core::ICore::instance()->openFiles(files, Core::ICore::SwitchMode);
 }
 
 Q_EXPORT_PLUGIN(ProjectExplorerPlugin)
diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
index 10d3af85ec0d9c26f7a7649de83b82e1ad89bd8c..7742aa510618e1bb8737d482394963da0c51b02e 100644
--- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
+++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
@@ -335,7 +335,7 @@ void GettingStartedWelcomePageWidget::slotOpenExample()
         tryFile = proFileInfo.path() + '/' + proFileInfo.baseName() + ".qml";
     if(QFile::exists(tryFile))
         files << tryFile;
-    Core::ICore::instance()->openFiles(files, true);
+    Core::ICore::instance()->openFiles(files, Core::ICore::SwitchMode);
     if (!helpFile.isEmpty())
         slotOpenContextHelpPage(helpFile);
 }
diff --git a/src/plugins/texteditor/itexteditor.h b/src/plugins/texteditor/itexteditor.h
index 3dbb3e264087c2b8bad829a84f3e6ea17f87cb6d..16af52ef1fc5b5df17b099e97d78f519995e13ed 100644
--- a/src/plugins/texteditor/itexteditor.h
+++ b/src/plugins/texteditor/itexteditor.h
@@ -99,8 +99,6 @@ public:
 
     virtual int find(const QString &string) const = 0;
 
-    virtual void gotoLine(int line, int column = 0) = 0;
-
     virtual int position(PositionOperation posOp = Current, int at = -1) const = 0;
     virtual void convertPosition(int pos, int *line, int *column) const = 0;
     virtual QRect cursorRect(int pos = -1) const = 0;