[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [skrooge/Feature] /: Correction: "Delete unused" of category page
From: Stephane Mankowski <stephane () mankowski ! fr>
Date: 2011-08-30 20:48:59
Message-ID: 20110830204859.A80D3A6078 () git ! kde ! org
[Download RAW message or body]
Git commit 99f3798fbe95d839815f505a98cf01b4dfd497e7 by Stephane Mankowski.
Committed on 30/08/2011 at 22:48.
Pushed by smankowski into branch 'Feature'.
Correction: "Delete unused" of category page tries a delete only on \
categories really not used
M +21 -3 plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp
M +1 -1 plugins/skrooge/skrooge_unit/skgunitpluginwidget_base.ui
M +28 -28 plugins/skrooge/skrooge_unit/skgunitpluginwidget.cpp
M +1 -1 plugins/skrooge/skrooge_unit/skgunitpluginwidget.h
M +1 -0 CHANGELOG
http://commits.kde.org/skrooge/99f3798fbe95d839815f505a98cf01b4dfd497e7
diff --git a/CHANGELOG b/CHANGELOG
index 46c1126..9e52de1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,7 @@ skrooge (1.0.0)
*Correction: Completion on substring available only in "Dropdown list" \
mode
*Correction: To improve performances, the refresh of advices is done \
when dashboard is activated and only if refresh is needed
*Correction: To improve performances, the refresh of models is done for \
views in current page + *Correction: "Delete unused" of category page \
tries a delete only on categories really not used
*New feature: Addition of "Once a week" for scheduled operations
*New feature: Merge of trackers by drag & drop
*New feature: "Count" mode in reports
diff --git a/plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp \
b/plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp index \
44108c0..98e0844 100644
--- a/plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp
+++ b/plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp
@@ -204,9 +204,27 @@ void SKGCategoriesPlugin::deleteUnusedCategories() \
const if(m_currentBankDocument) {
SKGBEGINTRANSACTION(*m_currentBankDocument, i18nc("Noun, name of \
the user action", "Delete unused categories") , err);
- //Modification of category object
- QString sql = "DELETE FROM category WHERE id IN (SELECT id FROM \
v_category_display WHERE i_SUMNBOPERATIONS=0)";
- err = m_currentBankDocument->executeSqliteOrder(sql);
+ QStringList categoriesUsed;
+ err = m_currentBankDocument->getDistinctValues("category", \
"t_fullname", "t_fullname in (" + "SELECT \
category.t_fullname FROM category, suboperation WHERE \
suboperation.r_category_id=category.id UNION " + "SELECT \
category.t_fullname FROM category, budget WHERE \
budget.rc_category_id=category.id UNION " + "SELECT \
category.t_fullname FROM category, budgetrule WHERE \
budgetrule.rc_category_id=category.id UNION " + "SELECT \
category.t_fullname FROM category, budgetrule WHERE \
budgetrule.rc_category_id_target=category.id)", categoriesUsed); +
+ for(int i = 0; i < categoriesUsed.count(); ++i) { //Warning \
categoriesUsed is modified in the loop + QString cat = \
categoriesUsed.at(i); + categoriesUsed[i] = \
SKGServices::stringToSqlString(cat); + int pos = \
cat.lastIndexOf(OBJECTSEPARATOR); + if(pos != -1) \
categoriesUsed.push_back(cat.left(pos)); + }
+
+ if(categoriesUsed.count() && !err) {
+
+ //Modification of category object
+ QString sql = "DELETE FROM category WHERE t_fullname NOT IN \
('" % categoriesUsed.join("','") % "')"; + ;
+ err = m_currentBankDocument->executeSqliteOrder(sql);
+ }
//status bar
if(!err) err = SKGError(0, i18nc("Successful message after an user \
action", "Unused categories deleted"));
diff --git a/plugins/skrooge/skrooge_unit/skgunitpluginwidget.cpp \
b/plugins/skrooge/skrooge_unit/skgunitpluginwidget.cpp index \
a1640c7..b017366 100644
--- a/plugins/skrooge/skrooge_unit/skgunitpluginwidget.cpp
+++ b/plugins/skrooge/skrooge_unit/skgunitpluginwidget.cpp
@@ -100,26 +100,26 @@ \
SKGUnitPluginWidget::SKGUnitPluginWidget(SKGDocumentBank* iDocument) \
ui.kUnitAdd->setIcon(KIcon("list-add")); \
ui.kUnitUpdate->setIcon(KIcon("dialog-ok-apply")); \
ui.kUnitValueDownload->setIcon(KIcon("download"));
-
- KAction* downloadMonthlyAction = new \
KAction(KIcon("download"),i18n("download all monthly \
values"),this);
- connect(downloadMonthlyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadMonthlyValues()));
-
- KAction* downloadWeeklyAction = new \
KAction(KIcon("download"),i18n("download all weekly \
values"),this);
- connect(downloadMonthlyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadWeeklyValues()));
-
- KAction* downloadDailyAction = new \
KAction(KIcon("download"),i18n("download all daily \
values"),this);
- connect(downloadDailyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadDailyValues()));
-
- KAction* downloadLastMonthlyAction = new \
KAction(KIcon("download"),i18n("download monthly values since last known \
value"),this);
- connect(downloadMonthlyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadMonthlyValuesFromLast()));
-
- KAction* downloadLastWeeklyAction = new \
KAction(KIcon("download"),i18n("download weekly values since last known \
value"),this);
- connect(downloadMonthlyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadWeeklyValuesFromLast()));
-
- KAction* downloadLastDailyAction = new \
KAction(KIcon("download"),i18n("download daily values since last known \
value"),this);
- connect(downloadDailyAction,SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),SLOT(downloadDailyValuesFromLast()));
-
-
+
+ KAction* downloadMonthlyAction = new KAction(KIcon("download"), \
i18n("download all monthly values"), this); + \
connect(downloadMonthlyAction, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), SLOT(downloadMonthlyValues())); +
+ KAction* downloadWeeklyAction = new KAction(KIcon("download"), \
i18n("download all weekly values"), this); + \
connect(downloadMonthlyAction, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), SLOT(downloadWeeklyValues())); +
+ KAction* downloadDailyAction = new KAction(KIcon("download"), \
i18n("download all daily values"), this); + connect(downloadDailyAction, \
SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), \
SLOT(downloadDailyValues())); +
+ KAction* downloadLastMonthlyAction = new KAction(KIcon("download"), \
i18n("download monthly values since last known value"), this); + \
connect(downloadMonthlyAction, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), SLOT(downloadMonthlyValuesFromLast())); +
+ KAction* downloadLastWeeklyAction = new KAction(KIcon("download"), \
i18n("download weekly values since last known value"), this); + \
connect(downloadMonthlyAction, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), SLOT(downloadWeeklyValuesFromLast())); +
+ KAction* downloadLastDailyAction = new KAction(KIcon("download"), \
i18n("download daily values since last known value"), this); + \
connect(downloadDailyAction, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), SLOT(downloadDailyValuesFromLast())); +
+
KMenu* downloadMenu = new KMenu();
downloadMenu->addAction(downloadMonthlyAction);
downloadMenu->addAction(downloadWeeklyAction);
@@ -127,8 +127,8 @@ SKGUnitPluginWidget::SKGUnitPluginWidget(SKGDocumentBank* \
iDocument) downloadMenu->addAction(downloadLastMonthlyAction);
downloadMenu->addAction(downloadLastWeeklyAction);
downloadMenu->addAction(downloadLastDailyAction);
-
-
+
+
ui.kUnitValueDownload->setMenu(downloadMenu);
{
@@ -515,7 +515,7 @@ void SKGUnitPluginWidget::downloadMonthlyValues()
{
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
@@ -527,7 +527,7 @@ void SKGUnitPluginWidget::downloadWeeklyValues()
{
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
@@ -539,7 +539,7 @@ void SKGUnitPluginWidget::downloadDailyValues()
{
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
@@ -551,7 +551,7 @@ void \
SKGUnitPluginWidget::downloadMonthlyValuesFromLast() {
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
@@ -563,7 +563,7 @@ void \
SKGUnitPluginWidget::downloadWeeklyValuesFromLast() {
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
@@ -575,7 +575,7 @@ void SKGUnitPluginWidget::downloadDailyValuesFromLast()
{
SKGError err;
SKGTRACEINRC(10, "SKGUnitPluginWidget::onDownloadUnitValue", err);
-
+
SKGObjectBase::SKGListSKGObjectBase selection = getSelectedObjects();
int nb = selection.count();
for(int i = 0; !err && i < nb; ++i) {
diff --git a/plugins/skrooge/skrooge_unit/skgunitpluginwidget.h \
b/plugins/skrooge/skrooge_unit/skgunitpluginwidget.h index 5d5123f..ede2561 \
100644
--- a/plugins/skrooge/skrooge_unit/skgunitpluginwidget.h
+++ b/plugins/skrooge/skrooge_unit/skgunitpluginwidget.h
@@ -90,7 +90,7 @@ public:
*/
static SKGError downloadUnitValue(const SKGUnitObject& iUnit, \
SKGUnitObject::UnitDownloadMode mode);
-
+
/**
* To know if this page contains an editor. MUST BE OVERWRITTEN
* @return the editor state
diff --git a/plugins/skrooge/skrooge_unit/skgunitpluginwidget_base.ui \
b/plugins/skrooge/skrooge_unit/skgunitpluginwidget_base.ui index \
e277436..a408752 100644
--- a/plugins/skrooge/skrooge_unit/skgunitpluginwidget_base.ui
+++ b/plugins/skrooge/skrooge_unit/skgunitpluginwidget_base.ui
@@ -688,7 +688,7 @@ See options to modify download frequency.</string>
<customwidget>
<class>KPIM::KDateEdit</class>
<extends>QComboBox</extends>
- <header>libkdepim/kdateedit.h</header>
+ <header>kdateedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic