Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Deprecated/Obsolete 'midRef' and 'fromTime_t' #1772

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/BookmarksManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ BookmarksModel::Bookmark* BookmarksManager::getBookmark(const QString &text)

if (text.startsWith(QLatin1Char('#')))
{
return m_model->getBookmark(text.midRef(1).toULongLong());
return m_model->getBookmark(text.mid(1).toULongLong());
}

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

return m_model->getBookmarkByKeyword(text);
Expand Down
2 changes: 1 addition & 1 deletion src/core/BookmarksModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ BookmarksModel::Bookmark* BookmarksModel::getBookmarkByPath(const QString &path,

if (path.startsWith(QLatin1Char('#')))
{
return getBookmark(path.midRef(1).toULongLong());
return getBookmark(path.mid(1).toULongLong());
}

Bookmark *bookmark(m_rootItem);
Expand Down
2 changes: 1 addition & 1 deletion src/core/InputInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ InputInterpreter::InterpreterResult InputInterpreter::interpret(const QString &t

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

if (bookmark)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/NetworkAutomaticProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int PacUtils::dnsDomainLevels(const QString &host) const
{
if (host.startsWith(QLatin1String("www."), Qt::CaseInsensitive))
{
return host.midRef(4).count(QLatin1Char('.'));
return host.mid(4).count(QLatin1Char('.'));
}

return host.count(QLatin1Char('.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ void OperaBookmarksImportJob::start()
}
else if (line.startsWith(QLatin1String("\tCREATED=")))
{
bookmark->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole);
bookmark->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole);
}
else if (line.startsWith(QLatin1String("\tVISITED=")))
{
bookmark->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeVisitedRole);
bookmark->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeVisitedRole);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bool OperaNotesImportDataExchanger::importData(const QString &path)
}
else if (line.startsWith(QLatin1String("\tCREATED=")))
{
note->setData(QDateTime::fromTime_t(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole);
note->setData(QDateTime::fromSecsSinceEpoch(line.section(QLatin1Char('='), 1, -1).toUInt()), BookmarksModel::TimeAddedRole);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/ToolBarDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void ToolBarDialog::editEntry()
}
else if (identifier.startsWith(QLatin1String("bookmarks:")))
{
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.midRef(10).toULongLong()));
const BookmarksModel::Bookmark *bookmark(identifier.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(identifier.mid(11)) : BookmarksManager::getBookmark(identifier.mid(10).toULongLong()));

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

if (bookmark)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/WidgetFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ QWidget* createToolBarItem(const ToolBarsManager::ToolBarDefinition::Entry &defi

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

if (bookmark)
{
Expand Down