mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Log.copied files in copy config component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
88f9a4d04a
commit
b13eb16d51
@@ -29,6 +29,12 @@ namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
const CLogCategoryList &CCopyConfigurationComponent::getLogCategories()
|
||||
{
|
||||
static const BlackMisc::CLogCategoryList cats { CLogCategory::guiComponent() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
CCopyConfigurationComponent::CCopyConfigurationComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CCopyConfigurationComponent)
|
||||
@@ -81,10 +87,12 @@ namespace BlackGui
|
||||
const QDir destination(destinationDir);
|
||||
if (!destination.exists()) { return 0; }
|
||||
|
||||
// init model caches if applicable
|
||||
// init model caches if applicable (.rev file entries)
|
||||
this->initModelCaches(files);
|
||||
|
||||
int c = 0;
|
||||
QStringList copied;
|
||||
QStringList skipped;
|
||||
for (const QString &file : files)
|
||||
{
|
||||
const QString relativePath = source.relativeFilePath(file);
|
||||
@@ -97,7 +105,27 @@ namespace BlackGui
|
||||
}
|
||||
QFile::remove(target); // copy does not overwrite
|
||||
const bool s = QFile::copy(file, target);
|
||||
if (s) { c++; }
|
||||
if (s)
|
||||
{
|
||||
c++;
|
||||
copied << target;
|
||||
}
|
||||
else
|
||||
{
|
||||
skipped << target;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_logCopiedFiles)
|
||||
{
|
||||
if (!copied.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info("Copied %1 files, list: '%2'") << copied.size() << copied.join(", ");
|
||||
}
|
||||
if (!skipped.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info("Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", ");
|
||||
}
|
||||
}
|
||||
|
||||
// bye
|
||||
@@ -318,6 +346,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
const CLogCategoryList &CCopyConfigurationWizardPage::getLogCategories()
|
||||
{
|
||||
static const BlackMisc::CLogCategoryList cats { CLogCategory::wizard(), CLogCategory::guiComponent() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
void CCopyConfigurationWizardPage::initializePage()
|
||||
{
|
||||
Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config");
|
||||
|
||||
Reference in New Issue
Block a user