From 1072b045a4aca7b87c51355370c994303a9621f6 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 24 Mar 2012 12:34:46 +0100 Subject: Indictate slide in status bar Show red or green icon in status bar, depending on wether we're sliding. Removed the rename to template stuff. It was barely used code. Hopefully deleted all references and code fragments. --- filesystemwidget.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'filesystemwidget.cpp') diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index e86db07..1592d13 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -294,46 +294,6 @@ void FilesystemWidget::renameFile(){ mFileView->edit(curIdx); } -void FilesystemWidget::renameCover(const QString &infix){ - if(mTemplate.isEmpty()){ - emit statusbarMessage(tr("No template set!")); - return; - } - QModelIndex idx = mFileView->currentIndex(); - QSortFilterProxyModel *proxy = static_cast(mFileView->model()); - QModelIndex real = proxy->mapToSource(idx); - QFileInfo info = mModel->fileInfo(real); - QString newFilename = QString("%1/%2.%3.%4").arg(info.absolutePath()).arg(mTemplate).arg(infix).arg(info.suffix()); - QFileInfo nf(newFilename); - if(nf.exists()){ - QString message = QString(tr("New file %1 already exists!")).arg(newFilename); - statusbarMessage(message); - return; - } - QString question = QString(tr("Really rename %1 to %2?")).arg(info.absoluteFilePath()).arg(nf.fileName()); - int retval = QMessageBox::question(this, tr("Question"), question, QMessageBox::Yes | QMessageBox::No); - if(retval == QMessageBox::Yes){ - if(QFile::rename(info.absoluteFilePath(), newFilename)){ - QString message = QString(tr("Successfully renamed %1 to %2")).arg(info.fileName()).arg(nf.fileName()); - emit statusbarMessage(message); - }else{ - QString message = QString(tr("Failed to rename %1 to %2")).arg(info.fileName()).arg(nf.fileName()); - emit statusbarMessage(message); - } - } -} - -void FilesystemWidget::setTemplate(){ - QModelIndex idx = mFileView->currentIndex(); - if(idx.column() != 0){ - idx = mFileView->model()->index(idx.row(), 0); - } - //since we only need the filename, no need to map it to anything! - QFileInfo info(idx.data().toString()); - mTemplate = info.completeBaseName().toLower(); - emit newTemplate(mTemplate); -} - void FilesystemWidget::playSelected(const QString &player){ QStringList files = selectedFiles(); if(files.isEmpty()){ -- cgit v1.2.3-70-g09d2