Skip to content

Commit e963342

Browse files
ChiitooEmdek
authored andcommitted
core/ui: use 'mid' instead if 'midRef'
Required for Qt 6, where 'midRef' has been removed from QString, and 'mid' can already be used with Qt 5. Picked from: #1770
1 parent 2cd2925 commit e963342

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/core/BookmarksManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ BookmarksModel::Bookmark* BookmarksManager::getBookmark(const QString &text)
158158

159159
if (text.startsWith(QLatin1Char('#')))
160160
{
161-
return m_model->getBookmark(text.midRef(1).toULongLong());
161+
return m_model->getBookmark(text.mid(1).toULongLong());
162162
}
163163

164164
if (text.startsWith(QLatin1String("bookmarks:")))
165165
{
166-
return (text.startsWith(QLatin1String("bookmarks:/")) ? m_model->getBookmarkByPath(text.mid(11)) : getBookmark(text.midRef(10).toULongLong()));
166+
return (text.startsWith(QLatin1String("bookmarks:/")) ? m_model->getBookmarkByPath(text.mid(11)) : getBookmark(text.mid(10).toULongLong()));
167167
}
168168

169169
return m_model->getBookmarkByKeyword(text);

src/core/BookmarksModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ BookmarksModel::Bookmark* BookmarksModel::getBookmarkByPath(const QString &path,
11691169

11701170
if (path.startsWith(QLatin1Char('#')))
11711171
{
1172-
return getBookmark(path.midRef(1).toULongLong());
1172+
return getBookmark(path.mid(1).toULongLong());
11731173
}
11741174

11751175
Bookmark *bookmark(m_rootItem);

src/core/InputInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ InputInterpreter::InterpreterResult InputInterpreter::interpret(const QString &t
7171

7272
if (text.startsWith(QLatin1String("bookmarks:")))
7373
{
74-
BookmarksModel::Bookmark *bookmark(text.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(text.mid(11)) : BookmarksManager::getBookmark(text.midRef(10).toULongLong()));
74+
BookmarksModel::Bookmark *bookmark(text.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(text.mid(11)) : BookmarksManager::getBookmark(text.mid(10).toULongLong()));
7575

7676
if (bookmark)
7777
{

src/core/NetworkAutomaticProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int PacUtils::dnsDomainLevels(const QString &host) const
7878
{
7979
if (host.startsWith(QLatin1String("www."), Qt::CaseInsensitive))
8080
{
81-
return host.midRef(4).count(QLatin1Char('.'));
81+
return host.mid(4).count(QLatin1Char('.'));
8282
}
8383

8484
return host.count(QLatin1Char('.'));

src/ui/ToolBarDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void ToolBarDialog::editEntry()
445445
}
446446
else if (identifier.startsWith(QLatin1String("bookmarks:")))
447447
{
448-
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.midRef(10).toULongLong()));
448+
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.mid(10).toULongLong()));
449449

450450
if (bookmark)
451451
{
@@ -791,7 +791,7 @@ QMap<int, QVariant> ToolBarDialog::createEntryData(const QString &identifier, co
791791
}
792792
else if (identifier.startsWith(QLatin1String("bookmarks:")))
793793
{
794-
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.midRef(10).toULongLong()));
794+
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.mid(10).toULongLong()));
795795

796796
if (bookmark)
797797
{

src/ui/WidgetFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ QWidget* createToolBarItem(const ToolBarsManager::ToolBarDefinition::Entry &defi
164164

165165
if (definition.action.startsWith(QLatin1String("bookmarks:")))
166166
{
167-
BookmarksModel::Bookmark *bookmark(definition.action.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(definition.action.mid(11)) : BookmarksManager::getBookmark(definition.action.midRef(10).toULongLong()));
167+
BookmarksModel::Bookmark *bookmark(definition.action.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(definition.action.mid(11)) : BookmarksManager::getBookmark(definition.action.mid(10).toULongLong()));
168168

169169
if (bookmark)
170170
{

0 commit comments

Comments
 (0)