diff options
author | Arno <arno@disconnect.de> | 2022-04-16 02:20:43 +0200 |
---|---|---|
committer | Arno <arno@d-tor.org> | 2022-04-16 05:05:19 +0200 |
commit | a354d3cfc491f34107d712de4f4216f1e4f35098 (patch) | |
tree | 116085717f4cdefb41f926e12ed225c05327cd3e /torrentwidget.cpp | |
parent | 980f94e493c349c6c86f1b3d05753ce3cfba38d8 (diff) | |
download | ShemovCleaner-a354d3cfc491f34107d712de4f4216f1e4f35098.tar.gz ShemovCleaner-a354d3cfc491f34107d712de4f4216f1e4f35098.tar.bz2 ShemovCleaner-a354d3cfc491f34107d712de4f4216f1e4f35098.zip |
Make it compile with qt6
*BIG FAT WARNING*
Took me a while to figure it out, but the database connection only works
with MINGW64 instead of MINGW32! With the latter loading the SQL Plugin
fails! That said, off to brighter shores :)
Diffstat (limited to 'torrentwidget.cpp')
-rw-r--r-- | torrentwidget.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp index a118df1..a2ba78f 100644 --- a/torrentwidget.cpp +++ b/torrentwidget.cpp @@ -20,7 +20,7 @@ #include <QMenuBar> #include <QClipboard> #include <QCompleter> -#include <QDirModel> +#include <QFileSystemModel> #include <QProgressBar> #include <QApplication> @@ -42,7 +42,7 @@ TorrentWidget::~TorrentWidget(){ void TorrentWidget::setupGui(){ mDir = new QLineEdit; QCompleter *torDirCompl = new QCompleter(this); - torDirCompl->setModel(new QDirModel(torDirCompl)); + torDirCompl->setModel(new QFileSystemModel(torDirCompl)); mDir->setCompleter(torDirCompl); connect(mDir, &QLineEdit::returnPressed, this, &TorrentWidget::setDir); @@ -107,7 +107,7 @@ void TorrentWidget::createActions(){ mMoveA->setShortcut(tr("CTRL+M")); connect(mMoveA, &QAction::triggered, this, &TorrentWidget::moveFiles); mTorrentInfoA = new QAction(QIcon(":/huge_bra.png"), tr("Torrent Info..."), this); - mTorrentInfoA->setShortcut(Qt::CTRL + Qt::Key_Return); + mTorrentInfoA->setShortcut(Qt::CTRL | Qt::Key_Return); connect(mTorrentInfoA, &QAction::triggered, this, &TorrentWidget::torrentInfo); mSelDirA = new QAction(QIcon(":/folder.png"), tr("Select folder..."), this); mSelDirA->setShortcut(tr("CTRL+O")); @@ -406,19 +406,17 @@ void TorrentWidget::guessSubtitle(){ QModelIndex cur = mFileView->selectionModel()->currentIndex(); QClipboard *clip = QApplication::clipboard(); QString curName = cur.data().toString().toLower(); - QRegExp re1(" *\\[.*\\] *"); - re1.setMinimal(true); + QRegularExpression re1(" *\\[.*\\] *", QRegularExpression::InvertedGreedinessOption); curName.replace(re1, ""); - QRegExp re2(" *\\(.*\\) *"); - re2.setMinimal(true); + QRegularExpression re2(" *\\(.*\\) *", QRegularExpression::InvertedGreedinessOption); curName.replace(re2, ""); - QRegExp re3("\\s+"); + QRegularExpression re3("\\s+"); curName.replace(re3, " "); curName.replace(".torrent", ""); curName = curName.trimmed(); - QRegExp re4("^shemale\\s*-*"); + QRegularExpression re4("^shemale\\s*-*"); curName.replace(re4, ""); - QRegExp re5("(\\.mp\\d|rq|\\s*720p|\\s*1080p)"); + QRegularExpression re5("(\\.mp\\d|rq|\\s*720p|\\s*1080p)"); curName.replace(re5, ""); curName = curName.trimmed(); clip->setText(curName); |