summaryrefslogtreecommitdiff
path: root/src/plugins/bookmarks
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-05-28 13:49:26 +0200
committerhjk <hjk@qt.io>2019-05-28 12:23:26 +0000
commit473a741c9fcf09febba312464fab8385e2351181 (patch)
tree2d328a090993cb5c5fd34b43e9468bcbf7e4d4d0 /src/plugins/bookmarks
parent4704f49fbb1201ebf10ab9dbaed0275ff25faba8 (diff)
downloadqt-creator-473a741c9fcf09febba312464fab8385e2351181.tar.gz
Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/bookmarks')
-rw-r--r--src/plugins/bookmarks/bookmark.cpp6
-rw-r--r--src/plugins/bookmarks/bookmark.h2
-rw-r--r--src/plugins/bookmarks/bookmarkmanager.cpp16
-rw-r--r--src/plugins/bookmarks/bookmarkmanager.h10
-rw-r--r--src/plugins/bookmarks/bookmarksplugin.cpp2
5 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp
index cf591035d7..1e5d0d2c0d 100644
--- a/src/plugins/bookmarks/bookmark.cpp
+++ b/src/plugins/bookmarks/bookmark.cpp
@@ -37,7 +37,7 @@ using namespace Bookmarks::Internal;
using namespace Utils;
Bookmark::Bookmark(int lineNumber, BookmarkManager *manager) :
- TextMark(FileName(), lineNumber, Constants::BOOKMARKS_TEXT_MARK_CATEGORY),
+ TextMark(FilePath(), lineNumber, Constants::BOOKMARKS_TEXT_MARK_CATEGORY),
m_manager(manager)
{
setColor(Utils::Theme::Bookmarks_TextMarkColor);
@@ -87,9 +87,9 @@ void Bookmark::updateBlock(const QTextBlock &block)
}
}
-void Bookmark::updateFileName(const FileName &fileName)
+void Bookmark::updateFileName(const FilePath &fileName)
{
- const FileName &oldFileName = this->fileName();
+ const FilePath &oldFileName = this->fileName();
TextMark::updateFileName(fileName);
m_manager->updateBookmarkFileName(this, oldFileName.toString());
}
diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h
index 1dceba433c..b6d3cef26c 100644
--- a/src/plugins/bookmarks/bookmark.h
+++ b/src/plugins/bookmarks/bookmark.h
@@ -40,7 +40,7 @@ public:
void updateLineNumber(int lineNumber) override;
void move(int line) override;
void updateBlock(const QTextBlock &block) override;
- void updateFileName(const Utils::FileName &fileName) override;
+ void updateFileName(const Utils::FilePath &fileName) override;
void removedFromEditor() override;
bool isDraggable() const override;
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp
index 21ed0e7090..89bb911de7 100644
--- a/src/plugins/bookmarks/bookmarkmanager.cpp
+++ b/src/plugins/bookmarks/bookmarkmanager.cpp
@@ -331,7 +331,7 @@ QItemSelectionModel *BookmarkManager::selectionModel() const
return m_selectionModel;
}
-bool BookmarkManager::hasBookmarkInPosition(const Utils::FileName &fileName, int lineNumber)
+bool BookmarkManager::hasBookmarkInPosition(const Utils::FilePath &fileName, int lineNumber)
{
return findBookmark(fileName, lineNumber);
}
@@ -414,7 +414,7 @@ QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const
return data;
}
-void BookmarkManager::toggleBookmark(const FileName &fileName, int lineNumber)
+void BookmarkManager::toggleBookmark(const FilePath &fileName, int lineNumber)
{
if (lineNumber <= 0 || fileName.isEmpty())
return;
@@ -450,7 +450,7 @@ void BookmarkManager::updateBookmarkFileName(Bookmark *bookmark, const QString &
if (oldFileName == bookmark->fileName().toString())
return;
- m_bookmarksMap[Utils::FileName::fromString(oldFileName)].removeAll(bookmark);
+ m_bookmarksMap[Utils::FilePath::fromString(oldFileName)].removeAll(bookmark);
m_bookmarksMap[bookmark->fileName()].append(bookmark);
updateBookmark(bookmark);
}
@@ -517,7 +517,7 @@ void BookmarkManager::documentPrevNext(bool next)
if (editorLine <= 0)
return;
- const FileName filePath = editor->document()->filePath();
+ const FilePath filePath = editor->document()->filePath();
if (!m_bookmarksMap.contains(filePath))
return;
@@ -664,7 +664,7 @@ void BookmarkManager::moveDown()
saveBookmarks();
}
-void BookmarkManager::editByFileAndLine(const FileName &fileName, int lineNumber)
+void BookmarkManager::editByFileAndLine(const FilePath &fileName, int lineNumber)
{
Bookmark *b = findBookmark(fileName, lineNumber);
QModelIndex current = selectionModel()->currentIndex();
@@ -703,7 +703,7 @@ void BookmarkManager::edit()
}
/* Returns the bookmark at the given file and line number, or 0 if no such bookmark exists. */
-Bookmark *BookmarkManager::findBookmark(const FileName &filePath, int lineNumber)
+Bookmark *BookmarkManager::findBookmark(const FilePath &filePath, int lineNumber)
{
return Utils::findOrDefault(m_bookmarksMap.value(filePath),
Utils::equal(&Bookmark::lineNumber, lineNumber));
@@ -749,9 +749,9 @@ void BookmarkManager::addBookmark(const QString &s)
const QString &filePath = s.mid(index1+1, index2-index1-1);
const QString &note = s.mid(index3 + 1);
const int lineNumber = s.midRef(index2 + 1, index3 - index2 - 1).toInt();
- if (!filePath.isEmpty() && !findBookmark(FileName::fromString(filePath), lineNumber)) {
+ if (!filePath.isEmpty() && !findBookmark(FilePath::fromString(filePath), lineNumber)) {
auto b = new Bookmark(lineNumber, this);
- b->updateFileName(FileName::fromString(filePath));
+ b->updateFileName(FilePath::fromString(filePath));
b->setNote(note);
addBookmark(b, false);
}
diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h
index c1cbef10f3..24ff63742b 100644
--- a/src/plugins/bookmarks/bookmarkmanager.h
+++ b/src/plugins/bookmarks/bookmarkmanager.h
@@ -77,7 +77,7 @@ public:
// this QItemSelectionModel is shared by all views
QItemSelectionModel *selectionModel() const;
- bool hasBookmarkInPosition(const Utils::FileName &fileName, int lineNumber);
+ bool hasBookmarkInPosition(const Utils::FilePath &fileName, int lineNumber);
enum Roles {
Filename = Qt::UserRole,
@@ -87,7 +87,7 @@ public:
Note = Qt::UserRole + 4
};
- void toggleBookmark(const Utils::FileName &fileName, int lineNumber);
+ void toggleBookmark(const Utils::FilePath &fileName, int lineNumber);
void nextInDocument();
void prevInDocument();
void next();
@@ -95,7 +95,7 @@ public:
void moveUp();
void moveDown();
void edit();
- void editByFileAndLine(const Utils::FileName &fileName, int lineNumber);
+ void editByFileAndLine(const Utils::FilePath &fileName, int lineNumber);
bool gotoBookmark(const Bookmark *bookmark) const;
signals:
@@ -109,14 +109,14 @@ private:
void documentPrevNext(bool next);
- Bookmark *findBookmark(const Utils::FileName &filePath, int lineNumber);
+ Bookmark *findBookmark(const Utils::FilePath &filePath, int lineNumber);
void insertBookmark(int index, Bookmark *bookmark, bool userset = true);
void addBookmark(Bookmark *bookmark, bool userset = true);
void addBookmark(const QString &s);
static QString bookmarkToString(const Bookmark *b);
void saveBookmarks();
- QMap<Utils::FileName, QVector<Bookmark *>> m_bookmarksMap;
+ QMap<Utils::FilePath, QVector<Bookmark *>> m_bookmarksMap;
QList<Bookmark *> m_bookmarksList;
QItemSelectionModel *m_selectionModel;
diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp
index dcba2a66d1..06eb6b49c9 100644
--- a/src/plugins/bookmarks/bookmarksplugin.cpp
+++ b/src/plugins/bookmarks/bookmarksplugin.cpp
@@ -79,7 +79,7 @@ public:
QAction m_bookmarkMarginAction{BookmarksPlugin::tr("Toggle Bookmark"), nullptr};
int m_marginActionLineNumber = 0;
- Utils::FileName m_marginActionFileName;
+ Utils::FilePath m_marginActionFileName;
};
BookmarksPlugin::~BookmarksPlugin()