diff options
Diffstat (limited to 'src/plugins/bookmarks/bookmarkmanager.cpp')
-rw-r--r-- | src/plugins/bookmarks/bookmarkmanager.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 5c53842dae..fbca8c0a72 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -42,7 +42,6 @@ #include <projectexplorer/session.h> #include <texteditor/texteditor.h> #include <utils/tooltip/tooltip.h> -#include <utils/tooltip/tipcontents.h> #include <utils/qtcassert.h> #include <utils/checkablemessagebox.h> @@ -210,17 +209,17 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti } BookmarkView::BookmarkView(BookmarkManager *manager) : - m_bookmarkContext(new Core::IContext(this)), + m_bookmarkContext(new IContext(this)), m_manager(manager) { setWindowTitle(tr("Bookmarks")); m_bookmarkContext->setWidget(this); - m_bookmarkContext->setContext(Core::Context(Constants::BOOKMARKS_CONTEXT)); + m_bookmarkContext->setContext(Context(Constants::BOOKMARKS_CONTEXT)); ICore::addContextObject(m_bookmarkContext); - Utils::ListView::setModel(manager); + ListView::setModel(manager); setItemDelegate(new BookmarkDelegate(this)); setFrameStyle(QFrame::NoFrame); @@ -290,12 +289,12 @@ void BookmarkView::keyPressEvent(QKeyEvent *event) event->accept(); return; } - Utils::ListView::keyPressEvent(event); + ListView::keyPressEvent(event); } void BookmarkView::removeAll() { - if (Utils::CheckableMessageBox::doNotAskAgainQuestion(this, + if (CheckableMessageBox::doNotAskAgainQuestion(this, tr("Remove All Bookmarks"), tr("Are you sure you want to remove all bookmarks from all files in the current session?"), ICore::settings(), @@ -324,7 +323,7 @@ BookmarkManager::BookmarkManager() : m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")), m_selectionModel(new QItemSelectionModel(this, this)) { - connect(Core::ICore::instance(), &ICore::contextChanged, + connect(ICore::instance(), &ICore::contextChanged, this, &BookmarkManager::updateActionStatus); connect(SessionManager::instance(), &SessionManager::sessionLoaded, @@ -389,7 +388,7 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const Bookmark *bookMark = m_bookmarksList.at(index.row()); if (role == BookmarkManager::Filename) - return QFileInfo(bookMark->fileName()).fileName(); + return FileName::fromString(bookMark->fileName()).fileName(); if (role == BookmarkManager::LineNumber) return bookMark->lineNumber(); if (role == BookmarkManager::Directory) @@ -422,7 +421,7 @@ QStringList BookmarkManager::mimeTypes() const QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const { - auto data = new Utils::FileDropMimeData; + auto data = new FileDropMimeData; foreach (const QModelIndex &index, indexes) { if (!index.isValid() || index.column() != 0 || index.row() < 0 || index.row() >= m_bookmarksList.count()) continue; @@ -438,7 +437,7 @@ void BookmarkManager::toggleBookmark(bool) if (!editor) return; - toggleBookmark(editor->document()->filePath(), editor->currentLine()); + toggleBookmark(editor->document()->filePath().toString(), editor->currentLine()); } void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber) @@ -556,7 +555,7 @@ void BookmarkManager::documentPrevNext(bool next) if (editorLine <= 0) return; - QFileInfo fi(editor->document()->filePath()); + const QFileInfo fi = editor->document()->filePath().toFileInfo(); if (!m_bookmarksMap.contains(fi.path())) return; @@ -647,7 +646,7 @@ BookmarkManager::State BookmarkManager::state() const if (!editor) return HasBookMarks; - const QFileInfo fi(editor->document()->filePath()); + const QFileInfo fi = editor->document()->filePath().toFileInfo(); const DirectoryFileBookmarksMap::const_iterator dit = m_bookmarksMap.constFind(fi.path()); if (dit == m_bookmarksMap.constEnd()) @@ -834,7 +833,7 @@ void BookmarkManager::operateTooltip(QWidget *widget, const QPoint &pos, Bookmar if (mark->note().isEmpty()) ToolTip::hide(); else - ToolTip::show(pos, TextContent(mark->note()), widget); + ToolTip::show(pos, mark->note(), widget); } /* Loads the bookmarks from the session settings. */ @@ -850,7 +849,7 @@ void BookmarkManager::loadBookmarks() void BookmarkManager::handleBookmarkTooltipRequest(IEditor *editor, const QPoint &pos, int line) { - Bookmark *mark = findBookmark(editor->document()->filePath(), line); + Bookmark *mark = findBookmark(editor->document()->filePath().toString(), line); operateTooltip(editor->widget(), pos, mark); } @@ -862,7 +861,7 @@ BookmarkViewFactory::BookmarkViewFactory(BookmarkManager *bm) setDisplayName(BookmarkView::tr("Bookmarks")); setPriority(300); setId("Bookmarks"); - setActivationSequence(QKeySequence(Core::UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M"))); + setActivationSequence(QKeySequence(UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M"))); } NavigationView BookmarkViewFactory::createWidget() |