Replace occurrences of CVariant::toCVariant() with CVariant::from()

This commit is contained in:
Roland Winklmeier
2015-05-30 00:11:22 +02:00
parent 28d2561a48
commit e4f2c9e88a
49 changed files with 78 additions and 87 deletions

View File

@@ -11,8 +11,10 @@
#include "ui_settingshotkeycomponent.h"
#include "blackcore/context_settings.h"
#include "blackmisc/settingutilities.h"
#include "blackmisc/variant.h"
using namespace BlackCore;
using namespace BlackMisc;
using namespace BlackMisc::Settings;
namespace BlackGui
@@ -56,7 +58,7 @@ namespace BlackGui
void CSettingsHotkeyComponent::ps_saveHotkeys()
{
const QString path = CSettingUtilities::appendPaths(IContextSettings::PathRoot(), IContextSettings::PathHotkeys());
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), this->ui->tvp_SettingsMiscHotkeys->derivedModel()->getContainer().toCVariant());
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), CVariant::from(this->ui->tvp_SettingsMiscHotkeys->derivedModel()->getContainer()));
}
void CSettingsHotkeyComponent::ps_clearHotkey()

View File

@@ -79,11 +79,11 @@ namespace BlackGui
QObject *sender = QObject::sender();
if (sender == this->ui->pb_SettingsTnServersRemoveServer)
{
this->getIContextSettings()->value(path, CSettingUtilities::CmdRemove(), server.toCVariant());
this->getIContextSettings()->value(path, CSettingUtilities::CmdRemove(), CVariant::from(server));
}
else if (sender == this->ui->pb_SettingsTnServersSaveServer)
{
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), server.toCVariant());
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), CVariant::from(server));
}
}

View File

@@ -157,7 +157,7 @@ namespace BlackGui
// update
CSimulatorPluginInfo currentDriver = simDrivers[index];
const QString path = CSettingUtilities::appendPaths(IContextSettings::PathSimulatorSettings(), CSettingsSimulator::ValueSelectedDriver());
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), currentDriver.toCVariant());
this->getIContextSettings()->value(path, CSettingUtilities::CmdUpdate(), CVariant::from(currentDriver));
}
void CSettingsSimulatorComponent::ps_settingsHaveChanged(uint settingsType)

View File

@@ -142,7 +142,7 @@ namespace BlackGui
// if the channel is selected, do nothing
if (!this->isCorrespondingTextMessageTabSelected(message))
{
emit this->displayInInfoWindow(message.toCVariant(), 5 * 1000);
emit this->displayInInfoWindow(CVariant::from(message), 5 * 1000);
}
}
}