Commit b4fac2b9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Clean up treewidget

parent 60b81df3
......@@ -110,6 +110,11 @@ QString SelectionTypeDialog::exportedFileInfo()
return mSelectionTreeWidget->exportedFileInfo();
}
void SelectionTypeDialog::removeNotSelectedItems()
{
mSelectionTreeWidget->removeNotSelectedItems();
}
void SelectionTypeDialog::loadTemplate(const QString &fileName)
{
if (!fileName.isEmpty()) {
......
......@@ -36,6 +36,7 @@ public:
void loadTemplate(const QString &fileName);
QString exportedFileInfo();
void removeNotSelectedItems();
private Q_SLOTS:
void slotSelectAll();
void slotUnselectAll();
......
......@@ -369,14 +369,19 @@ void PimSettingExporterWindow::loadData(const QString &filename, const QString &
// Don't put it in 'if' otherwise temporary file will be removed after that.
QString templateFileName;
PimSettingImportDataInfoFile dataInfo;
bool cleanupItems = false;
if (templateFile.isEmpty()) {
dataInfo.setCurrentFileName(currentFileName);
templateFileName = dataInfo.importDataInfoPath();
cleanupItems = true;
} else {
templateFileName = templateFile;
}
QPointer<SelectionTypeDialog> dialog = new SelectionTypeDialog(this);
dialog->loadTemplate(templateFileName);
if (cleanupItems) {
dialog->removeNotSelectedItems();
}
if (dialog->exec()) {
mLogWidget->clear();
mNeedToSyncResources.clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment