diff options
| author | Tannin <devnull@localhost> | 2015-03-09 12:34:34 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-03-09 12:34:34 +0100 |
| commit | 7a1ae9b0f1560c9eda32e032796fbb3fd56ff236 (patch) | |
| tree | dea71435ac1042cb008fcd9f7b1ec57e6ea91227 /src/syncoverwritedialog.cpp | |
| parent | d45ebf134819e1559718681becca9c4139fb7151 (diff) | |
| parent | db2954e8eb41da715b9e7d79a72e225797401413 (diff) | |
Merge with branch1.2
Diffstat (limited to 'src/syncoverwritedialog.cpp')
| -rw-r--r-- | src/syncoverwritedialog.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/syncoverwritedialog.cpp b/src/syncoverwritedialog.cpp index 380719d8..0e3e98d7 100644 --- a/src/syncoverwritedialog.cpp +++ b/src/syncoverwritedialog.cpp @@ -82,18 +82,18 @@ void SyncOverwriteDialog::readTree(const QString &path, DirectoryEntry *director if (fileInfo.isDir()) {
DirectoryEntry *subDir = directoryStructure->findSubDirectory(ToWString(file));
- if (subDir != NULL) {
+ if (subDir != nullptr) {
readTree(fileInfo.absoluteFilePath(), subDir, newItem);
} else {
qCritical("no directory structure for %s?", file.toUtf8().constData());
delete newItem;
- newItem = NULL;
+ newItem = nullptr;
}
} else {
const FileEntry::Ptr entry = directoryStructure->findFile(ToWString(file));
QComboBox* combo = new QComboBox(ui->syncTree);
combo->addItem(tr("<don't sync>"), -1);
- if (entry.get() != NULL) {
+ if (entry.get() != nullptr) {
bool ignore;
int origin = entry->getOrigin(ignore);
addToComboBox(combo, ToQString(m_DirectoryStructure->getOriginByID(origin).getName()), origin);
@@ -107,7 +107,7 @@ void SyncOverwriteDialog::readTree(const QString &path, DirectoryEntry *director }
ui->syncTree->setItemWidget(newItem, 1, combo);
}
- if (newItem != NULL) {
+ if (newItem != nullptr) {
subTree->addChild(newItem);
}
}
@@ -129,7 +129,7 @@ void SyncOverwriteDialog::applyTo(QTreeWidgetItem *item, const QString &path, co QTreeWidgetItem *child = item->child(i);
QString filePath;
if (path.length() != 0) {
- filePath = path.mid(0).append("/").append(child->text(0));
+ filePath = path + "/" + child->text(0);
} else {
filePath = child->text(0);
}
@@ -137,12 +137,12 @@ void SyncOverwriteDialog::applyTo(QTreeWidgetItem *item, const QString &path, co applyTo(child, filePath, modDirectory);
} else {
QComboBox *comboBox = qobject_cast<QComboBox*>(ui->syncTree->itemWidget(child, 1));
- if (comboBox != NULL) {
+ if (comboBox != nullptr) {
int originID = comboBox->itemData(comboBox->currentIndex(), Qt::UserRole).toInt();
if (originID != -1) {
FilesOrigin &origin = m_DirectoryStructure->getOriginByID(originID);
- QString source = m_SourcePath.mid(0).append("/").append(filePath);
- QString destination = modDirectory.mid(0).append("/").append(ToQString(origin.getName())).append("/").append(filePath);
+ QString source = m_SourcePath + "/" + filePath;
+ QString destination = modDirectory + "/" + ToQString(origin.getName()) + "/" + filePath;
if (!QFile::remove(destination)) {
reportError(tr("failed to remove %1").arg(destination));
} else if (!QFile::rename(source, destination)) {
|
