diff --git a/share/qtcreator/translations/translations.pro b/share/qtcreator/translations/translations.pro index 6fda4f73fd72790470a5edfd01eface2581c1d73..913f8f6eb5580157ff2ed4b1bb6e75d52684d14d 100644 --- a/share/qtcreator/translations/translations.pro +++ b/share/qtcreator/translations/translations.pro @@ -1,6 +1,6 @@ include(../../../qtcreator.pri) -TRANSLATIONS = de it ja ru +LANGUAGES = de it ja ru # var, prepend, append defineReplace(prependAll) { @@ -11,10 +11,10 @@ defineReplace(prependAll) { LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease) -TS_FILES = $$prependAll(TRANSLATIONS, $$PWD/qtcreator_,.ts) +TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts) contains(QT_VERSION, ^4\.[0-5]\..*):ts.commands = @echo This Qt version is too old for the ts target. Need Qt 4.6+. -else:ts.commands = (cd $$IDE_SOURCE_TREE && $$LUPDATE src -ts $$TS_FILES) +else:ts.commands = (cd $$IDE_SOURCE_TREE && $$LUPDATE src -ts $$TRANSLATIONS) QMAKE_EXTRA_TARGETS += ts TEMPLATE = app @@ -23,7 +23,7 @@ CONFIG -= qt QT = LIBS = -updateqm.input = TS_FILES +updateqm.input = TRANSLATIONS updateqm.output = $$IDE_DATA_PATH/translations/${QMAKE_FILE_BASE}.qm isEmpty(vcproj):updateqm.variable_out = PRE_TARGETDEPS updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} @@ -47,6 +47,6 @@ isEmpty(vcproj) { QMAKE_EXTRA_COMPILERS += phony_src } -qmfiles.files = $$prependAll(TRANSLATIONS, $$OUT_PWD/qtcreator_,.qm) +qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/qtcreator_,.qm) qmfiles.path = /share/qtcreator/translations INSTALLS += qmfiles diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 592cddb776e9725c899339673aa756010ad48ccb..4b84abe8dac3b84081f69d5ffd93cbf886baab90 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -321,42 +321,6 @@ void EditorModel::itemChanged() } -class EditorProxyModel : public QSortFilterProxyModel -{ - EditorView *m_view; - EditorModel *m_model; -public: - EditorProxyModel(EditorModel *source, EditorView *view) - : QSortFilterProxyModel(view), m_view(view), m_model(source) { - setSourceModel(source); - - } - - QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const - { - QVariant variant = QSortFilterProxyModel::data(proxyIndex, role); - if (role == Qt::FontRole) { - if (IEditor *editor = m_model->editorAt(proxyIndex.row()) ) { - if (m_view->hasEditor(editor)) { - QFont font = m_view->font(); - font.setBold(true); - return font; - } - foreach (IEditor *duplicate, m_model->duplicatesFor(editor)) { - if (duplicate&& m_view->hasEditor(duplicate)) { - QFont font = m_view->font(); - font.setBold(true); - return font; - } - } - } - } - return QSortFilterProxyModel::data(proxyIndex, role); - } - -}; - - //================EditorView==================== @@ -378,15 +342,13 @@ EditorView::EditorView(EditorModel *model, QWidget *parent) : tl->setSpacing(0); tl->setMargin(0); { - QAbstractItemModel *itemModel = m_model; - if (!itemModel) { + if (!m_model) { m_model = CoreImpl::instance()->editorManager()->openedEditorsModel(); - itemModel = new EditorProxyModel(m_model, this); } m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_editorList->setMinimumContentsLength(20); - m_editorList->setModel(itemModel); + m_editorList->setModel(m_model); m_editorList->setMaxVisibleItems(40); QToolBar *editorListToolBar = new QToolBar; @@ -601,8 +563,8 @@ void EditorView::removeEditor(IEditor *editor) toolBar->setVisible(false); toolBar->setParent(0); } - if (wasCurrent && m_editors.count()) - setCurrentEditor(m_editors.last()); + if (wasCurrent) + setCurrentEditor(m_editors.count() ? m_editors.last() : 0); } IEditor *EditorView::currentEditor() const @@ -615,9 +577,10 @@ IEditor *EditorView::currentEditor() const void EditorView::setCurrentEditor(IEditor *editor) { if (!editor || m_container->count() <= 0 - || m_container->indexOf(editor->widget()) == -1) + || m_container->indexOf(editor->widget()) == -1) { // ### TODO the combo box m_editorList should show an empty item return; + } m_editors.removeAll(editor); m_editors.append(editor); diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 06773cf535d6c35fc6a9f650c53ac88fbe720665..32026d0f413b8f71af7db3251528031eb73443c6 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -114,7 +114,6 @@ private: }; - class EditorView : public QWidget { Q_OBJECT @@ -175,7 +174,6 @@ private: QFrame *m_statusWidget; QLabel *m_statusWidgetLabel; QToolButton *m_statusWidgetButton; - QSortFilterProxyModel m_proxyModel; QList<IEditor *> m_editors; QMap<QWidget *, IEditor *> m_widgetEditorMap; }; @@ -233,8 +231,6 @@ private: QSplitter *m_splitter; }; - - } } #endif // EDITORVIEW_H diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index 4ef00b5934140c3d164f8965a7ff0c6d90880655..e63a3d28a12d29499c8fb20b3808c3d4a135f706 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -62,7 +62,6 @@ OpenEditorsDelegate::OpenEditorsDelegate(QObject *parent) void OpenEditorsDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (option.state & QStyle::State_MouseOver) { if ((QApplication::mouseButtons() & Qt::LeftButton) == 0) pressedIndex = QModelIndex(); @@ -72,6 +71,7 @@ void OpenEditorsDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o painter->fillRect(option.rect, brush); } + QStyledItemDelegate::paint(painter, option, index); if (index.column() == 1 && option.state & QStyle::State_MouseOver) { diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index e79e617310c98e54fc7e5e6f9afe696f0aeb55e1..53be7c83acbe090d4bc9d89c76fc177ce4b49c31 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -4208,8 +4208,8 @@ void BaseTextEditorEditable::updateCursorPosition() const QTextCursor cursor = e->textCursor(); const QTextBlock block = cursor.block(); const int line = block.blockNumber() + 1; - const int column = cursor.position() - block.position() + 1; - m_cursorPositionLabel->setText(tr("Line: %1, Col: %2").arg(line).arg(column), + const int column = cursor.position() - block.position(); + m_cursorPositionLabel->setText(tr("Line: %1, Col: %2").arg(line).arg(e->tabSettings().columnAt(block.text(), column)+1), tr("Line: %1, Col: 999").arg(e->blockCount())); m_contextHelpId.clear();