diff options
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); |