mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-19 08:39:57 +00:00
rewrite formtatter* and customkeys* to share their code
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include <KI18n/KLocalizedString>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QInputDialog>
|
||||
#include <QPushButton>
|
||||
@ -33,6 +34,15 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *_parent,
|
||||
{
|
||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||
|
||||
// create directory at $HOME
|
||||
QString localDir = QString("%1/awesomewidgets/%2")
|
||||
.arg(QStandardPaths::writableLocation(
|
||||
QStandardPaths::GenericDataLocation))
|
||||
.arg(type());
|
||||
QDir localDirectory;
|
||||
if (localDirectory.mkpath(localDir))
|
||||
qCInfo(LOG_LIB) << "Created directory" << localDir;
|
||||
|
||||
ui->setupUi(this);
|
||||
copyButton
|
||||
= ui->buttonBox->addButton(i18n("Copy"), QDialogButtonBox::ActionRole);
|
||||
@ -182,6 +192,17 @@ QVariant AbstractExtItemAggregator::configArgs() const
|
||||
}
|
||||
|
||||
|
||||
QStringList AbstractExtItemAggregator::directories() const
|
||||
{
|
||||
auto dirs
|
||||
= QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QString("awesomewidgets/%1").arg(type()),
|
||||
QStandardPaths::LocateDirectory);
|
||||
|
||||
return dirs;
|
||||
}
|
||||
|
||||
|
||||
QString AbstractExtItemAggregator::type() const
|
||||
{
|
||||
return m_type;
|
||||
|
Reference in New Issue
Block a user