forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts: src/plugins/qmljstools/qmlconsoleitemdelegate.cpp src/plugins/qmlprofiler/qmlprofilerengine.cpp Change-Id: I95c2c4116e28683fafcc0a557a7913d67361dcd4
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <QTreeView>
|
||||
#include <QScrollBar>
|
||||
#include <QTextLayout>
|
||||
#include <QUrl>
|
||||
|
||||
const char CONSOLE_LOG_BACKGROUND_COLOR[] = "#E8EEF2";
|
||||
const char CONSOLE_WARNING_BACKGROUND_COLOR[] = "#F6F4EB";
|
||||
@@ -216,6 +217,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
|
||||
|
||||
@@ -225,8 +225,10 @@ void QmlConsoleView::onRowActivated(const QModelIndex &index)
|
||||
return;
|
||||
|
||||
// See if we have file and line Info
|
||||
QString filePath = model()->data(index,
|
||||
QmlConsoleItemModel::FileRole).toString();
|
||||
QString filePath = model()->data(index, QmlConsoleItemModel::FileRole).toString();
|
||||
const QUrl fileUrl = QUrl(filePath);
|
||||
if (fileUrl.isLocalFile())
|
||||
filePath = fileUrl.toLocalFile();
|
||||
if (!filePath.isEmpty()) {
|
||||
QFileInfo fi(filePath);
|
||||
if (fi.exists() && fi.isFile() && fi.isReadable()) {
|
||||
@@ -244,6 +246,9 @@ void QmlConsoleView::copyToClipboard(const QModelIndex &index)
|
||||
QString contents = model()->data(index, QmlConsoleItemModel::ExpressionRole).toString();
|
||||
// See if we have file and line Info
|
||||
QString filePath = model()->data(index, QmlConsoleItemModel::FileRole).toString();
|
||||
const QUrl fileUrl = QUrl(filePath);
|
||||
if (fileUrl.isLocalFile())
|
||||
filePath = fileUrl.toLocalFile();
|
||||
if (!filePath.isEmpty()) {
|
||||
contents = QString(QLatin1String("%1 %2: %3")).arg(contents).arg(filePath).arg(
|
||||
model()->data(index, QmlConsoleItemModel::LineRole).toString());
|
||||
@@ -259,6 +264,9 @@ bool QmlConsoleView::canShowItemInTextEditor(const QModelIndex &index)
|
||||
|
||||
// See if we have file and line Info
|
||||
QString filePath = model()->data(index, QmlConsoleItemModel::FileRole).toString();
|
||||
const QUrl fileUrl = QUrl(filePath);
|
||||
if (fileUrl.isLocalFile())
|
||||
filePath = fileUrl.toLocalFile();
|
||||
if (!filePath.isEmpty()) {
|
||||
QFileInfo fi(filePath);
|
||||
if (fi.exists() && fi.isFile() && fi.isReadable())
|
||||
|
||||
Reference in New Issue
Block a user