summaryrefslogtreecommitdiffstats
path: root/torrentwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'torrentwidget.cpp')
-rw-r--r--torrentwidget.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp
index a2ba78f..ec83424 100644
--- a/torrentwidget.cpp
+++ b/torrentwidget.cpp
@@ -179,7 +179,7 @@ void TorrentWidget::gatherData(){
mModel->setHorizontalHeaderLabels(QStringList() << QChar(0x26A7) << tr("Name") << tr("Created"));
QBrush redBrush(Qt::red);
QBrush greenBrush(Qt::darkGreen);
- for(QFileInfo fi : fl){
+ for(const auto &fi : fl){
QList<QStandardItem*> fData;
for(int i = 0; i < ColumnCount; ++i){
QStandardItem *item = new QStandardItem;
@@ -244,7 +244,7 @@ void TorrentWidget::deleteFiles(){
mModel->removeRow(res.at(0)->row());
}
}
- QString msg = QString(tr("Successfully deleted %1 of %2 file(s)")).arg(QString::number(ctr)).arg(QString::number(sel.count()));
+ QString msg = QString(tr("Successfully deleted %1 of %2 file(s)")).arg(QString::number(ctr), QString::number(sel.count()));
emit statusMessage(msg);
emit freeSpaceChanged(mDir->text());
}
@@ -264,7 +264,7 @@ void TorrentWidget::moveFiles(){
QStringList removed;
for(const QModelIndex &i : sel){
QFileInfo fp(i.data(FullPathRole).toString());
- QString newfn = QString("%1/%2").arg(dir).arg(fp.fileName());
+ QString newfn = QString("%1/%2").arg(dir, fp.fileName());
bool ok = QFile::rename(fp.absoluteFilePath(), newfn);
if(ok){
++ctr;
@@ -284,7 +284,7 @@ void TorrentWidget::moveFiles(){
mModel->removeRow(res.at(0)->row());
}
}
- QString msg = QString(tr("Successfully moved %1 of %2 file(s)")).arg(QString::number(ctr)).arg(QString::number(sel.count()));
+ QString msg = QString(tr("Successfully moved %1 of %2 file(s)")).arg(QString::number(ctr), QString::number(sel.count()));
emit statusMessage(msg);
emit freeSpaceChanged(mDir->text());
}
@@ -317,7 +317,7 @@ void TorrentWidget::searchFile(){
emit statusMessage(QString(tr("parsing %1").arg(fn)));
QList<QVariant> torrentData = p.parse();
QStringList files = p.files(torrentData);
- for(QString f : files){
+ for(const auto &f : files){
QRegularExpressionMatch m = regex.match(f);
if(m.hasMatch()){
++success;
@@ -391,7 +391,7 @@ void TorrentWidget::fileSelectionChanged(const QItemSelection &selected, const Q
Q_UNUSED(deselected);
int count = mFileView->selectionModel()->selectedRows().count();
int total = mModel->rowCount();
- QString msg = QString("%1/%2").arg(QString::number(count)).arg(QString::number(total));
+ QString msg = QString("%1/%2").arg(QString::number(count), QString::number(total));
emit selectionCountChanged(msg);
}
@@ -445,7 +445,7 @@ void TorrentWidget::rememberSelection(){
void TorrentWidget::restoreSelection(){
QList<QStandardItem*> modelItems;
- for(QString sel : mSelection){
+ for(const auto &sel : mSelection){
modelItems << mModel->findItems(sel, Qt::MatchExactly, NameColumn);
}
for(QStandardItem *i : modelItems){