Bookmarks: Make sure we do not end up with empty filenames

... in the bookmarks. The actions should all be disabled if that
is the case, but better safe than sorry (e.g. when a temporary
document is not marked up as such).

Change-Id: I131a870dc30258a8bca3fc57edb4692292ccb2de
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-09-16 16:38:56 +02:00
parent 482b395926
commit 4aa8374dde

View File

@@ -438,7 +438,7 @@ QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const
void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber) void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
{ {
if (lineNumber <= 0) if (lineNumber <= 0 || fileName.isEmpty())
return; return;
// Remove any existing bookmark on this line // Remove any existing bookmark on this line