summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@digia.com>2013-05-24 16:31:01 +0200
committerKai Koehne <kai.koehne@digia.com>2013-06-04 12:11:36 +0200
commitb0854e3c71803c8397f9bb48b8766c151b6e0edd (patch)
tree9e820e8f6691f5be9ee7bd60c3b9662343ed751d /src/plugins/qmljstools/qmlconsoleitemdelegate.cpp
parent25dd94808d0fee8ea3aa949d4d9ae17cac5ffd6c (diff)
downloadqt-creator-b0854e3c71803c8397f9bb48b8766c151b6e0edd.tar.gz
QmlConsole: Fix bug: Jump to location in editor
Since the file path starts with file:/// use QUrl to get local file name. Task-number: QTCREATORBUG-9337 Change-Id: Icf591fdcab8cb626cfbf844c451a2c87c07b853a Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmljstools/qmlconsoleitemdelegate.cpp')
-rw-r--r--src/plugins/qmljstools/qmlconsoleitemdelegate.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp b/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp
index c02f00e708..17bcb677a1 100644
--- a/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp
+++ b/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp
@@ -33,6 +33,7 @@
#include <QPainter>
#include <QTreeView>
#include <QScrollBar>
+#include <QUrl>
const char CONSOLE_LOG_BACKGROUND_COLOR[] = "#E8EEF2";
const char CONSOLE_WARNING_BACKGROUND_COLOR[] = "#F6F4EB";
@@ -215,6 +216,9 @@ void QmlConsoleItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
if (showFileLineInfo) {
// Check for file info
QString file = index.data(QmlConsoleItemModel::FileRole).toString();
+ const QUrl fileUrl = QUrl(file);
+ if (fileUrl.isLocalFile())
+ file = fileUrl.toLocalFile();
if (!file.isEmpty()) {
QFontMetrics fm(option.font);
// Paint FileArea