* move isDebugEnabled method to AWActions

* add "Drop key cache" button
This commit is contained in:
arcan1s
2015-07-21 00:24:50 +03:00
parent 1110929b14
commit a065e96bc3
22 changed files with 1930 additions and 1881 deletions

View File

@ -67,6 +67,25 @@ void AWActions::checkUpdates()
}
bool AWActions::dropCache()
{
if (debug) qDebug() << PDEBUG;
QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
return QFile(fileName).remove();
}
bool AWActions::isDebugEnabled()
{
if (debug) qDebug() << PDEBUG;
return debug;
}
void AWActions::runCmd(const QString cmd)
{
if (debug) qDebug() << PDEBUG;

View File

@ -35,6 +35,8 @@ public:
~AWActions();
Q_INVOKABLE void checkUpdates();
Q_INVOKABLE bool dropCache();
Q_INVOKABLE bool isDebugEnabled();
Q_INVOKABLE void runCmd(const QString cmd = QString("/usr/bin/true"));
Q_INVOKABLE void sendEmail();
Q_INVOKABLE void showReadme();

View File

@ -136,14 +136,6 @@ void AWKeys::setWrapNewLines(const bool wrap)
}
bool AWKeys::isDebugEnabled()
{
if (debug) qDebug() << PDEBUG;
return debug;
}
QString AWKeys::parsePattern()
{
if (debug) qDebug() << PDEBUG;
@ -799,7 +791,7 @@ void AWKeys::loadKeysFromCache()
if (debug) qDebug() << PDEBUG;
QString fileName = QString("%1/awesomewidgets.ndx")
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
if (debug) qDebug() << PDEBUG << ":" << "Cache file" << fileName;
QSettings cache(fileName, QSettings::IniFormat);
QStringList cachedKeys;

View File

@ -55,7 +55,6 @@ public:
Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams);
Q_INVOKABLE void setPopupEnabled(const bool popup = false);
Q_INVOKABLE void setWrapNewLines(const bool wrap = false);
Q_INVOKABLE bool isDebugEnabled();
Q_INVOKABLE QString parsePattern();
Q_INVOKABLE QSize toolTipSize();
// keys