summaryrefslogtreecommitdiffstats
path: root/copydialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'copydialog.cpp')
-rw-r--r--copydialog.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/copydialog.cpp b/copydialog.cpp
index 38a5b9f..f16fda0 100644
--- a/copydialog.cpp
+++ b/copydialog.cpp
@@ -81,6 +81,26 @@ void CopyDialog::setDestFolder(const QString &dst){
void CopyDialog::setSources(const QStringList &sources){
mSources = sources;
+ refresh();
+}
+
+void CopyDialog::refresh(){
+ QString res;
+ for(const QString &p : mSources){
+ res.append(QString("%1 %2\n").arg(QChar(0x2b9a)).arg(p));
+ res.append(QString("%1 %2\n").arg(QChar(0x2b98)).arg(getDestinationFile(p)));
+ }
+ mResultL->setText(res);
+}
+
+QString CopyDialog::getDestinationFile(const QString &srcFn){
+ QFileInfo fi(srcFn);
+ if(fi.exists()){
+ QString fn = fi.fileName();
+ QString destPath = QString("%1/%2/%3").arg(mDstE->text()).arg(mFolderE->text()).arg(fn);
+ return destPath;
+ }
+ return QString();
}
void CopyDialog::closeEvent(QCloseEvent *e){