mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Formatting, style
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <QFileSystemModel>
|
||||
#include <QDir>
|
||||
#include <QDesktopServices>
|
||||
#include <QPointer>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -246,7 +247,6 @@ namespace BlackGui
|
||||
destinationModel->setNameFilters(this->getSourceFileFilter());
|
||||
destinationModel->setNameFilterDisables(m_nameFilterDisables);
|
||||
|
||||
|
||||
// source
|
||||
const QString sourceDir = this->getOtherVersionsSelectedDirectory();
|
||||
if (!sourceModel || m_initializedSourceDir != sourceDir)
|
||||
@@ -399,8 +399,8 @@ namespace BlackGui
|
||||
void CCopyConfigurationComponent::initMultiSimulatorCache(IMultiSimulatorModelCaches *cache, const QString &fileName)
|
||||
{
|
||||
const CSimulatorInfo info = cache->getSimulatorForFilename(fileName);
|
||||
if (info.isNoSimulator()) return;
|
||||
if (cache->isSaved(info)) return; // already a file and hence in .rev
|
||||
if (info.isNoSimulator()) { return; }
|
||||
if (cache->isSaved(info)) { return; } // already a file and hence in .rev
|
||||
const QFileInfo fi(fileName);
|
||||
const CStatusMessage msg = cache->setCacheTimestamp(fi.lastModified(), info); // create cache file and timestamp in .rev
|
||||
if (msg.isFailure())
|
||||
@@ -412,13 +412,14 @@ namespace BlackGui
|
||||
void CCopyConfigurationComponent::initOtherSwiftVersions()
|
||||
{
|
||||
ui->cb_OtherVersions->clear();
|
||||
const QMap<QString, CApplicationInfo> otherVersions = CDirectoryUtils::applicationDataDirectoryMap(true);
|
||||
const QMap<QString, CApplicationInfo> otherVersions = CDirectoryUtils::applicationDataDirectoryMapWithoutCurrentVersion();
|
||||
for (const QString &directory : otherVersions.keys())
|
||||
{
|
||||
const CApplicationInfo info(otherVersions.value(directory));
|
||||
if (info.isNull())
|
||||
{
|
||||
ui->cb_OtherVersions->addItem(CDirectoryUtils::decodeNormalizedDirectory(directory));
|
||||
const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(directory);
|
||||
ui->cb_OtherVersions->addItem(infoString);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -119,8 +119,8 @@ namespace BlackGui
|
||||
//! Set widths
|
||||
void setWidths();
|
||||
|
||||
QStringList m_otherVersionDirs;
|
||||
QScopedPointer<Ui::CCopyConfigurationComponent> ui;
|
||||
QStringList m_otherVersionDirs;
|
||||
QString m_initializedSourceDir;
|
||||
QString m_initializedDestinationDir;
|
||||
bool m_logCopiedFiles = true;
|
||||
@@ -128,8 +128,8 @@ namespace BlackGui
|
||||
bool m_withBootstrapFile = false;
|
||||
|
||||
// caches will be explicitly initialized in initCaches
|
||||
BlackMisc::Simulation::Data::CModelCaches m_modelCaches{ false, this };
|
||||
BlackMisc::Simulation::Data::CModelSetCaches m_modelSetCaches{ false, this };
|
||||
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this };
|
||||
BlackMisc::Simulation::Data::CModelSetCaches m_modelSetCaches { false, this };
|
||||
|
||||
// caches will be initialized so they can be overriden
|
||||
// those caches do not harm if they exists default initialized
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
class QObject;
|
||||
|
||||
namespace BlackMisc { namespace Network { class CServer; } }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
|
||||
@@ -68,18 +68,10 @@ namespace BlackGui
|
||||
this->setSortIndicator();
|
||||
switch (mode)
|
||||
{
|
||||
case CAircraftModelListModel::StashModel:
|
||||
m_menus = MenuDefaultNoClear;
|
||||
break;
|
||||
case CAircraftModelListModel::Database:
|
||||
m_menus = MenuDefaultDbViews;
|
||||
break;
|
||||
case CAircraftModelListModel::VPilotRuleModel:
|
||||
m_menus = MenuDefaultNoClear | MenuStashing;
|
||||
break;
|
||||
case CAircraftModelListModel::OwnAircraftModelMappingTool:
|
||||
m_menus = MenuDefaultNoClear | MenuStashing | MenuLoadAndSave;
|
||||
break;
|
||||
case CAircraftModelListModel::StashModel: m_menus = MenuDefaultNoClear; break;
|
||||
case CAircraftModelListModel::Database: m_menus = MenuDefaultDbViews; break;
|
||||
case CAircraftModelListModel::VPilotRuleModel: m_menus = MenuDefaultNoClear | MenuStashing; break;
|
||||
case CAircraftModelListModel::OwnAircraftModelMappingTool: m_menus = MenuDefaultNoClear | MenuStashing | MenuLoadAndSave; break;
|
||||
case CAircraftModelListModel::OwnAircraftModelClient:
|
||||
default:
|
||||
m_menus = MenuDefaultNoClear | MenuBackend;
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackgui/models/serverlistmodel.h"
|
||||
#include "blackgui/views/serverview.h"
|
||||
#include "serverview.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui::Models;
|
||||
|
||||
@@ -13,13 +13,11 @@
|
||||
#define BLACKGUI_VIEWS_SERVERVIEW_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/serverlistmodel.h"
|
||||
#include "blackgui/views/viewbase.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include "blackgui/models/serverlistmodel.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc { namespace Network { class CServer; } }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace BlackGui
|
||||
saveJson->setContext(Qt::WidgetShortcut);
|
||||
|
||||
QShortcut *deleteRow = new QShortcut(CShortcut::keyDelete(), this);
|
||||
connect(deleteRow, &QShortcut::activated, this, &CViewBaseNonTemplate::ps_removeSelectedRows);
|
||||
connect(deleteRow, &QShortcut::activated, this, &CViewBaseNonTemplate::removeSelectedRowsChecked);
|
||||
deleteRow->setObjectName("Remove selected rows for " + this->objectName());
|
||||
deleteRow->setContext(Qt::WidgetShortcut);
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace BlackGui
|
||||
a->setChecked(this->displayAutomatically());
|
||||
break;
|
||||
}
|
||||
case MenuRemoveSelectedRows: { ma.addAction(CIcons::delete16(), "Remove selected rows", CMenuAction::pathViewAddRemove(), { this, &CViewBaseNonTemplate::ps_removeSelectedRows }, CShortcut::keyDelete()); break; }
|
||||
case MenuRemoveSelectedRows: { ma.addAction(CIcons::delete16(), "Remove selected rows", CMenuAction::pathViewAddRemove(), { this, &CViewBaseNonTemplate::removeSelectedRowsChecked }, CShortcut::keyDelete()); break; }
|
||||
case MenuClear: { ma.addAction(CIcons::delete16(), "Clear", CMenuAction::pathViewAddRemove(), { this, &CViewBaseNonTemplate::clear }); break; }
|
||||
case MenuFilter:
|
||||
{
|
||||
@@ -827,7 +827,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CViewBaseNonTemplate::ps_removeSelectedRows()
|
||||
void CViewBaseNonTemplate::removeSelectedRowsChecked()
|
||||
{
|
||||
if (!m_enableDeleteSelectedRows) { return; }
|
||||
this->removeSelectedRows();
|
||||
|
||||
@@ -540,8 +540,8 @@ namespace BlackGui
|
||||
void setSingleSelection();
|
||||
//! @}
|
||||
|
||||
//! Remove selected rows
|
||||
void ps_removeSelectedRows();
|
||||
//! Remove selected rows if enabled
|
||||
void removeSelectedRowsChecked();
|
||||
|
||||
//! Toggle auto display flag
|
||||
void toggleAutoDisplay();
|
||||
|
||||
Reference in New Issue
Block a user