code style

This commit is contained in:
Patrick von Reth 2015-04-06 12:03:22 +02:00
parent 1a9b29a2ca
commit 51131cf2bd
13 changed files with 29 additions and 38 deletions

View File

@ -63,7 +63,6 @@ void TrayIcon::initConextMenu()
}); });
m_settings->layout()->addWidget(box); m_settings->layout()->addWidget(box);
// connect(m_settings, &SettingsDialog::finished, m_settings, &SettingsDialog::hide); // connect(m_settings, &SettingsDialog::finished, m_settings, &SettingsDialog::hide);
m_trayIcon->setVisible(true); m_trayIcon->setVisible(true);

View File

@ -25,7 +25,6 @@
using namespace Snore; using namespace Snore;
Notification::Notification() : Notification::Notification() :
d(NULL) d(NULL)
{ {

View File

@ -140,7 +140,6 @@ const QList<SnorePlugin::PluginTypes> &SnorePlugin::types()
return t; return t;
} }
QDebug operator<<(QDebug debug, const Snore::SnorePlugin::PluginTypes &flags) QDebug operator<<(QDebug debug, const Snore::SnorePlugin::PluginTypes &flags)
{ {
QMetaEnum e = SnorePlugin::staticMetaObject.enumerator(SnorePlugin::staticMetaObject.indexOfEnumerator("PluginType")); QMetaEnum e = SnorePlugin::staticMetaObject.enumerator(SnorePlugin::staticMetaObject.indexOfEnumerator("PluginType"));
@ -164,7 +163,6 @@ QDebug operator<<(QDebug debug, const Snore::SnorePlugin::PluginTypes &flags)
} }
QDataStream &operator<<(QDataStream &out, const Snore::SnorePlugin::PluginTypes &type) QDataStream &operator<<(QDataStream &out, const Snore::SnorePlugin::PluginTypes &type)
{ {
out << static_cast<int>(type); out << static_cast<int>(type);

View File

@ -47,7 +47,6 @@ public:
static QString typeToString(const PluginTypes t); static QString typeToString(const PluginTypes t);
static const QList<PluginTypes> &types(); static const QList<PluginTypes> &types();
SnorePlugin(const QString &name); SnorePlugin(const QString &name);
virtual ~SnorePlugin(); virtual ~SnorePlugin();
virtual bool initialize(); virtual bool initialize();
@ -90,5 +89,4 @@ SNORE_EXPORT QDebug operator<<(QDebug, const Snore::SnorePlugin::PluginTypes &);
SNORE_EXPORT QDataStream &operator<<(QDataStream &out, const Snore::SnorePlugin::PluginTypes &type); SNORE_EXPORT QDataStream &operator<<(QDataStream &out, const Snore::SnorePlugin::PluginTypes &type);
SNORE_EXPORT QDataStream &operator>>(QDataStream &in, Snore::SnorePlugin::PluginTypes &type); SNORE_EXPORT QDataStream &operator>>(QDataStream &in, Snore::SnorePlugin::PluginTypes &type);
#endif//SNORE_PLUGINS_H #endif//SNORE_PLUGINS_H

View File

@ -43,8 +43,7 @@ SettingsDialog::~SettingsDialog()
void SettingsDialog::initTabs() void SettingsDialog::initTabs()
{ {
SnorePlugin::PluginTypes types = SnoreCore::instance().value("PluginTypes", LOCAL_SETTING).value<SnorePlugin::PluginTypes>(); SnorePlugin::PluginTypes types = SnoreCore::instance().value("PluginTypes", LOCAL_SETTING).value<SnorePlugin::PluginTypes>();
if(types == SnorePlugin::NONE) if (types == SnorePlugin::NONE) {
{
types = SnorePlugin::ALL; types = SnorePlugin::ALL;
} }
auto addWidgets = [&](QTabWidget * target, QWidget * container, SnorePlugin::PluginTypes type) { auto addWidgets = [&](QTabWidget * target, QWidget * container, SnorePlugin::PluginTypes type) {

View File

@ -51,7 +51,6 @@ public:
//TODO: move to private header //TODO: move to private header
void initTabs(); void initTabs();
public slots: public slots:
void setVisible(bool b) override; void setVisible(bool b) override;
void accept(); void accept();

View File

@ -173,7 +173,8 @@ void SnoreCorePrivate::syncSettings()
} }
} }
QStringList SnoreCorePrivate::knownClients(){ QStringList SnoreCorePrivate::knownClients()
{
QStringList out; QStringList out;
m_settings->beginGroup(versionSchema()); m_settings->beginGroup(versionSchema());
m_settings->beginGroup("LocalSettings"); m_settings->beginGroup("LocalSettings");
@ -234,19 +235,16 @@ void SnoreCorePrivate::slotAboutToQuit()
} }
} }
void SnoreCorePrivate::loadTranslator(){ void SnoreCorePrivate::loadTranslator()
auto installTranslator = [](const QString &locale)
{ {
auto installTranslator = [](const QString & locale) {
snoreDebug(SNORE_DEBUG) << locale; snoreDebug(SNORE_DEBUG) << locale;
if (locale != "C") { if (locale != "C") {
QTranslator *translator = new QTranslator(qApp->instance()); QTranslator *translator = new QTranslator(qApp->instance());
if ( translator->load(locale, ":/lang/libsnore/") ) if (translator->load(locale, ":/lang/libsnore/")) {
{
snoreDebug(SNORE_INFO) << "Using system locale:" << locale; snoreDebug(SNORE_INFO) << "Using system locale:" << locale;
snoreDebug(SNORE_INFO) << qApp->installTranslator(translator); snoreDebug(SNORE_INFO) << qApp->installTranslator(translator);
} } else {
else
{
translator->deleteLater(); translator->deleteLater();
QString fileName = QString(":/lang/libsnore/%1.qm").arg(locale); QString fileName = QString(":/lang/libsnore/%1.qm").arg(locale);
snoreDebug(SNORE_WARNING) << "Failed to load translations for:" << locale << fileName << QFile::exists(fileName) ; snoreDebug(SNORE_WARNING) << "Failed to load translations for:" << locale << fileName << QFile::exists(fileName) ;

View File

@ -3,7 +3,8 @@
#include <QMainWindow> #include <QMainWindow>
namespace Ui { namespace Ui
{
class SettingsWindow; class SettingsWindow;
} }