[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bskrooge=5D_/=3A_Replace_+_by_=25_in_all_string_conc?=
From: Stephane Mankowski <stephane () mankowski ! fr>
Date: 2011-05-31 20:29:24
Message-ID: 20110531202924.0A711A6071 () git ! kde ! org
[Download RAW message or body]
Git commit 2b5f3896647559bb06cb51474b034944d5a513a8 by Stephane Mankowski.
Committed on 31/05/2011 at 22:29.
Pushed by smankowski into branch 'master'.
Replace + by % in all string concatenation for better performances
M +3 -0 CMakeLists.txt
M +3 -3 skg_advice/skgadviceboardwidget.cpp
M +7 -7 skg_bookmark/skgbookmarkplugin.cpp
M +3 -3 skg_bookmark/skgbookmarkplugindockwidget.cpp
M +5 -5 skg_dashboard/skgdashboardpluginwidget.cpp
M +1 -1 skg_dashboard2/skgdashboard2pluginwidget.cpp
M +1 -1 skg_dataengine/skgdataengine.cpp
M +6 -6 skg_debug/skgdebugpluginwidget.cpp
M +1 -1 skg_delete/skgdeleteplugin.cpp
M +5 -5 skg_file/skgfileplugin.cpp
M +1 -1 skg_properties/skgpropertiesplugin.cpp
M +5 -5 skg_properties/skgpropertiesplugindockwidget.cpp
M +4 -4 skgapplets/alarm/alarmskroogoid.cpp
M +5 -5 skgapplets/bank/bankskroogoid.cpp
M +3 -3 skgapplets/calculator/calculatorskroogoid.cpp
M +1 -1 skgapplets/highlightedoperation/highlightedoperationskroogoid.cpp
M +5 -5 skgapplets/operation/operationskroogoid.cpp
M +1 -1 skgapplets/scheduledoperation/scheduledoperationskroogoid.cpp
M +2 -2 skgapplets/unit/unitskroogoid.cpp
M +2 -2 skgbankgui/skgobjectmodel.cpp
M +1 -1 skgbankgui/skgpredicatcreator.cpp
M +33 -33 skgbankmodeler/skgaccountobject.cpp
M +1 -1 skgbankmodeler/skgbankobject.cpp
M +15 -15 skgbankmodeler/skgbudgetobject.cpp
M +2 -2 skgbankmodeler/skgbudgetruleobject.cpp
M +8 -8 skgbankmodeler/skgcategoryobject.cpp
M +116 -116 skgbankmodeler/skgdocumentbank.cpp
M +22 -22 skgbankmodeler/skgimportexportmanager.cpp
M +4 -4 skgbankmodeler/skgimportgnc.cpp
M +3 -3 skgbankmodeler/skgimportgsb.cpp
M +7 -7 skgbankmodeler/skgimportkmy.cpp
M +7 -7 skgbankmodeler/skgimportmmb.cpp
M +4 -4 skgbankmodeler/skgimportmt940.cpp
M +3 -3 skgbankmodeler/skgimportskg.cpp
M +4 -4 skgbankmodeler/skgimportxhb.cpp
M +2 -2 skgbankmodeler/skginterestobject.cpp
M +10 -10 skgbankmodeler/skgoperationobject.cpp
M +2 -2 skgbankmodeler/skgpayeeobject.cpp
M +2 -2 skgbankmodeler/skgrecurrentoperationobject.cpp
M +16 -16 skgbankmodeler/skgruleobject.cpp
M +3 -3 skgbankmodeler/skgsuboperationobject.cpp
M +2 -2 skgbankmodeler/skgtrackerobject.cpp
M +36 -36 skgbankmodeler/skgunitobject.cpp
M +2 -2 skgbankmodeler/skgunitvalueobject.cpp
M +1 -1 skgbankmodelertest/skgtestautoreconcile.cpp
M +4 -4 skgbankmodelertest/skgtestbigdocument.cpp
M +2 -2 skgbankmodelertest/skgtestbudget.cpp
M +14 -14 skgbankmodelertest/skgtestcategory.cpp
M +19 -19 skgbankmodelertest/skgtestimportcsv.cpp
M +3 -3 skgbankmodelertest/skgtestimportcsvunit.cpp
M +15 -15 skgbankmodelertest/skgtestimportgnucash.cpp
M +4 -4 skgbankmodelertest/skgtestimportgsb.cpp
M +6 -6 skgbankmodelertest/skgtestimportkmy.cpp
M +2 -2 skgbankmodelertest/skgtestimportmmb.cpp
M +5 -5 skgbankmodelertest/skgtestimportmt940.cpp
M +12 -12 skgbankmodelertest/skgtestimportofx.cpp
M +45 -45 skgbankmodelertest/skgtestimportqif.cpp
M +9 -9 skgbankmodelertest/skgtestimportskg.cpp
M +5 -5 skgbankmodelertest/skgtestimportstockqif.cpp
M +3 -3 skgbankmodelertest/skgtestimportxhb.cpp
M +2 -2 skgbankmodelertest/skgtestmigration.cpp
M +1 -1 skgbankmodelertest/skgtestoperation.cpp
M +2 -2 skgbankmodelertest/skgtestrule.cpp
M +1 -1 skgbasegui/skgcalculatoredit.cpp
M +7 -7 skgbasegui/skgmainpanel.cpp
M +9 -9 skgbasegui/skgobjectmodelbase.cpp
M +1 -1 skgbasegui/skgshow.cpp
M +11 -11 skgbasegui/skgtablewithgraph.cpp
M +2 -2 skgbasegui/skgtreeview.cpp
M +1 -1 skgbasegui/skguniqueapplication.cpp
M +28 -28 skgbasemodeler/skgdefine.h
M +111 -111 skgbasemodeler/skgdocument.cpp
M +2 -2 skgbasemodeler/skgerror.cpp
M +2 -2 skgbasemodeler/skgnamedobject.cpp
M +7 -7 skgbasemodeler/skgnodeobject.cpp
M +19 -19 skgbasemodeler/skgobjectbase.cpp
M +2 -2 skgbasemodeler/skgpropertyobject.cpp
M +15 -15 skgbasemodeler/skgservices.cpp
M +12 -12 skgbasemodeler/skgtraces.cpp
M +1 -1 skgbasemodelertest/skgtestbase.cpp
M +1 -1 skgbasemodelertest/skgtestfile.cpp
M +9 -9 skgbasemodelertest/skgtestmacro.h
M +21 -21 skgbasemodelertest/skgtestnodes.cpp
M +3 -3 skgbasemodelertest/skgtestpassword.cpp
M +3 -3 skgbasemodelertest/skgtesttransaction.cpp
M +12 -12 skrooge_bank/skgaccountboardwidget.cpp
M +5 -5 skrooge_bank/skgbankboardwidget.cpp
M +1 -1 skrooge_bank/skgbankplugin.cpp
M +4 -4 skrooge_bank/skgbankpluginwidget.cpp
M +2 -2 skrooge_budget/skgbudgetplugin.cpp
M +7 -7 skrooge_budget/skgbudgetpluginwidget.cpp
M +1 -1 skrooge_calculator/skgcalculatorplugin.cpp
M +1 -1 skrooge_calculator/skgcalculatorpluginwidget.cpp
M +3 -3 skrooge_calculator/skginterestboardwidget.cpp
M +6 -6 skrooge_categories/skgcategoriespluginwidget.cpp
M +19 -19 skrooge_importexport/skgimportexportplugin.cpp
M +2 -2 skrooge_monthly/skgmonthlyplugin.cpp
M +70 -70 skrooge_monthly/skgmonthlypluginwidget.cpp
M +2 -2 skrooge_operation/skgbookmarkboardwidget.cpp
M +5 -5 skrooge_operation/skgoperationboardwidget.cpp
M +5 -5 skrooge_operation/skgoperationplugin.cpp
M +30 -30 skrooge_operation/skgoperationpluginwidget.cpp
M +2 -2 skrooge_payee/skgpayeepluginwidget.cpp
M +4 -4 skrooge_report/skgreportplugin.cpp
M +50 -50 skrooge_report/skgreportpluginwidget.cpp
M +1 -1 skrooge_scheduled/skgscheduledplugin.cpp
M +4 -4 skrooge_scheduled/skgscheduledpluginwidget.cpp
M +6 -6 skrooge_search/skgalarmboardwidget.cpp
M +1 -1 skrooge_search/skgsearchplugin.cpp
M +9 -9 skrooge_search/skgsearchpluginwidget.cpp
M +2 -2 skrooge_tracker/skgtrackerpluginwidget.cpp
M +4 -4 skrooge_unit/skgunitboardwidget.cpp
M +3 -3 skrooge_unit/skgunitplugin.cpp
M +4 -4 skrooge_unit/skgunitpluginwidget.cpp
http://commits.kde.org/skrooge/2b5f3896647559bb06cb51474b034944d5a513a8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96dbe51..91a5b1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,9 @@ else(${KDE_VERSION} VERSION_LESS "4.6.0")
add_definitions(-DSKGKDE46ENABLED=Y)
endif(${KDE_VERSION} VERSION_LESS "4.6.0")
+add_definitions(-DQT_USE_FAST_CONCATENATION)
+add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
+
include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/skgbasemodeler/
${CMAKE_CURRENT_SOURCE_DIR}/skgbasegui/
diff --git a/skg_advice/skgadviceboardwidget.cpp \
b/skg_advice/skgadviceboardwidget.cpp index 27ae88a..b332c6a 100644
--- a/skg_advice/skgadviceboardwidget.cpp
+++ b/skg_advice/skgadviceboardwidget.cpp
@@ -94,7 +94,7 @@ void SKGAdviceBoardWidget::dataModified()
//Get list of ignored advices
QString currentMonth = QDate::currentDate().toString("yyyy-MM");
- QStringList ignoredAdvices = getDocument()->getParameters("advices", \
"t_value='I' OR t_value='I_" + currentMonth + '\''); + QStringList ignoredAdvices \
= getDocument()->getParameters("advices", "t_value='I' OR t_value='I_" % currentMonth \
% '\'');
//Build the list of all advices by requesting all plugins
QList< SKGInterfacePlugin::SKGAdvice > globalAdvicesList;
@@ -250,10 +250,10 @@ void SKGAdviceBoardWidget::adviceClicked()
//Create dismiss
if(solution == -1 || solution == -2) uuid = \
SKGServices::splitCSVLine(uuid, '|').at(0);
- err = getDocument()->setParameter(uuid, solution == -2 || solution \
== -4 ? "I" : QString("I_" + currentMonth), QVariant(), "advices"); + \
err = getDocument()->setParameter(uuid, solution == -2 || solution == -4 ? "I" : \
QString("I_" % currentMonth), QVariant(), "advices");
//Delete useless dismiss
- if(err.isSucceeded())err = getDocument()->executeSqliteOrder("DELETE \
FROM parameters WHERE t_uuid_parent='advices' AND t_value like 'I_%' AND \
t_value!='I_" + currentMonth + '\''); + if(err.isSucceeded())err = \
getDocument()->executeSqliteOrder("DELETE FROM parameters WHERE \
t_uuid_parent='advices' AND t_value like 'I_ % ' AND t_value!='I_" % currentMonth % \
'\''); }
//status bar
diff --git a/skg_bookmark/skgbookmarkplugin.cpp b/skg_bookmark/skgbookmarkplugin.cpp
index 4a45fc9..13ed589 100644
--- a/skg_bookmark/skgbookmarkplugin.cpp
+++ b/skg_bookmark/skgbookmarkplugin.cpp
@@ -183,10 +183,10 @@ void SKGBookmarkPlugin::importStandardBookmarks()
//TODO: Must be generic
QStringList bks;
- bks << i18nc("Noun, bookmark name", "Dashboard") + "|Y|go-home|\"Dashboard \
plugin\";\"Dashboard\";\"<!DOCTYPE SKGML><parameters zoomPosition=\"\"0\"\"> <ITEM-1 \
zoom=\"\"0\"\" index=\"\"0\"\" name=\"\"Skrooge bank plugin\"\" \
state=\"\"<!DOCTYPE SKGML>
<parameters menuOther="Y" \
menuCurrent="Y" menuFavorite="N" menuAssets="Y" \
menuInvestment="Y" menuCreditCard="Y"/>
\"\"/> <ITEM-2 \
zoom=\"\"0\"\" index=\"\"0\"\" name=\"\"Skrooge operation plugin\"\" \
state=\"\"<!DOCTYPE SKGML>
<parameters \
menuTransfert="Y"/>
\"\"/> <ITEM-3 zoom=\"\"0\"\" index=\"\"1\"\" \
name=\"\"Skrooge operation plugin\"\" state=\"\"\"\"/> <ITEM-4 zoom=\"\"0\"\" \
index=\"\"0\"\" name=\"\"Skrooge scheduled plugin\"\" state=\"\"\"\"/> <ITEM-5 \
zoom=\"\"0\"\" index=\"\"0\"\" name=\"\"Skrooge search plugin\"\" \
state=\"\"<!DOCTYPE SKGML>
<parameters \
menuFavorite="N"/>
\"\"/> <ITEM-6 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge unit plugin\"\" state=\"\"<!DOCTYPE SKGML>
<parameters \
menuShares="Y" menuSharesOwnedOnly="N" \
menuIndexes="Y"/>
\"\"/> <ITEM-7 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge calculator plugin\"\" \
state=\"\"\"\"/></parameters>\""
- << i18nc("Noun, bookmark name", "Report > Income vs Expenditure on 12 last \
months") + "|N|view-investment|\"Skrooge report plugin\";\"Rapport\";\"<!DOCTYPE \
SKGML><parameters expenses=\"\"Y\"\" tableAndGraphState=\"\"<!DOCTYPE \
SKGML>
<parameters graphMode="1" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff00000000000000020000025b0000032901000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="Y" linearRegressionVisible="Y" \
sortColumn="0" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"0\"\" period=\"\"3\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"t_TYPEEXPENSENLS\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"12\"\" forecastValue=\"\"20\"\" \
transfers=\"\"N\"\" currentPage=\"\"0\"\"/>\""
- << i18nc("Noun, bookmark name", "Report > Pie categories in 12 last months") \
+ "|N|view-investment|\"Skrooge report plugin\";\"Rapport\";\"<!DOCTYPE \
SKGML><parameters expenses=\"\"Y\"\" tableAndGraphState=\"\"<!DOCTYPE \
SKGML>
<parameters graphMode="2" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff00000000000000020000025b0000032901000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="Y" linearRegressionVisible="Y" \
sortColumn="-1" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"0\"\" period=\"\"3\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"t_REALCATEGORY\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"12\"\" forecastValue=\"\"20\"\" \
transfers=\"\"N\"\" currentPage=\"\"0\"\"/>\""
- << i18nc("Noun, bookmark name", "Report > History") + \
"|N|view-investment|\"Skrooge report plugin\";\"Rapport\";\"<!DOCTYPE \
SKGML><parameters expenses=\"\"Y\"\" tableAndGraphState=\"\"<!DOCTYPE \
SKGML>
<parameters graphMode="1" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff0000000000000002000002b50000032601000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="N" linearRegressionVisible="Y" \
sortColumn="-1" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"1\"\" period=\"\"0\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"#NOTHING#\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"1\"\" forecastValue=\"\"20\"\" \
transfers=\"\"Y\"\" currentPage=\"\"0\"\"/>\""; + bks << i18nc("Noun, bookmark \
name", "Dashboard") % "|Y|go-home|\"Dashboard plugin\";\"Dashboard\";\"<!DOCTYPE \
SKGML><parameters zoomPosition=\"\"0\"\"> <ITEM-1 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge bank plugin\"\" state=\"\"<!DOCTYPE SKGML>
<parameters \
menuOther="Y" menuCurrent="Y" menuFavorite="N" \
menuAssets="Y" menuInvestment="Y" \
menuCreditCard="Y"/>
\"\"/> <ITEM-2 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge operation plugin\"\" state=\"\"<!DOCTYPE \
SKGML>
<parameters menuTransfert="Y"/>
\"\"/> <ITEM-3 \
zoom=\"\"0\"\" index=\"\"1\"\" name=\"\"Skrooge operation plugin\"\" state=\"\"\"\"/> \
<ITEM-4 zoom=\"\"0\"\" index=\"\"0\"\" name=\"\"Skrooge scheduled plugin\"\" \
state=\"\"\"\"/> <ITEM-5 zoom=\"\"0\"\" index=\"\"0\"\" name=\"\"Skrooge search \
plugin\"\" state=\"\"<!DOCTYPE SKGML>
<parameters \
menuFavorite="N"/>
\"\"/> <ITEM-6 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge unit plugin\"\" state=\"\"<!DOCTYPE SKGML>
<parameters \
menuShares="Y" menuSharesOwnedOnly="N" \
menuIndexes="Y"/>
\"\"/> <ITEM-7 zoom=\"\"0\"\" index=\"\"0\"\" \
name=\"\"Skrooge calculator plugin\"\" state=\"\"\"\"/></parameters>\"" + << \
i18nc("Noun, bookmark name", "Report > Income vs Expenditure on 12 last months") % \
"|N|view-investment|\"Skrooge report plugin\";\"Rapport\";\"<!DOCTYPE \
SKGML><parameters expenses=\"\"Y\"\" tableAndGraphState=\"\"<!DOCTYPE \
SKGML>
<parameters graphMode="1" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff00000000000000020000025b0000032901000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="Y" linearRegressionVisible="Y" \
sortColumn="0" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"0\"\" period=\"\"3\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"t_TYPEEXPENSENLS\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"12\"\" forecastValue=\"\"20\"\" \
transfers=\"\"N\"\" currentPage=\"\"0\"\"/>\"" + << i18nc("Noun, bookmark \
name", "Report > Pie categories in 12 last months") % "|N|view-investment|\"Skrooge \
report plugin\";\"Rapport\";\"<!DOCTYPE SKGML><parameters expenses=\"\"Y\"\" \
tableAndGraphState=\"\"<!DOCTYPE SKGML>
<parameters graphMode="2" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff00000000000000020000025b0000032901000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="Y" linearRegressionVisible="Y" \
sortColumn="-1" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"0\"\" period=\"\"3\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"t_REALCATEGORY\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"12\"\" forecastValue=\"\"20\"\" \
transfers=\"\"N\"\" currentPage=\"\"0\"\"/>\"" + << i18nc("Noun, bookmark \
name", "Report > History") % "|N|view-investment|\"Skrooge report \
plugin\";\"Rapport\";\"<!DOCTYPE SKGML><parameters expenses=\"\"Y\"\" \
tableAndGraphState=\"\"<!DOCTYPE SKGML>
<parameters graphMode="1" \
graphicViewState="&lt;!DOCTYPE SKGML>&#xa;&lt;parameters \
isToolBarVisible=&quot;Y&quot; \
antialiasing=&quot;Y&quot;/>&#xa;" \
splitterState="000000ff0000000000000002000002b50000032601000000060100000001" \
bottomToolBarVisible="Y" filter="" legendVisible="N" \
allPositive="N" linearRegressionVisible="Y" \
sortColumn="-1" limitVisible="Y" web="&lt;!DOCTYPE \
SKGML>&#xa;&lt;parameters zoomFactor=&quot;0&quot;/>&#xa;" \
sortOrder="0"/>
\"\" mode=\"\"1\"\" period=\"\"0\"\" incomes=\"\"Y\"\" \
interval=\"\"2\"\" lines=\"\"#NOTHING#\"\" lines2=\"\"#NOTHING#\"\" \
nbLevelLines=\"\"0\"\" nbLevelColumns=\"\"0\"\" forecast=\"\"0\"\" \
columns=\"\"d_DATEMONTH\"\" nb_intervals=\"\"1\"\" forecastValue=\"\"20\"\" \
transfers=\"\"Y\"\" currentPage=\"\"0\"\"/>\"";
foreach(const QString & bk, bks) {
@@ -219,7 +219,7 @@ void SKGBookmarkPlugin::goHome()
for(int i = 0; i < nbAutoStartedBookmarks; i++) {
SKGNodeObject autostarted_bookmark = oNodeList.at(i);
autostarted_bookmark.load();
- SKGTRACEIN(10, "autostarting bookmark : " + autostarted_bookmark.getName());
+ SKGTRACEIN(10, "autostarting bookmark : " % autostarted_bookmark.getName());
SKGBookmarkPluginDockWidget::openBookmark(autostarted_bookmark, i > 0);
}
@@ -245,11 +245,11 @@ void SKGBookmarkPlugin::onShowBookmarkMenu()
//Build query
QString wc = "r_node_id=0 OR r_node_id IS NULL OR r_node_id=''";
int idParent = callerMenu->property("id").toInt();
- if(idParent != 0) wc = "r_node_id=" + SKGServices::intToString(idParent);
+ if(idParent != 0) wc = "r_node_id=" % SKGServices::intToString(idParent);
//Build new menu
SKGObjectBase::SKGListSKGObjectBase listNode;
- m_currentDocument->getObjects("v_node", wc + " ORDER BY f_sortorder, \
t_name", listNode); + m_currentDocument->getObjects("v_node", wc % " ORDER BY \
f_sortorder, t_name", listNode); int nb = listNode.count();
for(int i = 0; i < nb; ++i) {
SKGNodeObject node = listNode.at(i);
diff --git a/skg_bookmark/skgbookmarkplugindockwidget.cpp \
b/skg_bookmark/skgbookmarkplugindockwidget.cpp index 11c6a48..2ca05e2 100644
--- a/skg_bookmark/skgbookmarkplugindockwidget.cpp
+++ b/skg_bookmark/skgbookmarkplugindockwidget.cpp
@@ -312,8 +312,8 @@ void SKGBookmarkPluginDockWidget::onAddBookmark()
SKGBEGINTRANSACTION(*getDocument(), i18nc("Noun, name of the user action", \
"Bookmark creation '%1'", name), err);
err = SKGNodeObject::createPathNode(getDocument(), name, node, true);
if(err.isSucceeded()) {
- QString value = SKGServices::stringToCsv(currentPage->objectName()) + \
';' +
- SKGServices::stringToCsv(defaultName) + ';' +
+ QString value = SKGServices::stringToCsv(currentPage->objectName()) % \
';' % + SKGServices::stringToCsv(defaultName) % ';' %
SKGServices::stringToCsv(currentPage->getState());
err = node.setData(value);
@@ -432,7 +432,7 @@ void SKGBookmarkPluginDockWidget::onPageChanged()
QString id;
SKGTabPage* cPage = SKGMainPanel::getMainPanel()->currentPage();
if(cPage) id = cPage->getBookmarkID();
- ui.kBookmarksList->selectObject(id + "-node");
+ ui.kBookmarksList->selectObject(id % "-node");
}
void SKGBookmarkPluginDockWidget::resizeEvent(QResizeEvent *event)
diff --git a/skg_dashboard/skgdashboardpluginwidget.cpp \
b/skg_dashboard/skgdashboardpluginwidget.cpp index f0cdcec..fe9a3a8 100644
--- a/skg_dashboard/skgdashboardpluginwidget.cpp
+++ b/skg_dashboard/skgdashboardpluginwidget.cpp
@@ -51,7 +51,7 @@ SKGDashboardPluginWidget::SKGDashboardPluginWidget(SKGDocument* \
iDocument) const KAboutData* about = KCmdLineArgs::aboutData();
if(about) {
ui.kTitle->setPixmap(KIcon(about->programIconName()).pixmap(22, 22), \
KTitleWidget::ImageLeft);
- ui.kTitle->setComment("<html><body><b>" + i18nc("Message", "Welcome to %1", \
about->programName()) + "</b></body></html>"); + \
ui.kTitle->setComment("<html><body><b>" % i18nc("Message", "Welcome to %1", \
about->programName()) % "</b></body></html>"); }
//Floating panel
@@ -120,7 +120,7 @@ SKGDashboardPluginWidget::SKGDashboardPluginWidget(SKGDocument* \
iDocument)
QAction* act = \
m_addMenu->addAction(plugin->getDashboardWidgetTitle(j)); if(act) {
act->setIcon(KIcon(plugin->icon()));
- act->setData(QString(plugin->objectName() + '-' + \
SKGServices::intToString(j))); + \
act->setData(QString(plugin->objectName() % '-' % SKGServices::intToString(j)));
connect(act, SIGNAL(triggered(bool)), this, \
SLOT(onAddWidget())); }
@@ -161,7 +161,7 @@ QString SKGDashboardPluginWidget::getState()
int nb = m_items.count();
for(int i = 0; i < nb; ++i) {
- QDomElement element = doc.createElement("ITEM-" + SKGServices::intToString(i \
+ 1)); + QDomElement element = doc.createElement("ITEM-" % \
SKGServices::intToString(i + 1)); root.appendChild(element);
QStringList param = SKGServices::splitCSVLine(m_items.at(i), '-');
@@ -211,7 +211,7 @@ void SKGDashboardPluginWidget::setState(const QString& iState)
int index = 1;
while(index > 0) {
- QDomElement element = root.firstChildElement("ITEM-" + \
SKGServices::intToString(index)); + QDomElement element = \
root.firstChildElement("ITEM-" % SKGServices::intToString(index)); \
if(!element.isNull()) {
SKGInterfacePlugin* plugin = \
SKGMainPanel::getMainPanel()->getPluginByName(element.attribute("name")); QString \
index = element.attribute("index"); @@ -586,7 +586,7 @@ void \
SKGDashboardPluginWidget::addItem(SKGInterfacePlugin* iDashboard, int iInde QSize \
newSize(size.width()*ratio, size.height()*ratio); dbw->setMinimumSize(newSize);
- QString id = iDashboard->objectName() + '-' + \
SKGServices::intToString(iIndex); + QString id = iDashboard->objectName() \
% '-' % SKGServices::intToString(iIndex); m_items.push_back(id);
m_itemsPointers.push_back(dbw);
m_itemsSizes.push_back(iZoom);
diff --git a/skg_dashboard2/skgdashboard2pluginwidget.cpp \
b/skg_dashboard2/skgdashboard2pluginwidget.cpp index ba6f3ca..f6ecaad 100644
--- a/skg_dashboard2/skgdashboard2pluginwidget.cpp
+++ b/skg_dashboard2/skgdashboard2pluginwidget.cpp
@@ -80,7 +80,7 @@ SKGDashboard2PluginWidget::SKGDashboard2PluginWidget(SKGDocument* \
iDocument) // KMessageBox::information(this, iDocument->getFileExtension());
/*
if (!dataengine) {
- KMessageBox::error(this, dataengineName + " not found !");
+ KMessageBox::error(this, dataengineName % " not found !");
}
dataengine->connectAllSources(this, 10000);
diff --git a/skg_dataengine/skgdataengine.cpp b/skg_dataengine/skgdataengine.cpp
index b8a5f44..f3457b5 100644
--- a/skg_dataengine/skgdataengine.cpp
+++ b/skg_dataengine/skgdataengine.cpp
@@ -107,7 +107,7 @@ bool SKGDataEngine::getIncomeExpenditureData()
QString previousmonth = date.addMonths(-1).toString("yyyy-MM");
SKGStringListList data;
- SKGError err = document->executeSelectSqliteOrder("SELECT \
TOTAL(f_CURRENTAMOUNT), d_DATEMONTH FROM v_operation_display WHERE d_DATEMONTH IN ('" \
+ month + "', '" + previousmonth + "') AND i_group_id=0 group by d_DATEMONTH, \
t_TYPEEXPENSE", data); + SKGError err = document->executeSelectSqliteOrder("SELECT \
TOTAL(f_CURRENTAMOUNT), d_DATEMONTH FROM v_operation_display WHERE d_DATEMONTH IN ('" \
% month % "', '" % previousmonth % "') AND i_group_id=0 group by d_DATEMONTH, \
t_TYPEEXPENSE", data);
// We may receive an error from querying the SQLite database
diff --git a/skg_debug/skgdebugpluginwidget.cpp b/skg_debug/skgdebugpluginwidget.cpp
index adb4d31..0982f79 100644
--- a/skg_debug/skgdebugpluginwidget.cpp
+++ b/skg_debug/skgdebugpluginwidget.cpp
@@ -65,19 +65,19 @@ SKGDebugPluginWidget::SKGDebugPluginWidget(SKGDocument* \
iDocument)
iDocument->getDistinctValues("sqlite_master", "name", "type in ('table', \
'view')", tables); int nb = tables.count();
for(int i = 0; i < nb; ++i) {
- ui.kSQLInput->addItem("SELECT * FROM " + tables[i] + ';');
+ ui.kSQLInput->addItem("SELECT * FROM " % tables[i] % ';');
}
ui.kSQLInput->addItem("ANALYZE;");
ui.kSQLInput->addItem("PRAGMA integrity_check;");
for(int i = 0; i < nb; ++i) {
- ui.kSQLInput->addItem("PRAGMA table_info(" + tables[i] + ");");
- ui.kSQLInput->addItem("PRAGMA index_list(" + tables[i] + ");");
+ ui.kSQLInput->addItem("PRAGMA table_info(" % tables[i] % ");");
+ ui.kSQLInput->addItem("PRAGMA index_list(" % tables[i] % ");");
}
iDocument->getDistinctValues("sqlite_master", "name", "type='index'", tables);
nb = tables.count();
for(int i = 0; i < nb; ++i) {
- ui.kSQLInput->addItem("PRAGMA index_info(" + tables[i] + ");");
+ ui.kSQLInput->addItem("PRAGMA index_info(" % tables[i] % ");");
}
}
@@ -154,8 +154,8 @@ void SKGDebugPluginWidget::onExecuteSqlOrder(bool iInTransaction)
} else {
//SQL execution
QString text = ui.kSQLInput->currentText();
- if(exp == 1) text = "EXPLAIN " + text;
- else if(exp == 2) text = "EXPLAIN QUERY PLAN " + text;
+ if(exp == 1) text = "EXPLAIN " % text;
+ else if(exp == 2) text = "EXPLAIN QUERY PLAN " % text;
QString oResult;
double time = SKGServices::getMicroTime();
if(iInTransaction) {
diff --git a/skg_delete/skgdeleteplugin.cpp b/skg_delete/skgdeleteplugin.cpp
index af3655d..0074983 100644
--- a/skg_delete/skgdeleteplugin.cpp
+++ b/skg_delete/skgdeleteplugin.cpp
@@ -111,7 +111,7 @@ void SKGDeletePlugin::actionDelete()
if(err.isFailed() && err.getReturnCode() == ERR_FORCEABLE) {
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
int rc = KMessageBox::questionYesNo(SKGMainPanel::getMainPanel(),
- err.getFullMessage() + '\n' + \
i18nc("Question", "Do you want to force the deletion ?"), + \
err.getFullMessage() % '\n' % i18nc("Question", "Do you want to force the deletion \
?"),
i18nc("Question", "Do you want \
to force the deletion ?"),
KStandardGuiItem::yes(), \
KStandardGuiItem::no(), "forcedelete"
diff --git a/skg_file/skgfileplugin.cpp b/skg_file/skgfileplugin.cpp
index 63997cb..3755889 100644
--- a/skg_file/skgfileplugin.cpp
+++ b/skg_file/skgfileplugin.cpp
@@ -314,8 +314,8 @@ void SKGFilePlugin::actionSaveAs()
SKGError err;
SKGTRACEINRC(10, "SKGFilePlugin::actionSaveAs", err);
if(m_currentDocument && SKGMainPanel::getMainPanel()) {
- QString fileName = SKGMainPanel::getSaveFileName("kfiledialog:///" + \
m_currentDocument->objectName(),
- "*." + m_currentDocument->getFileExtension() + '|' + \
i18nc("Associated with the file extension : for example, .skg --> Skrooge document", \
"%1 document", KCmdLineArgs::aboutData()->programName()) , + QString fileName \
= SKGMainPanel::getSaveFileName("kfiledialog:///" % m_currentDocument->objectName(), \
+ "*." % m_currentDocument->getFileExtension() % '|' % \
i18nc("Associated with the file extension : for example, .skg --> Skrooge document", \
"%1 document", KCmdLineArgs::aboutData()->programName()) , \
SKGMainPanel::getMainPanel()); if(fileName.isEmpty()) return;
@@ -355,8 +355,8 @@ void SKGFilePlugin::actionOpen(const KUrl & iUrl)
QString pwd;
QString programName = KCmdLineArgs::aboutData()->programName();
QString fileName = iUrl.pathOrUrl();
- if(!fileName.length()) fileName = \
KFileDialog::getOpenUrl(KUrl("kfiledialog:///" + \
m_currentDocument->objectName()),
- "*." + \
m_currentDocument->getFileExtension() + '|' + i18nc("Associated with the file \
extension : for example, .skg --> Skrooge document", "%1 document", programName) , + \
if(!fileName.length()) fileName = KFileDialog::getOpenUrl(KUrl("kfiledialog:///" % \
m_currentDocument->objectName()), + "*." \
% m_currentDocument->getFileExtension() % '|' % i18nc("Associated with the file \
extension : for example, .skg --> Skrooge document", "%1 document", \
programName) ,
\
SKGMainPanel::getMainPanel()).pathOrUrl(); if(fileName.length()) {
//Check if temporary file exists
@@ -411,7 +411,7 @@ void SKGFilePlugin::actionOpen(const KUrl & iUrl)
if(!useKWallet) {
//Use password dialog
QPointer<KPasswordDialog> dlg = new \
KPasswordDialog(SKGMainPanel::getMainPanel());
- dlg->setPrompt(additionalMessage + i18nc("Question", "This \
file seems to be protected.\nPlease enter the password.")); + \
dlg->setPrompt(additionalMessage % i18nc("Question", "This file seems to be \
protected.\nPlease enter the password."));
if(dlg->exec() == QDialog::Accepted) pwd = dlg->password();
delete dlg;
}
diff --git a/skg_properties/skgpropertiesplugin.cpp \
b/skg_properties/skgpropertiesplugin.cpp index b8d1d19..e49b69d 100644
--- a/skg_properties/skgpropertiesplugin.cpp
+++ b/skg_properties/skgpropertiesplugin.cpp
@@ -139,7 +139,7 @@ void SKGPropertiesPlugin::onShowAddPropertyMenu()
QString table = sels.at(0).getRealTable();
SKGStringListList listTmp;
m_currentDocument->executeSelectSqliteOrder(
- "SELECT t_name, t_value FROM (SELECT t_name, t_value, COUNT(1) AS nb \
FROM parameters WHERE t_uuid_parent like '%-" + table + "' GROUP BY t_name, t_value) \
ORDER BY nb DESC LIMIT 7", + "SELECT t_name, t_value FROM (SELECT \
t_name, t_value, COUNT(1) AS nb FROM parameters WHERE t_uuid_parent like '%-" % table \
% "' GROUP BY t_name, t_value) ORDER BY nb DESC LIMIT 7", listTmp);
int nb = listTmp.count();
for(int i = 1; i < nb; ++i) {
diff --git a/skg_properties/skgpropertiesplugindockwidget.cpp \
b/skg_properties/skgpropertiesplugindockwidget.cpp index 1aeffab..af48b06 100644
--- a/skg_properties/skgpropertiesplugindockwidget.cpp
+++ b/skg_properties/skgpropertiesplugindockwidget.cpp
@@ -101,7 +101,7 @@ void SKGPropertiesPluginDockWidget::refresh()
for(int i = 0; i < nb; ++i) {
if(i > 0) filter += ',';
else tableName = selection.at(i).getRealTable();
- filter += '\'' + selection.at(i).getUniqueID() + '\'';
+ filter += '\'' % selection.at(i).getUniqueID() % '\'';
}
ui.kAdd->setEnabled(true);
@@ -111,8 +111,8 @@ void SKGPropertiesPluginDockWidget::refresh()
ui.kValue->setEnabled(true);
//Fill combo box
- SKGMainPanel::fillWithDistinctValue(ui.kAttribute, getDocument(), \
"parameters", "t_name", "t_uuid_parent like '%-" + tableName + '\'');
- SKGMainPanel::fillWithDistinctValue(ui.kValue, getDocument(), \
"parameters", "t_value", "t_uuid_parent like '%-" + tableName + '\''); + \
SKGMainPanel::fillWithDistinctValue(ui.kAttribute, getDocument(), "parameters", \
"t_name", "t_uuid_parent like '%-" % tableName % '\''); + \
SKGMainPanel::fillWithDistinctValue(ui.kValue, getDocument(), "parameters", \
"t_value", "t_uuid_parent like '%-" % tableName % '\''); } else {
filter += "'XXX'"; //Always false
ui.kAdd->setEnabled(false);
@@ -162,7 +162,7 @@ void SKGPropertiesPluginDockWidget::onSelectionChanged()
QByteArray blob_bytes = blob.toByteArray();
//Save temporary file
- QString fileName = QDir::tempPath() + '/' + \
obj.getAttribute("t_value"); + QString fileName = QDir::tempPath() \
% '/' % obj.getAttribute("t_value");
QFile file(fileName);
file.setPermissions(QFile::ReadOwner | QFile::WriteOwner);
@@ -207,7 +207,7 @@ void SKGPropertiesPluginDockWidget::onOpenFile()
if(!blob.isNull()) {
//Yes, this is a file
//Display temporary file
- QString fileName = QDir::tempPath() + '/' + \
obj.getAttribute("t_value"); + QString fileName = QDir::tempPath() \
% '/' % obj.getAttribute("t_value"); if(!QDesktopServices::openUrl(KUrl(fileName))) \
{
QString fileNameToSave = \
SKGMainPanel::getSaveFileName("kfiledialog:///IMPEXP", "" , \
SKGMainPanel::getMainPanel()); if(!fileNameToSave.isEmpty()) {
diff --git a/skgapplets/alarm/alarmskroogoid.cpp \
b/skgapplets/alarm/alarmskroogoid.cpp index 5db258a..9aa62c0 100644
--- a/skgapplets/alarm/alarmskroogoid.cpp
+++ b/skgapplets/alarm/alarmskroogoid.cpp
@@ -73,17 +73,17 @@ AlarmSkroogoid::AlarmSkroogoid(QObject *parent, const \
QVariantList &args) progressBar->setSizePolicy(sizePolicy);
//Set tooltip
- QString txt = alarm.Message + "<br>";
- txt += doc->formatMoney(alarm.Amount, primary) + " / " + \
doc->formatMoney(alarm.Limit, primary); + QString txt = alarm.Message \
% "<br>"; + txt += doc->formatMoney(alarm.Amount, primary) % " / " % \
doc->formatMoney(alarm.Limit, primary); if (!secondary.Symbol.isEmpty() && \
secondary.Value) {
- txt += "<br>" + doc->formatMoney(alarm.Amount, secondary) + " / \
" + doc->formatMoney(alarm.Limit, secondary); + txt += "<br>" % \
doc->formatMoney(alarm.Amount, secondary) % " / " % doc->formatMoney(alarm.Limit, \
secondary); }
progressBar->setToolTip(txt);
//Change color
double pourcent = 100 * alarm.Amount / alarm.Limit;
QString st = progressBar->styleSheet();
- st = QString(" QProgressBar { text-align: center; padding: 0.5px;} \
QProgressBar::chunk {text-align: center; border-radius:4px; background-color: ") + \
(pourcent < 70 ? "green" : (pourcent > 90 ? "red" : "yellow")) + ";}" + st; + \
st = QString(" QProgressBar { text-align: center; padding: 0.5px;} \
QProgressBar::chunk {text-align: center; border-radius:4px; background-color: ") + \
(pourcent < 70 ? "green" : (pourcent > 90 ? "red" : "yellow")) % ";}" % st; \
progressBar->setStyleSheet(st); pw = new QGraphicsProxyWidget();
pw->setWidget(progressBar);
diff --git a/skgapplets/bank/bankskroogoid.cpp b/skgapplets/bank/bankskroogoid.cpp
index 846a205..4eac5d2 100644
--- a/skgapplets/bank/bankskroogoid.cpp
+++ b/skgapplets/bank/bankskroogoid.cpp
@@ -53,7 +53,7 @@ BankSkroogoid::BankSkroogoid(QObject *parent, const QVariantList \
&args) if (err.isSucceeded()) {
QString html;
if (!nbAccount) {
- html = "<html><body>" + i18nc("Message", "First, you have to create \
at least one account<br>from <a href=\"___\">\"Bank and Account\"</a> page or <a \
href=\"__I\">import</a> operations.") + "</body></html>"; + html = \
"<html><body>" % i18nc("Message", "First, you have to create at least one \
account<br>from <a href=\"___\">\"Bank and Account\"</a> page or <a \
href=\"__I\">import</a> operations.") % "</body></html>"; } else {
//Build display
SKGStringListList listTmp;
@@ -68,16 +68,16 @@ BankSkroogoid::BankSkroogoid(QObject *parent, const QVariantList \
&args) QString name = listTmp.at(i).at(0);
double v1 = \
SKGServices::stringToDouble(listTmp.at(i).at(1)); if (abs(v1) > 0.1) {
- html += QString("<tr><td>") + \
SKGServices::stringToHtml(name) + "</td>"
- "<td align=\"right\"><font color=\"" + (v1 < 0 ? \
"red" : "black") + "\">"; + html += QString("<tr><td>") % \
SKGServices::stringToHtml(name) % "</td>" + "<td \
align=\"right\"><font color=\"" % (v1 < 0 ? "red" : "black") % "\">";
html += \
SKGServices::stringToHtml(locale->formatMoney(v1, primary.Symbol, \
primary.NbDecimal)); html += "</td></tr>";
sumV1 += v1;
}
}
- html += "<tr><td><b>" + SKGServices::stringToHtml(i18nc("Noun, \
the numerical total of a sum of values", "Total")) + "</b></td>"
- "<td align=\"right\"><b>" + doc->formatMoney(sumV1, \
primary) + "</b></td>" + html += "<tr><td><b>" % \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) % "</b></td>" + "<td align=\"right\"><b>" % \
doc->formatMoney(sumV1, primary) % "</b></td>" "</tr>";
html += "</table></body></html>";
}
diff --git a/skgapplets/calculator/calculatorskroogoid.cpp \
b/skgapplets/calculator/calculatorskroogoid.cpp index c80d802..de0d14c 100644
--- a/skgapplets/calculator/calculatorskroogoid.cpp
+++ b/skgapplets/calculator/calculatorskroogoid.cpp
@@ -56,7 +56,7 @@ CalculatorSkroogoid::CalculatorSkroogoid(QObject *parent, const \
QVariantList &ar double sum = 0;
for (int i = 0; i < nb; ++i) {
SKGAccountObject obj = objs.at(i);
- html += QString("<tr><td><a href=\"" + \
SKGServices::stringToHtml(obj.getName()) + "\">") + \
SKGServices::stringToHtml(obj.getName()) + "</a></td><td align=\"right\">"; + \
html += QString("<tr><td><a href=\"" % SKGServices::stringToHtml(obj.getName()) % \
"\">") % SKGServices::stringToHtml(obj.getName()) % "</a></td><td align=\"right\">"; \
QList<SKGAccountObject::SKGInterestItem> oInterestList;
double oInterests = 0;
@@ -66,8 +66,8 @@ CalculatorSkroogoid::CalculatorSkroogoid(QObject *parent, const \
QVariantList &ar html += doc->formatMoney(oInterests, primary);
html += "</td></tr>";
}
- html += "<tr><td><b>" + SKGServices::stringToHtml(i18nc("Noun, the \
numerical total of a sum of values", "Total")) + "</b></td>"
- "<td align=\"right\"><b>" + doc->formatMoney(sum, primary) + \
"</b></td>" + html += "<tr><td><b>" % \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) % "</b></td>" + "<td align=\"right\"><b>" % \
doc->formatMoney(sum, primary) % "</b></td>" "</tr>";
html += "</table>";
} else {
diff --git a/skgapplets/highlightedoperation/highlightedoperationskroogoid.cpp \
b/skgapplets/highlightedoperation/highlightedoperationskroogoid.cpp index \
ce469f2..00fe325 100644
--- a/skgapplets/highlightedoperation/highlightedoperationskroogoid.cpp
+++ b/skgapplets/highlightedoperation/highlightedoperationskroogoid.cpp
@@ -53,7 +53,7 @@ HighlightedOperationSkroogoid::HighlightedOperationSkroogoid(QObject \
*parent, co if (nb) {
for (int i = 0; i < nb; ++i) {
SKGOperationObject obj = objs.at(i);
- html += "<a href=\"" + SKGServices::intToString(obj.getID()) + \
"\">" + SKGServices::stringToHtml(obj.getDisplayName()) + "</a><br>"; + \
html += "<a href=\"" % SKGServices::intToString(obj.getID()) % "\">" % \
SKGServices::stringToHtml(obj.getDisplayName()) % "</a><br>"; }
} else {
html += i18nc("Message", "No operation highlighted<br>on the <a \
href=\"___\">\"Operations\"</a> page.");
diff --git a/skgapplets/operation/operationskroogoid.cpp \
b/skgapplets/operation/operationskroogoid.cpp index 79d733c..bffbcd5 100644
--- a/skgapplets/operation/operationskroogoid.cpp
+++ b/skgapplets/operation/operationskroogoid.cpp
@@ -101,7 +101,7 @@ OperationSkroogoid::OperationSkroogoid(QObject *parent, const \
QVariantList &args
SKGStringListList listTmp;
SKGError err = doc->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from \
v_operation_display WHERE d_DATEMONTH IN ('" + month + "', '" + previousmonth + "') \
AND i_group_id=0 group by d_DATEMONTH, t_TYPEEXPENSE", + \
"SELECT TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from v_operation_display WHERE \
d_DATEMONTH IN ('" % month % "', '" % previousmonth % "') AND i_group_id=0 group by \
d_DATEMONTH, t_TYPEEXPENSE", listTmp);
if (err.isSucceeded()) {
double income_previous_month = 0;
@@ -136,25 +136,25 @@ OperationSkroogoid::OperationSkroogoid(QObject *parent, const \
QVariantList &args //Set tool tips
QString tmp = doc->formatMoney(income_month, primary);
if (!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(income_month, secondary);
+ tmp += "<br>" % doc->formatMoney(income_month, secondary);
}
cincome_progress->setToolTip(tmp);
tmp = doc->formatMoney(income_previous_month, primary);
if (!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(income_previous_month, secondary);
+ tmp += "<br>" % doc->formatMoney(income_previous_month, secondary);
}
pincome_progress->setToolTip(tmp);
tmp = doc->formatMoney(expense_month, primary);
if (!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(expense_month, secondary);
+ tmp += "<br>" % doc->formatMoney(expense_month, secondary);
}
cexpenditure_progress->setToolTip(tmp);
tmp = doc->formatMoney(expense_previous_month, primary);
if (!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(expense_previous_month, secondary);
+ tmp += "<br>" % doc->formatMoney(expense_previous_month, secondary);
}
pexpenditure_progress->setToolTip(tmp);
}
diff --git a/skgapplets/scheduledoperation/scheduledoperationskroogoid.cpp \
b/skgapplets/scheduledoperation/scheduledoperationskroogoid.cpp index \
cca3c3e..1108327 100644
--- a/skgapplets/scheduledoperation/scheduledoperationskroogoid.cpp
+++ b/skgapplets/scheduledoperation/scheduledoperationskroogoid.cpp
@@ -50,7 +50,7 @@ ScheduledOperationSkroogoid::ScheduledOperationSkroogoid(QObject \
*parent, const if (nb) {
for (int i = 0; i < nb; ++i) {
SKGRecurrentOperationObject obj = objs.at(i);
- html += SKGServices::stringToHtml(obj.getDisplayName()) + "<br>";
+ html += SKGServices::stringToHtml(obj.getDisplayName()) % "<br>";
}
} else {
html += i18nc("Message", "No operation scheduled<br>on the <a \
href=\"___\">\"Operations\"</a> page.");
diff --git a/skgapplets/unit/unitskroogoid.cpp b/skgapplets/unit/unitskroogoid.cpp
index 30b8d2a..e8ce6f1 100644
--- a/skgapplets/unit/unitskroogoid.cpp
+++ b/skgapplets/unit/unitskroogoid.cpp
@@ -60,9 +60,9 @@ UnitSkroogoid::UnitSkroogoid(QObject *parent, const QVariantList \
&args) QString type = obj.getAttribute("t_TYPENLS");
if (lastTitle != type) {
lastTitle = type;
- html += "<tr><td><b>" + SKGServices::stringToHtml(lastTitle) \
+ "</b></td></tr>"; + html += "<tr><td><b>" % \
SKGServices::stringToHtml(lastTitle) % "</b></td></tr>"; }
- html += QString("<tr><td><a href=\"" + \
SKGServices::stringToHtml(obj.getSymbol()) + "\">") + \
SKGServices::stringToHtml(obj.getDisplayName()) + "</a></td><td align=\"right\">"; + \
html += QString("<tr><td><a href=\"" % SKGServices::stringToHtml(obj.getSymbol()) % \
"\">") % SKGServices::stringToHtml(obj.getDisplayName()) % "</a></td><td \
align=\"right\">"; QString unitSymbol = primary.Symbol;
if (obj.getType() == SKGUnitObject::INDEX) unitSymbol = ' ';
html += \
SKGServices::stringToHtml(locale->formatMoney(SKGServices::stringToDouble(obj.getAttribute("f_CURRENTAMOUNT")), \
unitSymbol , primary.NbDecimal));
diff --git a/skgbankgui/skgobjectmodel.cpp b/skgbankgui/skgobjectmodel.cpp
index 35e498b..e9d77f8 100644
--- a/skgbankgui/skgobjectmodel.cpp
+++ b/skgbankgui/skgobjectmodel.cpp
@@ -575,7 +575,7 @@ else return KIcon();
SKGObjectBase::SKGListSKGObjectBase subOps;
op.getSubOperations(subOps);
foreach(const SKGObjectBase & subOp, subOps) {
- toolTipString += subOp.getDisplayName() + '\n';
+ toolTipString += subOp.getDisplayName() % '\n';
}
}
} else if(att == "t_mode") {
@@ -593,7 +593,7 @@ else return KIcon();
foreach(const SKGOperationObject & gOp, gOps) {
SKGAccountObject account;
gOp.getParentAccount(account);
- toolTipString += account.getDisplayName() + '\n';
+ toolTipString += account.getDisplayName() % '\n';
}
}
}
diff --git a/skgbankgui/skgpredicatcreator.cpp b/skgbankgui/skgpredicatcreator.cpp
index 0ab5a4a..81cc97a 100644
--- a/skgbankgui/skgpredicatcreator.cpp
+++ b/skgbankgui/skgpredicatcreator.cpp
@@ -126,7 +126,7 @@ SKGPredicatCreator::SKGPredicatCreator(QWidget *parent, \
SKGDocument* document, c } else if(attribute.startsWith(QLatin1String("p_"))) {
realTable = "parameters";
realAtt = "t_value";
- realCond = "t_name='" + attribute.right(attribute.length() - 2) + \
'\''; + realCond = "t_name='" % attribute.right(attribute.length() - \
2) % '\''; }
SKGMainPanel::fillWithDistinctValue(cmbVal1, document, realTable, \
realAtt, realCond);
SKGMainPanel::fillWithDistinctValue(cmbVal2, document, realTable, \
realAtt, realCond);
diff --git a/skgbankmodeler/skgaccountobject.cpp \
b/skgbankmodeler/skgaccountobject.cpp index 75fd1c9..7312b8c 100644
--- a/skgbankmodeler/skgaccountobject.cpp
+++ b/skgbankmodeler/skgaccountobject.cpp
@@ -69,7 +69,7 @@ SKGError SKGAccountObject::setInitialBalance(double iBalance, const \
SKGUnitObjec SKGTRACEINRC(10, "SKGAccountObject::setInitialBalance", err);
if(getDocument()) {
//Delete previous initial balance for this account
- err = getDocument()->executeSqliteOrder("DELETE FROM operation WHERE \
d_date='0000-00-00' AND rd_account_id=" + SKGServices::intToString(getID())); + \
err = getDocument()->executeSqliteOrder("DELETE FROM operation WHERE \
d_date='0000-00-00' AND rd_account_id=" % SKGServices::intToString(getID()));
//Creation of new initial balance
if(err.isSucceeded()) {
@@ -100,7 +100,7 @@ SKGError SKGAccountObject::getInitialBalance(double& oBalance, \
SKGUnitObject& oU
//Get initial balance
SKGStringListList listTmp;
- err = getDocument()->executeSelectSqliteOrder("SELECT f_QUANTITY, t_UNIT FROM \
v_operation_consolidated WHERE d_date='0000-00-00' AND rd_account_id=" + \
SKGServices::intToString(getID()), listTmp); + err = \
getDocument()->executeSelectSqliteOrder("SELECT f_QUANTITY, t_UNIT FROM \
v_operation_consolidated WHERE d_date='0000-00-00' AND rd_account_id=" % \
SKGServices::intToString(getID()), listTmp); if(err.isSucceeded() && listTmp.count() \
> 1) { oBalance = SKGServices::stringToDouble(listTmp.at(1).at(0));
unitName = listTmp.at(1).at(1);
@@ -119,7 +119,7 @@ SKGError SKGAccountObject::setBank(const SKGBankObject& iBank)
SKGError SKGAccountObject::getBank(SKGBankObject& oBank) const
{
- SKGError err = getDocument()->getObject("v_bank", "id=" + \
getAttribute("rd_bank_id"), oBank); + SKGError err = \
getDocument()->getObject("v_bank", "id=" % getAttribute("rd_bank_id"), oBank); \
return err; }
@@ -177,7 +177,7 @@ SKGError SKGAccountObject::addOperation(SKGOperationObject& \
oOperation) int SKGAccountObject::getNbOperation() const
{
int nb = 0;
- if(getDocument()) getDocument()->getNbObjects("operation", "rd_account_id=" + \
SKGServices::intToString(getID()), nb); + if(getDocument()) \
getDocument()->getNbObjects("operation", "rd_account_id=" % \
SKGServices::intToString(getID()), nb); return nb;
}
@@ -186,7 +186,7 @@ SKGError SKGAccountObject::getOperations(SKGListSKGObjectBase& \
oOperations) cons SKGError err;
if(getDocument()) {
err = getDocument()->getObjects("v_operation",
- "rd_account_id=" + \
SKGServices::intToString(getID()) , + \
"rd_account_id=" % SKGServices::intToString(getID()) , oOperations);
}
return err;
@@ -203,7 +203,7 @@ double SKGAccountObject::getAmount(const QDate& iDate) const
if(getDocument()) {
SKGStringListList listTmp;
SKGError err = getDocument()->executeSelectSqliteOrder("SELECT \
TOTAL(f_QUANTITY), rc_unit_id FROM v_operation WHERE "
- "d_date<='" + SKGServices::dateToSqlString(QDateTime(iDate)) \
+ "' AND t_template='N' AND rd_account_id=" + SKGServices::intToString(getID()) + + \
"d_date<='" % SKGServices::dateToSqlString(QDateTime(iDate)) % "' AND t_template='N' \
AND rd_account_id=" % SKGServices::intToString(getID()) % " GROUP BY rc_unit_id",
listTmp);
int nb = listTmp.count();
@@ -212,7 +212,7 @@ double SKGAccountObject::getAmount(const QDate& iDate) const
QString unitid = listTmp.at(i).at(1);
double coef = 1;
- QString val = getDocument()->getCachedValue("unitvalue-" + unitid);
+ QString val = getDocument()->getCachedValue("unitvalue-" % unitid);
if(!val.isEmpty()) {
//Yes
coef = SKGServices::stringToDouble(val);
@@ -266,7 +266,7 @@ SKGError SKGAccountObject::getUnit(SKGUnitObject& oUnit) const
{
//Get initial amount
SKGStringListList listTmp;
- SKGError err = getDocument()->executeSelectSqliteOrder("SELECT t_UNIT FROM \
v_operation_consolidated WHERE d_date='0000-00-00' AND rd_account_id=" + \
SKGServices::intToString(getID()), listTmp); + SKGError err = \
getDocument()->executeSelectSqliteOrder("SELECT t_UNIT FROM v_operation_consolidated \
WHERE d_date='0000-00-00' AND rd_account_id=" % SKGServices::intToString(getID()), \
listTmp); if(err.isSucceeded()) {
//Is initial amount existing ?
if(listTmp.count() > 1) {
@@ -278,7 +278,7 @@ SKGError SKGAccountObject::getUnit(SKGUnitObject& oUnit) const
//No ==> we get the preferred unit
SKGObjectBase::SKGListSKGObjectBase units;
err = getDocument()->getObjects("v_unit",
- "t_type IN ('1', '2', 'C') AND \
EXISTS(SELECT 1 FROM operation WHERE rc_unit_id=v_unit.id AND rd_account_id=" + \
SKGServices::intToString(getID()) + ") ORDER BY t_type", units); + \
"t_type IN ('1', '2', 'C') AND EXISTS(SELECT 1 FROM operation WHERE \
rc_unit_id=v_unit.id AND rd_account_id=" % SKGServices::intToString(getID()) % ") \
ORDER BY t_type", units); int nb = units.count();
if(nb) oUnit = units.at(0);
}
@@ -300,7 +300,7 @@ SKGError SKGAccountObject::addInterest(SKGInterestObject& \
oInterest) SKGError SKGAccountObject::getInterests(SKGListSKGObjectBase& \
oInterestList) const {
SKGError err = getDocument()->getObjects("v_interest",
- "rd_account_id=" + SKGServices::intToString(getID()),
+ "rd_account_id=" % SKGServices::intToString(getID()),
oInterestList);
return err;
}
@@ -310,17 +310,17 @@ SKGError SKGAccountObject::getInterest(const QDate& iDate, \
SKGInterestObject& oI QString ids = SKGServices::intToString(getID());
QString dates = SKGServices::dateToSqlString(QDateTime(iDate));
SKGError err = SKGObjectBase::getDocument()->getObject("v_interest",
- "rd_account_id=" + ids + " AND d_date<='" + dates +
- "' AND ABS(strftime('%s','" + dates +
- "')-strftime('%s',d_date))=(SELECT MIN(ABS(strftime('%s','" + \
dates +
- "')-strftime('%s',u2.d_date))) FROM interest u2 WHERE \
u2.rd_account_id=" + ids +
- " AND u2.d_date<='" + dates + "')",
+ "rd_account_id=" % ids % " AND d_date<='" % dates %
+ "' AND ABS(strftime('%s','" % dates %
+ "')-strftime('%s',d_date))=(SELECT MIN(ABS(strftime('%s','" % \
dates % + "')-strftime('%s',u2.d_date))) FROM interest u2 WHERE \
u2.rd_account_id=" % ids % + " AND u2.d_date<='" % dates % "')",
oInterest);
//If not found then get first
if(err.isFailed()) err = SKGObjectBase::getDocument()->getObject("v_interest",
- "rd_account_id=" + \
SKGServices::intToString(getID()) + " AND d_date=(SELECT MIN(d_date) FROM interest \
WHERE rd_account_id=" +
- SKGServices::intToString(getID()) + ')',
+ "rd_account_id=" % \
SKGServices::intToString(getID()) % " AND d_date=(SELECT MIN(d_date) FROM interest \
WHERE rd_account_id=" % + \
SKGServices::intToString(getID()) % ')', oInterest);
return err;
}
@@ -341,9 +341,9 @@ SKGError \
SKGAccountObject::getInterestItems(QList<SKGAccountObject::SKGInterestI
//Add operations
SKGObjectBase::SKGListSKGObjectBase items;
- err = getDocument()->getObjects("v_operation", "rd_account_id=" + \
SKGServices::intToString(getID()) +
- " AND d_date>='" + \
SKGServices::dateToSqlString(QDateTime(initialDate)) + "' "
- " AND d_date<='" + \
SKGServices::dateToSqlString(QDateTime(lastDate)) + "' ORDER BY d_date", items); + \
err = getDocument()->getObjects("v_operation", "rd_account_id=" % \
SKGServices::intToString(getID()) % + " AND \
d_date>='" % SKGServices::dateToSqlString(QDateTime(initialDate)) % "' " + \
" AND d_date<='" % SKGServices::dateToSqlString(QDateTime(lastDate)) % "' ORDER BY \
d_date", items); int nb = items.count();
for(int i = 0; err.isSucceeded() && i < nb; ++i) {
SKGOperationObject ob = items.at(i);
@@ -364,9 +364,9 @@ SKGError \
SKGAccountObject::getInterestItems(QList<SKGAccountObject::SKGInterestI
//Add interest
if(err.isSucceeded()) {
- err = getDocument()->getObjects("v_interest", "rd_account_id=" + \
SKGServices::intToString(getID()) +
- " AND d_date>='" + \
SKGServices::dateToSqlString(QDateTime(initialDate)) + "' "
- " AND d_date<='" + \
SKGServices::dateToSqlString(QDateTime(lastDate)) + "' ORDER BY d_date", items); + \
err = getDocument()->getObjects("v_interest", "rd_account_id=" % \
SKGServices::intToString(getID()) % + " AND \
d_date>='" % SKGServices::dateToSqlString(QDateTime(initialDate)) % "' " + \
" AND d_date<='" % SKGServices::dateToSqlString(QDateTime(lastDate)) % "' ORDER BY \
d_date", items);
int pos = 0;
int nb = items.count();
@@ -568,14 +568,14 @@ SKGError \
SKGAccountObject::computeInterestItems(QList<SKGAccountObject::SKGInter \
SKGObjectBase object = interest.object; QString sqlinsert =
"INSERT INTO interest_result \
(d_date,d_valuedate,t_comment,f_currentamount,f_coef,f_rate,f_annual_interest,f_accrued_interest) \
"
- " VALUES ('" + \
SKGServices::dateToSqlString(QDateTime(interest.date)) +
- "','" + SKGServices::dateToSqlString(QDateTime(interest.valueDate)) \
+
- "','" + SKGServices::stringToSqlString(object.getRealTable() == \
"operation" ? i18nc("Noun", "Relative to operation '%1'", \
SKGOperationObject(object).getDisplayName()) : i18nc("Noun", "Rate \
change")) +
- "'," + SKGServices::doubleToString(interest.amount) +
- ',' + SKGServices::doubleToString(interest.coef) +
- ',' + SKGServices::doubleToString(interest.rate) +
- ',' + SKGServices::doubleToString(interest.annualInterest) +
- ',' + SKGServices::doubleToString(interest.accruedInterest) +
+ " VALUES ('" % \
SKGServices::dateToSqlString(QDateTime(interest.date)) % + "','" % \
SKGServices::dateToSqlString(QDateTime(interest.valueDate)) % + "','" \
% SKGServices::stringToSqlString(object.getRealTable() == "operation" ? i18nc("Noun", \
"Relative to operation '%1'", SKGOperationObject(object).getDisplayName()) : \
i18nc("Noun", "Rate change")) % + "'," % \
SKGServices::doubleToString(interest.amount) % + ',' % \
SKGServices::doubleToString(interest.coef) % + ',' % \
SKGServices::doubleToString(interest.rate) % + ',' % \
SKGServices::doubleToString(interest.annualInterest) % + ',' % \
SKGServices::doubleToString(interest.accruedInterest) % ")";
err = getDocument()->executeSqliteOrder(sqlinsert);
@@ -606,7 +606,7 @@ SKGError SKGAccountObject::autoReconcile(double iBalance)
double balance = 0;
SKGStringListList listTmp2;
err = getDocument()->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CHECKED) from v_account_display WHERE id=" + \
SKGServices::intToString(getID()), + "SELECT TOTAL(f_CHECKED) from \
v_account_display WHERE id=" % SKGServices::intToString(getID()), listTmp2);
if(listTmp2.count() == 2) balance = \
SKGServices::stringToDouble(listTmp2.at(1).at(0)) / unit1.Value;
@@ -614,7 +614,7 @@ SKGError SKGAccountObject::autoReconcile(double iBalance)
//Get all imported operation
double diff = balance - iBalance;
SKGObjectBase::SKGListSKGObjectBase operations;
- if(err.isSucceeded()) err = getDocument()->getObjects("v_operation", \
"rd_account_id=" + SKGServices::intToString(getID()) + " AND t_status='N' AND \
t_template='N' AND t_imported IN ('Y','P') ORDER BY d_date, id", operations); + \
if(err.isSucceeded()) err = getDocument()->getObjects("v_operation", "rd_account_id=" \
% SKGServices::intToString(getID()) % " AND t_status='N' AND t_template='N' AND \
t_imported IN ('Y','P') ORDER BY d_date, id", operations);
//Comparison
diff --git a/skgbankmodeler/skgbankobject.cpp b/skgbankmodeler/skgbankobject.cpp
index 6cb5572..912c29b 100644
--- a/skgbankmodeler/skgbankobject.cpp
+++ b/skgbankmodeler/skgbankobject.cpp
@@ -76,7 +76,7 @@ SKGError SKGBankObject::addAccount(SKGAccountObject& oAccount)
SKGError SKGBankObject::getAccounts(SKGListSKGObjectBase& oAccountList) const
{
SKGError err = getDocument()->getObjects("v_account",
- "rd_bank_id=" + SKGServices::intToString(getID()),
+ "rd_bank_id=" % SKGServices::intToString(getID()),
oAccountList);
return err;
}
diff --git a/skgbankmodeler/skgbudgetobject.cpp b/skgbankmodeler/skgbudgetobject.cpp
index 68c0d75..2fdf368 100644
--- a/skgbankmodeler/skgbudgetobject.cpp
+++ b/skgbankmodeler/skgbudgetobject.cpp
@@ -59,9 +59,9 @@ QString SKGBudgetObject::getWhereclauseId() const
//Could we use the id
QString output = SKGObjectBase::getWhereclauseId();
if(output.isEmpty()) {
- output = "i_year=" + getAttribute("i_year") + " AND "
- "i_month=" + getAttribute("i_month") + " AND "
- "rc_category_id=" + (getAttribute("rc_category_id").isEmpty() ? "0" \
: getAttribute("rc_category_id")); + output = "i_year=" % \
getAttribute("i_year") % " AND " + "i_month=" % \
getAttribute("i_month") % " AND " + "rc_category_id=" % \
(getAttribute("rc_category_id").isEmpty() ? "0" : getAttribute("rc_category_id")); }
return output;
}
@@ -115,7 +115,7 @@ SKGError SKGBudgetObject::setCategory(const SKGCategoryObject& \
iCategory)
SKGError SKGBudgetObject::getCategory(SKGCategoryObject& oCategory) const
{
- return getDocument()->getObject("v_category", "id=" + \
getAttribute("rc_category_id"), oCategory); + return \
getDocument()->getObject("v_category", "id=" % getAttribute("rc_category_id"), \
oCategory);
}
@@ -146,9 +146,9 @@ SKGError SKGBudgetObject::process()
//Get budgets rules ordered
SKGObjectBase::SKGListSKGObjectBase budgetsRules;
- QString sql = "(t_year_condition='N' OR i_year=" + SKGServices::intToString(y) + \
") AND "
- "(t_month_condition='N' OR i_month=" + SKGServices::intToString(m) \
+ ") AND "
- "(t_category_condition='N' OR rc_category_id=" + \
getAttribute("rc_category_id") + ") " + QString sql = "(t_year_condition='N' OR \
i_year=" % SKGServices::intToString(y) % ") AND " + \
"(t_month_condition='N' OR i_month=" % SKGServices::intToString(m) % ") AND " + \
"(t_category_condition='N' OR rc_category_id=" % getAttribute("rc_category_id") % ") \
" "ORDER BY t_absolute DESC, id";
err = getDocument()->getObjects("v_budgetrule", sql, budgetsRules);
@@ -231,7 +231,7 @@ SKGError SKGBudgetObject::createAutomaticBudget(SKGDocumentBank* \
iDocument, int if(iDocument) {
SKGStringListList listTmp;
err = iDocument->executeSelectSqliteOrder(
- "SELECT MIN(STRFTIME('%m', d_date)) FROM operation WHERE \
i_group_id = 0 AND STRFTIME('%Y', d_date) = '" + baseYear + + \
"SELECT MIN(STRFTIME('%m', d_date)) FROM operation WHERE i_group_id = 0 AND \
STRFTIME('%Y', d_date) = '" % baseYear % "' AND t_template='N'",
listTmp);
if(listTmp.count() == 2) fistMonth = \
SKGServices::stringToInt(listTmp.at(1).at(0)); @@ -239,11 +239,11 @@ SKGError \
SKGBudgetObject::createAutomaticBudget(SKGDocumentBank* iDocument, int \
if(err.isSucceeded() && iDocument) { SKGStringListList listTmp;
QString sql = "SELECT t_REALCATEGORY, COUNT(TOT),"
- "100*COUNT(TOT)/((CASE WHEN STRFTIME('%Y', date('now'))<>'" + \
baseYear + "' THEN 12 ELSE STRFTIME('%m', date('now'))-1 END)-" +
- SKGServices::intToString(fistMonth) + "+1) AS CPOUR,"
+ "100*COUNT(TOT)/((CASE WHEN STRFTIME('%Y', date('now'))<>'" % \
baseYear % "' THEN 12 ELSE STRFTIME('%m', date('now'))-1 END)-" % + \
SKGServices::intToString(fistMonth) % "+1) AS CPOUR,"
"ROUND(TOTAL(TOT)/COUNT(TOT)), MAX(MONTH), TOTAL(TOT) FROM ("
"SELECT t_REALCATEGORY, STRFTIME('%m', d_date) AS MONTH, \
TOTAL(f_REALCURRENTAMOUNT) AS TOT "
- "FROM v_operation_consolidated WHERE i_group_id = 0 AND \
d_DATEYEAR = '" + baseYear + "' AND d_DATEMONTH<STRFTIME('%Y-%m', date('now')) " + \
"FROM v_operation_consolidated WHERE i_group_id = 0 AND d_DATEYEAR = '" % baseYear % \
"' AND d_DATEMONTH<STRFTIME('%Y-%m', date('now')) " "GROUP BY t_REALCATEGORY, \
d_DATEMONTH" ") GROUP BY t_REALCATEGORY ORDER BY COUNT(TOT) DESC, \
(MAX(TOT)-MIN(TOT))/ABS(ROUND(TOTAL(TOT)/COUNT(TOT))) ASC, \
ROUND(TOTAL(TOT)/COUNT(TOT)) ASC"; err = iDocument->executeSelectSqliteOrder(sql, \
listTmp); @@ -258,7 +258,7 @@ SKGError \
SKGBudgetObject::createAutomaticBudget(SKGDocumentBank* iDocument, int
//Remove previous budgets
if(iRemovePreviousBudget) {
- if(err.isSucceeded()) err = iDocument->executeSqliteOrder("DELETE \
FROM budget WHERE i_year=" + SKGServices::intToString(iYear)); + \
if(err.isSucceeded()) err = iDocument->executeSqliteOrder("DELETE FROM budget WHERE \
i_year=" % SKGServices::intToString(iYear)); ++step;
if(err.isSucceeded()) err = iDocument->stepForward(step);
}
@@ -275,7 +275,7 @@ SKGError SKGBudgetObject::createAutomaticBudget(SKGDocumentBank* \
iDocument, int
if(!catName.isEmpty() && (countPourcent > 85 || count == 1)) {
SKGCategoryObject cat;;
- err = iDocument->getObject("v_category", "t_fullname = '" + \
SKGServices::stringToSqlString(catName) + '\'', cat); + err = \
iDocument->getObject("v_category", "t_fullname = '" % \
SKGServices::stringToSqlString(catName) % '\'', cat);
for(int m = fistMonth; err.isSucceeded() && m <= (count == 1 ? \
fistMonth : 12); ++m) { SKGBudgetObject budget(iDocument);
err = budget.setBudgetedAmount(amount);
@@ -314,7 +314,7 @@ SKGError SKGBudgetObject::balanceBudget(SKGDocumentBank* \
iDocument, int iYear, i if(err.isSucceeded() && iMonth != -1) {
for(int m = (iMonth == 0 ? 1 : iMonth); err.isSucceeded() && m <= \
(iMonth == 0 ? 12 : iMonth); ++m) { SKGStringListList listTmp;
- err = iDocument->executeSelectSqliteOrder("SELECT TOTAL(f_budgeted) \
FROM budget WHERE i_year=" + SKGServices::intToString(iYear) + " AND i_month=" + \
SKGServices::intToString(m) + " AND rc_category_id<>0", listTmp) ; + \
err = iDocument->executeSelectSqliteOrder("SELECT TOTAL(f_budgeted) FROM budget WHERE \
i_year=" % SKGServices::intToString(iYear) % " AND i_month=" % \
SKGServices::intToString(m) % " AND rc_category_id<>0", listTmp) ; \
if(err.isSucceeded() && listTmp.count() == 2) { SKGBudgetObject budget(iDocument);
double amount = \
-SKGServices::stringToDouble(listTmp.at(1).at(0)); @@ -330,7 +330,7 @@ SKGError \
SKGBudgetObject::balanceBudget(SKGDocumentBank* iDocument, int iYear, i //Annual \
balancing if(err.isSucceeded() && iBalanceYear) {
SKGStringListList listTmp;
- err = iDocument->executeSelectSqliteOrder("SELECT TOTAL(f_budgeted) FROM \
budget WHERE i_year=" + SKGServices::intToString(iYear) + " AND (i_month<>0 OR \
rc_category_id<>0)", listTmp) ; + err = \
iDocument->executeSelectSqliteOrder("SELECT TOTAL(f_budgeted) FROM budget WHERE \
i_year=" % SKGServices::intToString(iYear) % " AND (i_month<>0 OR \
rc_category_id<>0)", listTmp) ; if(err.isSucceeded() && listTmp.count() == 2) {
SKGBudgetObject budget(iDocument);
double amount = -SKGServices::stringToDouble(listTmp.at(1).at(0));
diff --git a/skgbankmodeler/skgbudgetruleobject.cpp \
b/skgbankmodeler/skgbudgetruleobject.cpp index 34e1444..71325a1 100644
--- a/skgbankmodeler/skgbudgetruleobject.cpp
+++ b/skgbankmodeler/skgbudgetruleobject.cpp
@@ -111,7 +111,7 @@ SKGError SKGBudgetRuleObject::setBudgetCategory(const \
SKGCategoryObject& iCatego
SKGError SKGBudgetRuleObject::getBudgetCategory(SKGCategoryObject& oCategory) const
{
- return getDocument()->getObject("v_category", "id=" + \
getAttribute("rc_category_id"), oCategory); + return \
getDocument()->getObject("v_category", "id=" % getAttribute("rc_category_id"), \
oCategory); }
SKGError SKGBudgetRuleObject::removeBudgetCategory()
@@ -170,7 +170,7 @@ SKGBudgetRuleObject::Mode SKGBudgetRuleObject::getTransferMode() \
const
SKGError SKGBudgetRuleObject::getTransferCategory(SKGCategoryObject& oCategory) \
const {
- return getDocument()->getObject("v_category", "id=" + \
getAttribute("rc_category_id_target"), oCategory); + return \
getDocument()->getObject("v_category", "id=" % getAttribute("rc_category_id_target"), \
oCategory); }
SKGError SKGBudgetRuleObject::processAllRules(SKGDocumentBank* iDocument)
diff --git a/skgbankmodeler/skgcategoryobject.cpp \
b/skgbankmodeler/skgcategoryobject.cpp index 302ca49..30978bc 100644
--- a/skgbankmodeler/skgcategoryobject.cpp
+++ b/skgbankmodeler/skgcategoryobject.cpp
@@ -69,12 +69,12 @@ QString SKGCategoryObject::getWhereclauseId() const
QString output = SKGObjectBase::getWhereclauseId();
if(output.isEmpty()) {
if(!(getAttribute("t_name").isEmpty())) {
- output = "t_name='" + \
SKGServices::stringToSqlString(getAttribute("t_name")) + '\''; + output = \
"t_name='" % SKGServices::stringToSqlString(getAttribute("t_name")) % '\''; }
QString r_category_id = getAttribute("r_category_id");
if(!output.isEmpty()) output += " AND ";
if(r_category_id.isEmpty()) output += "(r_category_id=0 OR r_category_id IS \
NULL OR r_category_id='')";
- else output += "r_category_id=" + r_category_id;
+ else output += "r_category_id=" % r_category_id;
}
return output;
}
@@ -98,7 +98,7 @@ SKGError SKGCategoryObject::createPathCategory(SKGDocumentBank* \
iDocument, oCategory = SKGCategoryObject(NULL, 0);
} else if(iDocument) {
- if(!iRenameIfAlreadyExist && iDocument) iDocument->getObject("v_category", \
"t_fullname='" + SKGServices::stringToSqlString(iFullPath) + '\'', oCategory); + \
if(!iRenameIfAlreadyExist && iDocument) iDocument->getObject("v_category", \
"t_fullname='" % SKGServices::stringToSqlString(iFullPath) % '\'', oCategory); \
if(oCategory.getID() == 0) { //No, we have to create it
//Search category separator
@@ -112,7 +112,7 @@ SKGError SKGCategoryObject::createPathCategory(SKGDocumentBank* \
iDocument, int index = 1;
while(err.isSucceeded() && oCategory.exist()) {
index++;
- err = oCategory.setName(iFullPath + " (" + \
SKGServices::intToString(index) + ')'); + err = \
oCategory.setName(iFullPath % " (" % SKGServices::intToString(index) % ')'); }
}
@@ -137,7 +137,7 @@ SKGError SKGCategoryObject::createPathCategory(SKGDocumentBank* \
iDocument, if(err.isSucceeded() && iRenameIfAlreadyExist) {
int index = 2;
while(err.isSucceeded() && oCategory.exist()) {
- err = oCategory.setName(second + " (" + \
SKGServices::intToString(index) + ')'); + err = \
oCategory.setName(second % " (" % SKGServices::intToString(index) % ')'); ++index;
}
}
@@ -200,7 +200,7 @@ SKGError SKGCategoryObject::getParentCategory(SKGCategoryObject& \
oCategory) cons {
SKGError err;
QString parent_id = getAttribute("r_category_id");
- if(!parent_id.isEmpty()) err = getDocument()->getObject("v_category", "id=" + \
parent_id , oCategory); + if(!parent_id.isEmpty()) err = \
getDocument()->getObject("v_category", "id=" % parent_id , oCategory); return err;
}
@@ -225,7 +225,7 @@ SKGError SKGCategoryObject::getRootCategory(SKGCategoryObject& \
oCategory) const SKGError SKGCategoryObject::getCategories(SKGListSKGObjectBase& \
oCategoryList) const {
return getDocument()->getObjects("v_category",
- "r_category_id=" + \
SKGServices::intToString(getID()), + \
"r_category_id=" % SKGServices::intToString(getID()), oCategoryList);
}
@@ -238,7 +238,7 @@ double SKGCategoryObject::getCurrentAmount() const
SKGError SKGCategoryObject::getSubOperations(SKGListSKGObjectBase& oSubOperations) \
const {
SKGError err = getDocument()->getObjects("v_suboperation",
- "r_category_id=" + SKGServices::intToString(getID()) ,
+ "r_category_id=" % SKGServices::intToString(getID()) ,
oSubOperations);
return err;
}
diff --git a/skgbankmodeler/skgdocumentbank.cpp b/skgbankmodeler/skgdocumentbank.cpp
index 7b5a9f4..b8f0e71 100644
--- a/skgbankmodeler/skgdocumentbank.cpp
+++ b/skgbankmodeler/skgdocumentbank.cpp
@@ -78,7 +78,7 @@ SKGError SKGDocumentBank::computeBudgetCategoriesLinks()
"FROM budget b, category c WHERE "
"((b.rc_category_id<>0 AND \
(c.id=b.rc_category_id OR " "(b.t_including_subcategories='Y' AND c.t_fullname LIKE \
(SELECT c2.t_fullname FROM category c2 WHERE \
c2.id=b.rc_category_id)||'"
- + OBJECTSEPARATOR + "%')) OR \
(b.rc_category_id=0 AND c.id NOT IN (SELECT b2.rc_category_id FROM budget b2 WHERE \
b2.i_year=b.i_year AND " + % OBJECTSEPARATOR % \
"%')) OR (b.rc_category_id=0 AND c.id NOT IN (SELECT b2.rc_category_id FROM budget b2 \
WHERE b2.i_year=b.i_year AND "
"(b2.i_month=b.i_month OR b.i_month=0) AND \
b2.id<>b.id))))");
return err;
@@ -118,10 +118,10 @@ SKGError SKGDocumentBank::computeBalances()
sum += val;
err = this->executeSqliteOrder("INSERT INTO operationbalance \
(id,f_balance,r_operation_id) "
- "VALUES (" +
- SKGServices::intToString(i) + ',' +
- SKGServices::doubleToString(sum) + ',' +
- idOp +
+ "VALUES (" %
+ SKGServices::intToString(i) % ',' %
+ SKGServices::doubleToString(sum) % ',' %
+ idOp %
")");
}
}
@@ -164,7 +164,7 @@ SKGError SKGDocumentBank::endTransaction(bool succeedded)
QString SKGDocumentBank::getViewsIndexesAndTriggersVersion()
{
- return "2011.04.09_" + getParameter("SKG_LANGUAGE");
+ return "2011.04.09_" % getParameter("SKG_LANGUAGE");
}
SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
@@ -218,7 +218,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER cpt_category_fullname1 "
"AFTER INSERT ON category BEGIN "
"UPDATE category SET t_fullname="
- "CASE WHEN r_category_id IS NULL OR r_category_id='' OR r_category_id=0 \
THEN new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE \
c.id=new.r_category_id)||'" + OBJECTSEPARATOR + "'||new.t_name END " + \
"CASE WHEN r_category_id IS NULL OR r_category_id='' OR r_category_id=0 THEN \
new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE \
c.id=new.r_category_id)||'" % OBJECTSEPARATOR % "'||new.t_name END " "WHERE \
id=new.id;" "END"
@@ -226,7 +226,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER cpt_category_fullname2 "
"AFTER UPDATE OF t_name, r_category_id ON category BEGIN "
"UPDATE category SET t_fullname="
- "CASE WHEN r_category_id IS NULL OR r_category_id='' OR r_category_id=0 \
THEN new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE \
c.id=new.r_category_id)||'" + OBJECTSEPARATOR + "'||new.t_name END " + \
"CASE WHEN r_category_id IS NULL OR r_category_id='' OR r_category_id=0 THEN \
new.t_name ELSE (SELECT c.t_fullname FROM category c WHERE \
c.id=new.r_category_id)||'" % OBJECTSEPARATOR % "'||new.t_name END " "WHERE \
id=new.id;"
"UPDATE category SET t_name=t_name WHERE r_category_id=new.id;"
"END"
@@ -236,7 +236,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER fkdc_category_parent_id_category_id "
"BEFORE DELETE ON category "
"FOR EACH ROW BEGIN "
- " DELETE FROM category WHERE category.t_fullname LIKE \
OLD.t_fullname||'" + OBJECTSEPARATOR + "%'; " + " DELETE FROM category \
WHERE category.t_fullname LIKE OLD.t_fullname||'" % OBJECTSEPARATOR % "%'; " "END "
//-- Reparent suboperation on parent category when a category is removed
@@ -330,12 +330,12 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"(SELECT count(1) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS \
i_NBVALUES, " "(CASE WHEN unit.rd_unit_id=0 THEN '' ELSE (SELECT (CASE WHEN \
s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE \
s.id=unit.rd_unit_id) END) AS t_UNIT," "(CASE unit.t_type "
- "WHEN '1' THEN '" + SKGServices::stringToSqlString(i18nc("Noun", \
"Primary currency")) + "' "
- "WHEN '2' THEN '" + SKGServices::stringToSqlString(i18nc("Noun", \
"Secondary currency")) + "' "
- "WHEN 'C' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, a \
country's currency", "Currency")) + "' "
- "WHEN 'S' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, a \
financial share, as in a stock market", "Share")) + "' "
- "WHEN 'I' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, a \
financial index like the Dow Jones, NASDAQ, CAC40...", "Index")) + "' \
"
- "ELSE '" + SKGServices::stringToSqlString(i18nc("Noun, a physical object \
like a house or a car", "Object")) + "' END) AS t_TYPENLS, " + "WHEN '1' \
THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Primary currency")) % "' " + \
"WHEN '2' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Secondary \
currency")) % "' " + "WHEN 'C' THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun, a country's currency", "Currency")) % "' \
" + "WHEN 'S' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a \
financial share, as in a stock market", "Share")) % "' " + "WHEN 'I' THEN \
'" % SKGServices::stringToSqlString(i18nc("Noun, a financial index like the Dow \
Jones, NASDAQ, CAC40...", "Index")) % "' " + "ELSE '" % \
SKGServices::stringToSqlString(i18nc("Noun, a physical object like a house or a car", \
"Object")) % "' END) AS t_TYPENLS, "
"(SELECT MIN(s.d_date) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS \
d_MINDATE, "
"(SELECT MAX(s.d_date) FROM unitvalue s WHERE s.rd_unit_id=unit.id) AS \
d_MAXDATE " "from unit"
@@ -352,7 +352,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
//unitvalue
<< "CREATE VIEW v_unitvalue_displayname AS "
- "SELECT *, (SELECT t_displayname FROM v_unit_displayname WHERE \
unitvalue.rd_unit_id=v_unit_displayname.id)||' '||STRFTIME('" + dateFormatShort + \
"',d_date) AS t_displayname FROM unitvalue" + "SELECT *, (SELECT \
t_displayname FROM v_unit_displayname WHERE \
unitvalue.rd_unit_id=v_unit_displayname.id)||' '||STRFTIME('" % dateFormatShort % \
"',d_date) AS t_displayname FROM unitvalue"
<< "CREATE VIEW v_unitvalue AS "
"SELECT * "
@@ -387,15 +387,15 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"FROM v_operation_tmp1"
<< "CREATE VIEW v_operation_displayname AS "
- "SELECT *, STRFTIME('" + dateFormatShort + "',d_date)||' \
'||IFNULL(t_PAYEE,'')||' '||"
- + (negativePrefixCurrencySymbol ? "(SELECT (CASE WHEN s.t_symbol!='' \
THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE s.id=v_operation.rc_unit_id)||' \
'||" : "") + + "SELECT *, STRFTIME('" % dateFormatShort % "',d_date)||' \
'||IFNULL(t_PAYEE,'')||' '||" + % (negativePrefixCurrencySymbol ? "(SELECT \
(CASE WHEN s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE \
s.id=v_operation.rc_unit_id)||' '||" : "") % "v_operation.f_CURRENTAMOUNT"
- + (!negativePrefixCurrencySymbol ? "||' '||(SELECT (CASE WHEN \
s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM unit s WHERE \
s.id=v_operation.rc_unit_id)" : "") + + % (!negativePrefixCurrencySymbol ? \
"||' '||(SELECT (CASE WHEN s.t_symbol!='' THEN s.t_symbol ELSE s.t_name END) FROM \
unit s WHERE s.id=v_operation.rc_unit_id)" : "") % " AS t_displayname FROM \
v_operation"
<< "CREATE VIEW v_operation_delete AS "
- "SELECT *, (CASE WHEN t_status='Y' THEN '" +
- SKGServices::stringToSqlString(i18nc("Error message", "You are not \
authorized to delete this operation because in \"checked\" status")) + + \
"SELECT *, (CASE WHEN t_status='Y' THEN '" % + \
SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to \
delete this operation because in \"checked\" status")) % "' END) t_delete_message \
FROM operation"
//account
@@ -407,8 +407,8 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"FROM account"
<< "CREATE VIEW v_account_delete AS "
- "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE \
rd_account_id=account.id AND t_status='Y') THEN '" +
- SKGServices::stringToSqlString(i18nc("Error message", "You are not \
authorized to delete this account because it contains some checked operations")) + + \
"SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE rd_account_id=account.id \
AND t_status='Y') THEN '" % + SKGServices::stringToSqlString(i18nc("Error \
message", "You are not authorized to delete this account because it contains some \
checked operations")) % "' END) t_delete_message FROM account"
//bank
@@ -433,11 +433,11 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
//recurrentoperation
<< "CREATE VIEW v_recurrentoperation AS "
"SELECT *,"
- "i_period_increment||' '||(CASE t_period_unit WHEN 'Y' THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "year(s)")) + "' WHEN 'M' THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "month(s)")) + "' ELSE '" + \
SKGServices::stringToSqlString(i18nc("Noun", "day(s)")) + "' END) AS t_PERIODNLS " + \
"i_period_increment||' '||(CASE t_period_unit WHEN 'Y' THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun", "year(s)")) % "' WHEN 'M' THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun", "month(s)")) % "' ELSE '" % \
SKGServices::stringToSqlString(i18nc("Noun", "day(s)")) % "' END) AS t_PERIODNLS " \
"FROM recurrentoperation"
<< "CREATE VIEW v_recurrentoperation_displayname AS "
- "SELECT *, STRFTIME('" + dateFormatShort + "',d_date)||' \
'||SUBSTR((SELECT t_displayname FROM v_operation_displayname WHERE \
v_operation_displayname.id=v_recurrentoperation.rd_operation_id), 11) AS \
t_displayname FROM v_recurrentoperation" + "SELECT *, STRFTIME('" % \
dateFormatShort % "',d_date)||' '||SUBSTR((SELECT t_displayname FROM \
v_operation_displayname WHERE \
v_operation_displayname.id=v_recurrentoperation.rd_operation_id), 11) AS \
t_displayname FROM v_recurrentoperation"
// ==================================================================
//These following views contains all attributes needed for display
@@ -470,7 +470,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"(SELECT s.t_CATEGORY FROM v_suboperation_display s WHERE \
s.id=v_operation.i_MOSTIMPSUBOP) AS t_CATEGORY,"
"(SELECT s.t_REFUND FROM v_suboperation_display s WHERE \
s.id=v_operation.i_MOSTIMPSUBOP) AS t_REFUND,"
"(CASE WHEN v_operation.f_QUANTITY<0 THEN '-' WHEN \
v_operation.f_QUANTITY=0 THEN '' ELSE '+' END) AS t_TYPEEXPENSE, "
- "(CASE WHEN v_operation.f_QUANTITY<=0 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative \
amount", "Expenditure")) + "' ELSE '" + SKGServices::stringToSqlString(i18nc("Noun, \
financial operations with a positive amount", "Income")) + "' END) AS \
t_TYPEEXPENSENLS, " + "(CASE WHEN v_operation.f_QUANTITY<=0 THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative \
amount", "Expenditure")) % "' ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, \
financial operations with a positive amount", "Income")) % "' END) AS \
t_TYPEEXPENSENLS, " "STRFTIME('%Y-W%W',v_operation.d_date) AS d_DATEWEEK,"
"STRFTIME('%Y-%m',v_operation.d_date) AS d_DATEMONTH,"
"STRFTIME('%Y',v_operation.d_date)||'-Q'||(CASE WHEN \
STRFTIME('%m',v_operation.d_date)<='03' THEN '1' WHEN \
STRFTIME('%m',v_operation.d_date)<='06' THEN '2' WHEN \
STRFTIME('%m',v_operation.d_date)<='09' THEN '3' ELSE '4' END) AS d_DATEQUARTER, " @@ \
-500,12 +500,12 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers() << \
"CREATE VIEW v_account_display AS " "SELECT "
"(CASE t_type "
- "WHEN 'C' THEN '" + SKGServices::stringToSqlString(i18nc("Adjective, a \
current account", "Current")) + "' "
- "WHEN 'D' THEN '" + SKGServices::stringToSqlString(i18nc("Noun", \
"Credit card")) + "' "
- "WHEN 'A' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, the type \
of an account", "Assets")) + "' "
- "WHEN 'I' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, a type \
of account WHERE you invest money", "Investment")) + "' "
- "WHEN 'W' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, a type \
of account", "Wallet")) + "' "
- "WHEN 'O' THEN '" + SKGServices::stringToSqlString(i18nc("Noun, as in \
other type of item", "Other")) + "' END) AS t_TYPENLS," + "WHEN 'C' THEN \
'" % SKGServices::stringToSqlString(i18nc("Adjective, a current account", "Current")) \
% "' " + "WHEN 'D' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", \
"Credit card")) % "' " + "WHEN 'A' THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun, the type of an account", "Assets")) % "' \
" + "WHEN 'I' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, a type \
of account WHERE you invest money", "Investment")) % "' " + "WHEN 'W' THEN \
'" % SKGServices::stringToSqlString(i18nc("Noun, a type of account", "Wallet")) % "' \
" + "WHEN 'O' THEN '" % SKGServices::stringToSqlString(i18nc("Noun, as in \
other type of item", "Other")) % "' END) AS t_TYPENLS," "bank.t_name AS t_BANK,"
"bank.t_bank_number AS t_BANK_NUMBER,"
"bank.t_icon AS t_ICON,"
@@ -529,7 +529,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"sop.t_REFUND AS t_REALREFUND, "
"sop.r_category_id AS i_IDCATEGORY, "
"(CASE WHEN sop.f_value<0 THEN '-' WHEN sop.f_value=0 THEN '' ELSE '+' \
END) AS t_TYPEEXPENSE, "
- "(CASE WHEN sop.f_value<0 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative \
amount", "Expenditure")) + "' WHEN sop.f_value=0 THEN '' ELSE '" + \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a positive \
amount", "Income")) + "' END) AS t_TYPEEXPENSENLS, " + "(CASE WHEN \
sop.f_value<0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun, financial \
operations with a negative amount", "Expenditure")) % "' WHEN sop.f_value=0 THEN '' \
ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a \
positive amount", "Income")) % "' END) AS t_TYPEEXPENSENLS, " "sop.f_value AS \
f_REALQUANTITY, " "sop.f_VALUE_INCOME AS f_REALQUANTITY_INCOME, "
"sop.f_VALUE_EXPENSE AS f_REALQUANTITY_EXPENSE, "
@@ -549,8 +549,8 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
//refund
<< "CREATE VIEW v_refund_delete AS "
- "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_operation_consolidated \
WHERE r_refund_id=refund.id AND t_status='Y') THEN '" +
- SKGServices::stringToSqlString(i18nc("Error message", "You are not \
authorized to delete this tracker because used by some checked operations")) + + \
"SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_operation_consolidated WHERE \
r_refund_id=refund.id AND t_status='Y') THEN '" % + \
SKGServices::stringToSqlString(i18nc("Error message", "You are not authorized to \
delete this tracker because used by some checked operations")) % "' END) \
t_delete_message FROM refund"
<< "CREATE VIEW v_refund AS "
@@ -569,8 +569,8 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
//Payee
<< "CREATE VIEW v_payee_delete AS "
- "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE \
r_payee_id=payee.id AND t_status='Y') THEN '" +
- SKGServices::stringToSqlString(i18nc("Error message", "You are not \
authorized to delete this payee because used by some checked operations")) + + \
"SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM operation WHERE r_payee_id=payee.id AND \
t_status='Y') THEN '" % + SKGServices::stringToSqlString(i18nc("Error \
message", "You are not authorized to delete this payee because used by some checked \
operations")) % "' END) t_delete_message FROM payee"
<< "CREATE VIEW v_payee AS "
@@ -587,8 +587,8 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
//category
<< "CREATE VIEW v_category_delete AS "
- "SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_operation_consolidated \
WHERE (t_REALCATEGORY=category.t_fullname OR t_REALCATEGORY like \
category.t_fullname||'%') AND t_status='Y') THEN '" +
- SKGServices::stringToSqlString(i18nc("Error message", "You are not \
authorized to delete this category because used by some checked operations")) + + \
"SELECT *, (CASE WHEN EXISTS(SELECT 1 FROM v_operation_consolidated WHERE \
(t_REALCATEGORY=category.t_fullname OR t_REALCATEGORY like category.t_fullname||'%') \
AND t_status='Y') THEN '" % + SKGServices::stringToSqlString(i18nc("Error \
message", "You are not authorized to delete this category because used by some \
checked operations")) % "' END) t_delete_message FROM category"
<< "CREATE VIEW v_category_display_tmp AS SELECT *,"
@@ -597,10 +597,10 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"FROM v_category"
<< "CREATE VIEW v_category_display AS SELECT *,"
- "(SELECT TOTAL(c.f_REALCURRENTAMOUNT) FROM v_category_display_tmp c \
WHERE c.id=v_category_display_tmp.id OR c.t_fullname LIKE \
v_category_display_tmp.t_fullname||'" + OBJECTSEPARATOR + "%') AS f_SUMCURRENTAMOUNT, \
"
- "(SELECT CAST(TOTAL(c.i_NBOPERATIONS) AS INTEGER) FROM \
v_category_display_tmp c WHERE c.id=v_category_display_tmp.id OR c.t_fullname like \
v_category_display_tmp.t_fullname||'" + OBJECTSEPARATOR + "%') AS i_SUMNBOPERATIONS, \
" + "(SELECT TOTAL(c.f_REALCURRENTAMOUNT) FROM v_category_display_tmp c \
WHERE c.id=v_category_display_tmp.id OR c.t_fullname LIKE \
v_category_display_tmp.t_fullname||'" % OBJECTSEPARATOR % "%') AS f_SUMCURRENTAMOUNT, \
" + "(SELECT CAST(TOTAL(c.i_NBOPERATIONS) AS INTEGER) FROM \
v_category_display_tmp c WHERE c.id=v_category_display_tmp.id OR c.t_fullname like \
v_category_display_tmp.t_fullname||'" % OBJECTSEPARATOR % "%') AS i_SUMNBOPERATIONS, \
" "(CASE WHEN v_category_display_tmp.f_REALCURRENTAMOUNT<0 THEN '-' WHEN \
v_category_display_tmp.f_REALCURRENTAMOUNT=0 THEN '' ELSE '+' END) AS \
t_TYPEEXPENSE,"
- "(CASE WHEN v_category_display_tmp.f_REALCURRENTAMOUNT<0 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative \
amount", "Expenditure")) + "' WHEN v_category_display_tmp.f_REALCURRENTAMOUNT=0 THEN \
'' ELSE '" + SKGServices::stringToSqlString(i18nc("Noun, financial operations with a \
positive amount", "Income")) + "' END) AS t_TYPEEXPENSENLS " + "(CASE WHEN \
v_category_display_tmp.f_REALCURRENTAMOUNT<0 THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun, financial operations with a negative \
amount", "Expenditure")) % "' WHEN v_category_display_tmp.f_REALCURRENTAMOUNT=0 THEN \
'' ELSE '" % SKGServices::stringToSqlString(i18nc("Noun, financial operations with a \
positive amount", "Income")) % "' END) AS t_TYPEEXPENSENLS " "FROM \
v_category_display_tmp"
//recurrentoperation
@@ -618,7 +618,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
<< "CREATE VIEW v_interest AS SELECT *,"
"(SELECT s.t_name FROM account s WHERE s.id=interest.rd_account_id) AS \
t_ACCOUNT " " FROM interest"
- << "CREATE VIEW v_interest_displayname AS SELECT *, STRFTIME('" + \
dateFormatShort + "',d_date)||' '||f_rate||'%' AS t_displayname FROM interest" + \
<< "CREATE VIEW v_interest_displayname AS SELECT *, STRFTIME('" % dateFormatShort % \
"',d_date)||' '||f_rate||'%' AS t_displayname FROM interest"
//budgetrule
<< "CREATE VIEW v_budgetrule AS "
@@ -626,15 +626,15 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
"IFNULL((SELECT s.t_fullname FROM category s WHERE \
s.id=budgetrule.rc_category_id),'') AS t_CATEGORYCONDITION, "
"IFNULL((SELECT s.t_fullname FROM category s WHERE \
s.id=budgetrule.rc_category_id_target),'') AS t_CATEGORY, " "(CASE "
- "WHEN budgetrule.i_condition=-1 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "Negative")) + "' "
- "WHEN budgetrule.i_condition=1 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "Positive")) + "' "
- "WHEN budgetrule.i_condition=0 THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "All")) + "' " + "WHEN \
budgetrule.i_condition=-1 THEN '" % SKGServices::stringToSqlString(i18nc("Noun", \
"Negative")) % "' " + "WHEN budgetrule.i_condition=1 THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun", "Positive")) % "' " + "WHEN \
budgetrule.i_condition=0 THEN '" % SKGServices::stringToSqlString(i18nc("Noun", \
"All")) % "' " "END) AS t_WHENNLS, "
"f_quantity||(CASE WHEN budgetrule.t_absolute='N' THEN '%' ELSE (SELECT \
t_symbol FROM unit WHERE t_type='1') END) AS t_WHATNLS," "(CASE "
- "WHEN budgetrule.t_rule='N' THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "Next")) + "' "
- "WHEN budgetrule.t_rule='C' THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "Current")) + "' "
- "WHEN budgetrule.t_rule='Y' THEN '" + \
SKGServices::stringToSqlString(i18nc("Noun", "Year")) + "' " + "WHEN \
budgetrule.t_rule='N' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Next")) \
% "' " + "WHEN budgetrule.t_rule='C' THEN '" % \
SKGServices::stringToSqlString(i18nc("Noun", "Current")) % "' " + "WHEN \
budgetrule.t_rule='Y' THEN '" % SKGServices::stringToSqlString(i18nc("Noun", "Year")) \
% "' " "END) AS t_RULENLS "
"FROM budgetrule"
@@ -701,7 +701,7 @@ SKGError SKGDocumentBank::refreshViewsIndexesAndTriggers()
table == "budgetrule" ||
table == "budgetcategory" ||
table == "category") {
- QString sql = "DROP " + type + " IF EXISTS " + name;
+ QString sql = "DROP " % type % " IF EXISTS " % name;
err = this->executeSqliteOrder(sql);
}
}
@@ -804,7 +804,7 @@ SKGError SKGDocumentBank::migrate(bool& oMigrationDone)
//Table category
<< "CREATE TABLE category ("
"id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
- "t_name TEXT NOT NULL DEFAULT '' CHECK (t_name NOT LIKE '%" + \
OBJECTSEPARATOR + "%')," + "t_name TEXT NOT NULL DEFAULT '' CHECK \
(t_name NOT LIKE '%" % OBJECTSEPARATOR % "%')," "t_fullname TEXT,"
"r_category_id INT)"
@@ -1394,7 +1394,7 @@ SKGError SKGDocumentBank::migrate(bool& oMigrationDone)
<< ""
<< "3.9"
<< "4.0"
- << "UPDATE rule SET t_definition=replace(t_definition, '" + \
SKGServices::stringToSqlString("date('now','-1") + "', '" + \
SKGServices::stringToSqlString("date('now','start of month','-1") + "')" + \
<< "UPDATE rule SET t_definition=replace(t_definition, '" % \
SKGServices::stringToSqlString("date('now','-1") % "', '" % \
SKGServices::stringToSqlString("date('now','start of month','-1") % "')" \
//============ << ""
<< "4.0"
@@ -1774,21 +1774,21 @@ SKGError SKGDocumentBank::addOrModifyUnitValue(const QString& \
iUnitName, const Q QString SKGDocumentBank::formatMoney(double iValue, \
SKGServices::SKGUnitInfo iUnit) const {
KLocale* locale = KGlobal::locale();
- return QString("<font color=\"") +
- (iValue < 0 ? "red" : "black") +
- "\">" +
- SKGServices::stringToHtml(locale ? locale->formatMoney(iValue / \
iUnit.Value, iUnit.Symbol, iUnit.NbDecimal) : \
SKGServices::doubleToString(round(iValue / iUnit.Value / 100) * 100) + ' ' + \
iUnit.Symbol) + + return QString("<font color=\"") %
+ (iValue < 0 ? "red" : "black") %
+ "\">" %
+ SKGServices::stringToHtml(locale ? locale->formatMoney(iValue / \
iUnit.Value, iUnit.Symbol, iUnit.NbDecimal) : \
SKGServices::doubleToString(round(iValue / iUnit.Value / 100) * 100) % ' ' % \
iUnit.Symbol) % "</font>";
}
QString SKGDocumentBank::formatPercentage(double iValue) const
{
KLocale* locale = KGlobal::locale();
- QString p = (locale ? locale->formatMoney(iValue, "%", 2) : \
SKGServices::doubleToString(iValue) + " %"); + QString p = (locale ? \
locale->formatMoney(iValue, "%", 2) : SKGServices::doubleToString(iValue) % " %"); \
if(p.count() > 10 || isnan(iValue) || isinf(iValue)) p = QChar(8734);
- return QString("<font color=\"") +
- (iValue < 0 ? "red" : "black") +
- "\">" + SKGServices::stringToHtml(p) +
+ return "<font color=\"" %
+ QString(iValue < 0 ? "red" : "black") %
+ "\">" % SKGServices::stringToHtml(p) %
"</font>";
}
@@ -1892,13 +1892,13 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
//Get properties
QStringList properties;
- this->getDistinctValues("parameters", "t_name", "t_uuid_parent like '%-" + \
iRealTable + '\'', properties); + this->getDistinctValues("parameters", "t_name", \
"t_uuid_parent like '%-" % iRealTable % '\'', properties);
//Build property schema
QString propSchema;
int nb = properties.count();
for(int i = 0; i < nb; ++i)
- propSchema += ";p_" + properties.at(i) + "|N";
+ propSchema += ";p_" % properties.at(i) % "|N";
//Build schemas
if(iRealTable == "operation") {
@@ -1911,7 +1911,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
\
"f_CURRENTAMOUNT;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;"
\
"f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;"
"t_imported|N;t_REALREFUND|N;t_REFUND|N"
- ";f_BALANCE|N" + propSchema
+ ";f_BALANCE|N" % propSchema
;
listSchema.push_back(def);
@@ -1924,7 +1924,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
\
"f_CURRENTAMOUNT;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;"
\
"f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;"
"t_imported|N;t_REALREFUND|N;t_REFUND|N"
- ";f_BALANCE|N" + propSchema
+ ";f_BALANCE|N" % propSchema
;
listSchema.push_back(minimum);
@@ -1937,7 +1937,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
\
"f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|Y;f_CURRENTAMOUNT_INCOME|Y;"
\
"f_QUANTITY|N;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;"
"t_imported|N;t_REALREFUND|N;t_REFUND|N"
- ";f_BALANCE|N" + propSchema
+ ";f_BALANCE|N" % propSchema
;
listSchema.push_back(doubleColumn);
@@ -1950,7 +1950,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
\
"f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;"
\
"f_QUANTITY|Y;f_QUANTITY_EXPENSE|N;f_QUANTITY_INCOME|N;f_REALQUANTITY|Y;f_REALQUANTITY_EXPENSE|N;f_REALQUANTITY_INCOME|N;"
"t_imported|N;t_REALREFUND|N;t_REFUND|N"
- ";f_BALANCE|N" + propSchema
+ ";f_BALANCE|N" % propSchema
;
listSchema.push_back(amountEntered);
@@ -1963,7 +1963,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
\
"f_CURRENTAMOUNT|N;f_CURRENTAMOUNT_EXPENSE|N;f_CURRENTAMOUNT_INCOME|N;"
\
"f_QUANTITY|N;f_QUANTITY_EXPENSE|Y;f_QUANTITY_INCOME|Y;f_REALQUANTITY|N;f_REALQUANTITY_EXPENSE|Y;f_REALQUANTITY_INCOME|Y;"
"t_imported|N;t_REALREFUND|N;t_REFUND|N"
- ";f_BALANCE|N" + propSchema
+ ";f_BALANCE|N" % propSchema
;
listSchema.push_back(doubleColumnEntered);
} else if(iRealTable == "recurrentoperation") {
@@ -1972,7 +1972,7 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
def.schema = \
"d_date;t_PERIODNLS;i_nb_times;i_auto_write_days;i_warn_days;t_ACCOUNT;i_number;t_mode;t_PAYEE;t_comment;t_CATEGORY;"
- "t_status;f_CURRENTAMOUNT" + propSchema;
+ "t_status;f_CURRENTAMOUNT" % propSchema;
listSchema.push_back(def);
SKGModelTemplate minimum;
@@ -1980,161 +1980,161 @@ QList<SKGDocument::SKGModelTemplate> \
SKGDocumentBank::getDisplaySchemas(const QS
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
minimum.schema = \
"d_date;t_PERIODNLS;i_nb_times;i_auto_write_days;i_warn_days;t_ACCOUNT;i_number|N;t_mode|N;t_PAYEE;t_comment|N;t_CATEGORY|N;"
- "t_status;f_CURRENTAMOUNT" + propSchema;
+ "t_status;f_CURRENTAMOUNT" % propSchema;
listSchema.push_back(minimum);
} else if(iRealTable == "account") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS;t_BANK_NUMBER;t_agency_number;t_number;t \
_agency_address;t_comment;f_CURRENTAMOUNT;f_TODAYAMOUNT|N;f_CHECKED;f_COMING_SOON;i_NBOPERATIONS;f_RATE|N" \
+ propSchema; + def.schema = \
"t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS;t_BANK_NUMBER;t_agency_number;t_number;t \
_agency_address;t_comment;f_CURRENTAMOUNT;f_TODAYAMOUNT|N;f_CHECKED;f_COMING_SOON;i_NBOPERATIONS;f_RATE|N" \
% propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"t_BANK;t_close;t_bookmarked|N;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_ \
number|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT|N;f_TODAYAMOUNT|N;f_CHECKED|N;f_COMING_SOON|N;i_NBOPERATIONS|N;f_RATE|N" \
+ propSchema; + minimum.schema = \
"t_BANK;t_close;t_bookmarked|N;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_ \
number|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT|N;f_TODAYAMOUNT|N;f_CHECKED|N;f_COMING_SOON|N;i_NBOPERATIONS|N;f_RATE|N" \
% propSchema; listSchema.push_back(minimum);
SKGModelTemplate intermediate;
intermediate.id = "intermediate";
intermediate.name = i18nc("Noun, an intermediate value between two \
extremums", "Intermediate"); intermediate.icon = "";
- intermediate.schema = \
"t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_nu \
mber|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT;f_TODAYAMOUNT|N,f_CHECKED;f_COMING_SOON;i_NBOPERATIONS|N;f_RATE|N" \
+ propSchema; + intermediate.schema = \
"t_BANK;t_close;t_bookmarked;t_name;t_TYPENLS|N;t_BANK_NUMBER|N;t_agency_number|N;t_nu \
mber|N;t_agency_address|N;t_comment|N;f_CURRENTAMOUNT;f_TODAYAMOUNT|N,f_CHECKED;f_COMING_SOON;i_NBOPERATIONS|N;f_RATE|N" \
% propSchema; listSchema.push_back(intermediate);
} else if(iRealTable == "category") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_name;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" + \
propSchema; + def.schema = \
"t_name;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" % \
propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"t_name;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" \
+ propSchema; + minimum.schema = \
"t_name;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" \
% propSchema; listSchema.push_back(minimum);
SKGModelTemplate op;
op.id = "with_operations";
op.name = i18nc("Noun", "With operations");
op.icon = "";
- op.schema = \
"t_name;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" \
+ propSchema; + op.schema = \
"t_name;i_NBOPERATIONS;f_REALCURRENTAMOUNT;i_SUMNBOPERATIONS|N;f_SUMCURRENTAMOUNT|N" \
% propSchema; listSchema.push_back(op);
SKGModelTemplate op2;
op2.id = "with_cumulative_operations";
op2.name = i18nc("Noun", "With cumulative operations");
op2.icon = "";
- op2.schema = \
"t_name;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" \
+ propSchema; + op2.schema = \
"t_name;i_NBOPERATIONS|N;f_REALCURRENTAMOUNT|N;i_SUMNBOPERATIONS;f_SUMCURRENTAMOUNT" \
% propSchema; listSchema.push_back(op2);
} else if(iRealTable == "unit") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_name;t_symbol;t_country;t_TYPENLS;t_internet_code;f_CURRENTAMOUNT;f_QUANTITYOWNED;i_nbdecimal;t_UNIT" \
+ propSchema; + def.schema = \
"t_name;t_symbol;t_country;t_TYPENLS;t_internet_code;f_CURRENTAMOUNT;f_QUANTITYOWNED;i_nbdecimal;t_UNIT" \
% propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"t_name;t_symbol;t_country|N;t_TYPENLS;t_internet_code|N;f_CURRENTAMOUNT|N;f_QUANTITYOWNED|N;i_nbdecimal|N;t_UNIT|N" \
+ propSchema; + minimum.schema = \
"t_name;t_symbol;t_country|N;t_TYPENLS;t_internet_code|N;f_CURRENTAMOUNT|N;f_QUANTITYOWNED|N;i_nbdecimal|N;t_UNIT|N" \
% propSchema; listSchema.push_back(minimum);
} else if(iRealTable == "unitvalue") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = "d_date;f_quantity;t_UNIT|N" + propSchema;
+ def.schema = "d_date;f_quantity;t_UNIT|N" % propSchema;
listSchema.push_back(def);
} else if(iRealTable == "refund") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_name;t_comment;t_close;d_FIRSTDATE;d_LASTDATE;f_CURRENTAMOUNT" + propSchema; + \
def.schema = "t_name;t_comment;t_close;d_FIRSTDATE;d_LASTDATE;f_CURRENTAMOUNT" % \
propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"t_name;t_comment|N;t_close;d_FIRSTDATE|N;d_LASTDATE|N;f_CURRENTAMOUNT" + propSchema; \
+ minimum.schema = \
"t_name;t_comment|N;t_close;d_FIRSTDATE|N;d_LASTDATE|N;f_CURRENTAMOUNT" % propSchema; \
listSchema.push_back(minimum); } else if(iRealTable == "payee") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = "t_name;t_address;f_CURRENTAMOUNT" + propSchema;
+ def.schema = "t_name;t_address;f_CURRENTAMOUNT" % propSchema;
listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = "t_name;t_address|N;f_CURRENTAMOUNT" + propSchema;
+ minimum.schema = "t_name;t_address|N;f_CURRENTAMOUNT" % propSchema;
listSchema.push_back(minimum);
} else if(iRealTable == "rule") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"i_ORDER;t_bookmarked;t_action_type;t_description;t_action_description" + propSchema; \
+ def.schema = \
"i_ORDER;t_bookmarked;t_action_type;t_description;t_action_description" % propSchema; \
listSchema.push_back(def); } else if(iRealTable == "interest") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"d_date;f_rate;t_income_value_date_mode;t_expenditure_value_date_mode;t_base" + \
propSchema; + def.schema = \
"d_date;f_rate;t_income_value_date_mode;t_expenditure_value_date_mode;t_base" % \
propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"d_date;f_rate;t_income_value_date_mode|N;t_expenditure_value_date_mode|N;t_base|N" + \
propSchema; + minimum.schema = \
"d_date;f_rate;t_income_value_date_mode|N;t_expenditure_value_date_mode|N;t_base|N" % \
propSchema; listSchema.push_back(minimum);
} else if(iRealTable == "interest_result") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"d_date;d_valuedate;t_comment;f_currentamount;f_coef;f_rate;f_annual_interest;f_accrued_interest" \
+ propSchema; + def.schema = \
"d_date;d_valuedate;t_comment;f_currentamount;f_coef;f_rate;f_annual_interest;f_accrued_interest" \
% propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"d_date;d_valuedate|N;t_comment|N;f_currentamount|N;f_coef|N;f_rate;f_annual_interest;f_accrued_interest|N" \
+ propSchema; + minimum.schema = \
"d_date;d_valuedate|N;t_comment|N;f_currentamount|N;f_coef|N;f_rate;f_annual_interest;f_accrued_interest|N" \
% propSchema; listSchema.push_back(minimum);
} else if(iRealTable == "budget") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER|N;f_DELTA;t_RULES" \
+ propSchema; + def.schema = \
"t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER|N;f_DELTA;t_RULES" \
% propSchema; listSchema.push_back(def);
SKGModelTemplate minimum;
minimum.id = "minimum";
minimum.name = i18nc("Noun, the minimum value of an item", "Minimum");
minimum.icon = "";
- minimum.schema = \
"t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted|N;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER|N;f_DELTA;t_RULES|N" \
+ propSchema; + minimum.schema = \
"t_CATEGORY;t_PERIOD;i_year|N;i_month|N;f_budgeted|N;f_budgeted_modified;f_CURRENTAMOUNT;f_DELTABEFORETRANSFER|N;f_DELTA;t_RULES|N" \
% propSchema; listSchema.push_back(minimum);
} else if(iRealTable == "budgetrule") {
SKGModelTemplate def;
def.id = "default";
def.name = i18nc("Noun, the default value of an item", "Default");
def.icon = "edit-undo";
- def.schema = \
"t_CATEGORYCONDITION;i_year;i_month;t_WHENNLS;t_WHATNLS;t_RULENLS;t_CATEGORY" + \
propSchema; + def.schema = \
"t_CATEGORYCONDITION;i_year;i_month;t_WHENNLS;t_WHATNLS;t_RULENLS;t_CATEGORY" % \
propSchema; listSchema.push_back(def);
} else listSchema = SKGDocument::getDisplaySchemas(iRealTable);
@@ -2337,16 +2337,16 @@ QString SKGDocumentBank::getBudget(const QString& iMonth)
SKGStringListList listTmp;
SKGError err = executeSelectSqliteOrder("SELECT t_CATEGORY, f_budgeted, \
f_CURRENTAMOUNT, f_DELTABEFORETRANSFER, f_budgeted_modified FROM \
v_budget "
- "where t_PERIOD='" + iMonth + "' ORDER \
BY t_CATEGORY;", + "where t_PERIOD='" % \
iMonth % "' ORDER BY t_CATEGORY;", listTmp);
int nbval = listTmp.count();
if(err.isSucceeded() && nbval > 1) {
html += "<table class=\"table\">";
html += "<tr class=\"tabletitle\">"
- "<td align=\"center\"><b>" + \
SKGServices::stringToHtml(getDisplay("t_CATEGORY")) + "</b></td>"
- "<td align=\"center\"><b>" + \
SKGServices::stringToHtml(getDisplay("f_budgeted_modified")) + \
"</b></td>"
- "<td align=\"center\"><b>" + \
SKGServices::stringToHtml(getDisplay("f_CURRENTAMOUNT")) + \
"</b></td>"
- "<td align=\"center\"><b>" + \
SKGServices::stringToHtml(getDisplay("f_DELTA")) + "</b></td>" + "<td \
align=\"center\"><b>" % SKGServices::stringToHtml(getDisplay("t_CATEGORY")) % \
"</b></td>" + "<td align=\"center\"><b>" % \
SKGServices::stringToHtml(getDisplay("f_budgeted_modified")) % "</b></td>" + \
"<td align=\"center\"><b>" % SKGServices::stringToHtml(getDisplay("f_CURRENTAMOUNT")) \
% "</b></td>" + "<td align=\"center\"><b>" % \
SKGServices::stringToHtml(getDisplay("f_DELTA")) % "</b></td>" "</tr>";
double sum1 = 0;
double sum2 = 0;
@@ -2359,10 +2359,10 @@ QString SKGDocumentBank::getBudget(const QString& iMonth)
double v4 = SKGServices::stringToDouble(listTmp.at(i).at(4));
QString v1S = formatMoney(v1, primary);
QString v4S = formatMoney(v4, primary);
- html += QString("<tr><td>") + \
SKGServices::stringToHtml(listTmp.at(i).at(0)) + "</td>"
- "<td align=\"right\">" + (v4S == v1S ? v1S : v4S + \
"<br/><s><small>" + v1S + "</small></s>") + "</td>"
- "<td align=\"right\">" + formatMoney(v2, primary) + "</td>"
- "<td align=\"right\">" + formatMoney(v3, primary) + "</td>"
+ html += "<tr><td>" % SKGServices::stringToHtml(listTmp.at(i).at(0)) % \
"</td>" + "<td align=\"right\">" % (v4S == v1S ? v1S : v4S % \
"<br/><s><small>" % v1S % "</small></s>") % "</td>" + "<td \
align=\"right\">" % formatMoney(v2, primary) % "</td>" + "<td \
align=\"right\">" % formatMoney(v3, primary) % "</td>" "</tr>";
sum1 += v1;
@@ -2373,10 +2373,10 @@ QString SKGDocumentBank::getBudget(const QString& iMonth)
QString v1S = formatMoney(sum1, primary);
QString v4S = formatMoney(sum4, primary);
- html += "<tr class=\"tabletotal\"><td>" + \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) + "</td>"
- "<td align=\"right\">" + (v4S == v1S ? v1S : v4S + "<br/><s><small>" \
+ v1S + "</small></s>") + "</td>"
- "<td align=\"right\">" + formatMoney(sum2, primary) + "</td>"
- "<td align=\"right\">" + formatMoney(sum3, primary) + "</td>"
+ html += "<tr class=\"tabletotal\"><td>" % \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) % "</td>" + "<td align=\"right\">" % (v4S == v1S ? v1S : v4S \
% "<br/><s><small>" % v1S % "</small></s>") % "</td>" + "<td \
align=\"right\">" % formatMoney(sum2, primary) % "</td>" + "<td \
align=\"right\">" % formatMoney(sum3, primary) % "</td>" "</tr>";
html += "</table>";
}
@@ -2391,13 +2391,13 @@ QString SKGDocumentBank::get5MainCategories(const QString& \
iMonth, bool iChart)
SKGStringListList listTmp;
SKGError err = executeSelectSqliteOrder("SELECT t_REALCATEGORY, \
TOTAL(f_REALCURRENTAMOUNT) FROM v_operation_consolidated "
- "where i_group_id=0 AND d_DATEMONTH='" + \
iMonth + "' AND t_TYPEEXPENSE='-' " + \
"where i_group_id=0 AND d_DATEMONTH='" % iMonth % "' AND \
t_TYPEEXPENSE='-' "
"group by t_REALCATEGORY order by \
TOTAL(f_REALCURRENTAMOUNT) LIMIT 5;", listTmp);
if(err.isSucceeded()) {
html += "<table class=\"table\">";
- html += "<tr class=\"tabletitle\"><td align=\"center\"><b>" + \
getDisplay("t_REALCATEGORY") + "</b></td>"
- "<td align=\"center\"><b>" + iMonth + "</b></td>"
+ html += "<tr class=\"tabletitle\"><td align=\"center\"><b>" % \
getDisplay("t_REALCATEGORY") % "</b></td>" + "<td \
align=\"center\"><b>" % iMonth % "</b></td>" "</tr>";
int nbval = listTmp.count();
QString qoogleChl;
@@ -2407,8 +2407,8 @@ QString SKGDocumentBank::get5MainCategories(const QString& \
iMonth, bool iChart) QString m = listTmp.at(i).at(1);
double v = abs(SKGServices::stringToDouble(listTmp.at(i).at(1)));
max = qMax(max, v);
- html += QString("<tr><td>") + SKGServices::intToString(i) + " : " + \
listTmp.at(i).at(0) + "</td>"
- "<td align=\"right\">" + formatMoney(v, primary) + "</td>"
+ html += QString("<tr><td>") % SKGServices::intToString(i) % " : " % \
listTmp.at(i).at(0) % "</td>" + "<td align=\"right\">" % \
formatMoney(v, primary) % "</td>" "</tr>";
if(i > 1) {
qoogleChl += '|';
@@ -2420,10 +2420,10 @@ QString SKGDocumentBank::get5MainCategories(const QString& \
iMonth, bool iChart) html += "</table>";
if(iChart) {
- QString img = \
"http://chart.apis.google.com/chart?cht=p3&chco=FF0000&chd=t:" + qoogleChd + \
"&chs=300x100&chl=" + qoogleChl +
- "&chds=0," + SKGServices::doubleToString(max);
+ QString img = \
"http://chart.apis.google.com/chart?cht=p3&chco=FF0000&chd=t:" % qoogleChd % \
"&chs=300x100&chl=" % qoogleChl % + "&chds=0," % \
SKGServices::doubleToString(max); //SKGTRACE << img << endl;
- html += "<img src=\"" + img + "\" />";
+ html += "<img src=\"" % img % "\" />";
}
}
return html;
@@ -2436,7 +2436,7 @@ QString SKGDocumentBank::get5MainCategoriesVariation(const \
QString& iMonth, cons
QStringList list = get5MainCategoriesVariationList(iMonth, iPreviousMonth, \
iOnlyIssues); int nbval = list.count();
for(int i = 0; i < nbval; ++i) {
- html += list.at(i) + "<br>";
+ html += list.at(i) % "<br>";
}
return html;
@@ -2446,7 +2446,7 @@ QStringList \
SKGDocumentBank::get5MainCategoriesVariationList(const QString& iMon {
SKGTRACEIN(10, "SKGDocumentBank::get5MainCategoriesVariationList");
//Compute input string
- QString inputString = iMonth + iPreviousMonth + (iOnlyIssues ? 'Y' : 'N') + \
(oCategoryList ? 'Y' : 'N'); + QString inputString = iMonth % iPreviousMonth % \
(iOnlyIssues ? 'Y' : 'N') % (oCategoryList ? 'Y' : 'N');
//Use cache or not
QStringList output;
@@ -2463,9 +2463,9 @@ QStringList \
SKGDocumentBank::get5MainCategoriesVariationList(const QString& iMon \
SKGStringListList listTmp;
SKGError err = executeSelectSqliteOrder("select *, 100*(A2-A1)/ABS(A1) as \
'V' from "
"(SELECT t_REALCATEGORY as 'C1', \
TOTAL(f_REALCURRENTAMOUNT) as 'A1' FROM v_operation_consolidated \
where "
- "i_group_id=0 AND d_DATEMONTH='" + \
iPreviousMonth + "' AND t_TYPEEXPENSE='-' group by t_REALCATEGORY) A," + \
"i_group_id=0 AND d_DATEMONTH='" % iPreviousMonth % "' AND t_TYPEEXPENSE='-' group by \
t_REALCATEGORY) A,"
"(SELECT t_REALCATEGORY as 'C2', \
TOTAL(f_REALCURRENTAMOUNT) as 'A2' FROM v_operation_consolidated \
where "
- "i_group_id=0 AND d_DATEMONTH='" + \
iMonth + "' AND t_TYPEEXPENSE='-' group by t_REALCATEGORY) B " + \
"i_group_id=0 AND d_DATEMONTH='" % iMonth % "' AND t_TYPEEXPENSE='-' group by \
t_REALCATEGORY) B "
"WHERE A.C1=B.C2 AND \
ABS(A2-A1)/ABS(A1)>0.1 ORDER BY ABS(A2-A1) DESC LIMIT 5;", listTmp);
if(err.isSucceeded()) {
diff --git a/skgbankmodeler/skgimportexportmanager.cpp \
b/skgbankmodeler/skgimportexportmanager.cpp index 29c0619..ce97f8f 100644
--- a/skgbankmodeler/skgimportexportmanager.cpp
+++ b/skgbankmodeler/skgimportexportmanager.cpp
@@ -154,10 +154,10 @@ SKGError \
SKGImportExportManager::getDefaultAccount(SKGAccountObject& oAccount) \
name.replace('_', ' ');
//Searching if an account exist
- QString whereClause = "t_name='" + name + '\'';
+ QString whereClause = "t_name='" % name % '\'';
foreach(const QString & val, name.split(' ')) {
if(!whereClause.isEmpty()) whereClause += " OR ";
- whereClause += "t_number='" + val + '\'';
+ whereClause += "t_number='" % val % '\'';
}
if(!whereClause.isEmpty()) {
SKGObjectBase::SKGListSKGObjectBase listAccount;
@@ -217,12 +217,12 @@ SKGError SKGImportExportManager::getDefaultUnit(SKGUnitObject& \
oUnit, const QDat QString wc = "t_type IN ('1', '2', 'C')";
if(iDate) {
//Yes
- wc += " AND d_MINDATE<'" + \
SKGServices::dateToSqlString(QDateTime(*iDate)) + '\''; + wc += " AND \
d_MINDATE<'" % SKGServices::dateToSqlString(QDateTime(*iDate)) % '\''; }
//Check if a unit exist
SKGObjectBase::SKGListSKGObjectBase listUnits;
- err = m_document->getObjects("v_unit", wc + " ORDER BY \
ABS(f_CURRENTAMOUNT-1) ASC" , listUnits); + err = \
m_document->getObjects("v_unit", wc % " ORDER BY ABS(f_CURRENTAMOUNT-1) ASC" , \
listUnits); if(err.isSucceeded()) {
if(listUnits.count() == 0) {
//Not found, we have to create one
@@ -282,7 +282,7 @@ SKGError SKGImportExportManager::finalizedImportedOperations()
err = m_document->sendMessage(i18np("one operation not imported because \
it already exists", "%1 operations not imported because they already exists", nb));
//Remove operations imported for nothing
- if(err.isSucceeded()) err = m_document->executeSqliteOrder("DELETE from \
operation WHERE id IN (SELECT id from v_operation WHERE " + wc + ')'); + \
if(err.isSucceeded()) err = m_document->executeSqliteOrder("DELETE from operation \
WHERE id IN (SELECT id from v_operation WHERE " % wc % ')'); }
//Apply rules
@@ -303,8 +303,8 @@ SKGError SKGImportExportManager::finalizedImportedOperations()
}
//Change imported status
- if(err.isSucceeded()) err = m_document->executeSqliteOrder(QString("UPDATE \
operation SET t_imported='") +
- (m_automaticValidationOfImportedOperation ? \
"Y" : "P") + + if(err.isSucceeded()) err = \
m_document->executeSqliteOrder(QString("UPDATE operation SET t_imported='") % + \
(m_automaticValidationOfImportedOperation ? "Y" : "P") % "' WHERE t_imported='T'");
}
return err;
@@ -542,7 +542,7 @@ SKGError SKGImportExportManager::exportQIF()
if(payee.length()) stream << 'P' << payee << endl;
if(address.length()) stream << 'A' << address << endl;
- QString memo = operation.getMode() + " " + \
operation.getComment(); + QString memo = operation.getMode() % \
" " % operation.getComment(); memo = memo.trimmed();
if(memo.length()) stream << 'M' << memo << endl;
@@ -576,7 +576,7 @@ SKGError SKGImportExportManager::exportQIF()
SKGAccountObject transferAccount;
err = transfer.getParentAccount(transferAccount);
- if(err.isSucceeded()) category.prepend('[' + \
transferAccount.getName() + ']'); + \
if(err.isSucceeded()) category.prepend('[' % transferAccount.getName() % ']'); }
if(!category.isEmpty()) stream << 'L' << category << \
endl;
@@ -1183,7 +1183,7 @@ SKGError SKGImportExportManager::importCSV()
val.replace(',', OBJECTSEPARATOR);
val.replace(';', OBJECTSEPARATOR);
//Get previous category
- if(!currentCategory.isEmpty()) val = \
currentCategory + OBJECTSEPARATOR + val; + \
if(!currentCategory.isEmpty()) val = currentCategory % OBJECTSEPARATOR % val; \
currentCategory = val;
//Create and set category
@@ -1342,14 +1342,14 @@ SKGError SKGImportExportManager::getAccount(OfxAccountData* \
iAccountData, SKGDoc accountNumber = accountNumber.trimmed();
bankNumber = bankNumber.trimmed();
//Correction BUG 234771 ^^^^^
- if(accountNumber.startsWith(bankNumber + ' ')) {
+ if(accountNumber.startsWith(bankNumber % ' ')) {
accountNumber = accountNumber.right(accountNumber.length() - \
bankNumber.length() - 1); QStringList splitNumbers = accountNumber.split(' ');
if(splitNumbers.count() == 2) accountNumber = splitNumbers.at(1);
}
//Check if account is already existing
- err = iDoc->getObject("v_account", "t_number='" + accountNumber + '\'', \
oAccount); + err = iDoc->getObject("v_account", "t_number='" % accountNumber % \
'\'', oAccount);
return err;
}
@@ -1401,7 +1401,7 @@ int SKGImportExportManager::ofxAccountCallback(struct \
OfxAccountData data, void accountNumber = accountNumber.trimmed();
bankNumber = bankNumber.trimmed();
//Correction BUG 234771 ^^^^^
- if(accountNumber.startsWith(bankNumber + ' ')) {
+ if(accountNumber.startsWith(bankNumber % ' ')) {
accountNumber = accountNumber.right(accountNumber.length() - \
bankNumber.length() - 1); QStringList splitNumbers = accountNumber.split(' ');
if(splitNumbers.count() == 2) {
@@ -1423,7 +1423,7 @@ int SKGImportExportManager::ofxAccountCallback(struct \
OfxAccountData data, void if(!bankId.isEmpty()) {
//Check if bank is already existing
SKGBankObject bank;
- SKGImportExportManager::m_ofxError = doc->getObject("v_bank", \
"t_bank_number='" + bankId + '\'', tmp); + \
SKGImportExportManager::m_ofxError = doc->getObject("v_bank", "t_bank_number='" % \
bankId % '\'', tmp); if(SKGImportExportManager::m_ofxError.isSucceeded()) {
//Already existing
bank = tmp;
@@ -1477,7 +1477,7 @@ int SKGImportExportManager::ofxAccountCallback(struct \
OfxAccountData data, void if(data.currency_valid == true) {
//Check if unit is already existing
SKGUnitObject unit(doc);
- SKGImportExportManager::m_ofxError = doc->getObject("v_unit", "t_name='" + \
QString(data.currency) + "' OR t_name like '%(" + QString(data.currency) + ")%'", \
tmp); + SKGImportExportManager::m_ofxError = doc->getObject("v_unit", \
"t_name='" % QString(data.currency) % "' OR t_name like '%(" % QString(data.currency) \
% ")%'", tmp); if(SKGImportExportManager::m_ofxError.isSucceeded()) {
//Already existing
unit = tmp;
@@ -1518,9 +1518,9 @@ int SKGImportExportManager::ofxTransactionCallback(struct \
OfxTransactionData dat //Create id
QString ID;
if(data.fi_id_valid == true) {
- if(QString(data.fi_id).count('0') != QString(data.fi_id).count()) ID = \
QString("ID-") + data.fi_id; + if(QString(data.fi_id).count('0') != \
QString(data.fi_id).count()) ID = QString("ID-") % QString(data.fi_id); } else \
if(data.reference_number_valid == true) {
- if(QString(data.reference_number).count('0') != \
QString(data.reference_number).count()) ID = QString("REF-") + data.reference_number; \
+ if(QString(data.reference_number).count('0') != \
QString(data.reference_number).count()) ID = QString("REF-") % data.reference_number; \
}
//Create operation
@@ -2152,10 +2152,10 @@ SKGError SKGImportExportManager::importQIF()
if(err.isSucceeded()) {
//Is the created operation already \
existing as a transfer?
double qua = \
SKGServices::stringToDouble(opOrigin.getAttribute("f_QUANTITY"));
- QString wc = "t_import_id='QIF \
TRANSFER-" + transferAccount + "' AND t_ACCOUNT='" + \
accountOrigin.getName() +
- "' AND f_QUANTITY=" + \
SKGServices::doubleToString(qua) +
- " AND ABS(julianday(d_date) \
- julianday('" + SKGServices::dateToSqlString(QDateTime(opOrigin.getDate())) + \
"'))<1"
- " ORDER BY \
ABS(julianday(d_date) - julianday('" + \
SKGServices::dateToSqlString(QDateTime(opOrigin.getDate())) + "')) ASC"; + \
QString wc = "t_import_id='QIF TRANSFER-" % transferAccount % "' AND t_ACCOUNT='" % \
accountOrigin.getName() % + \
"' AND f_QUANTITY=" % SKGServices::doubleToString(qua) % + \
" AND ABS(julianday(d_date) - julianday('" % \
SKGServices::dateToSqlString(QDateTime(opOrigin.getDate())) % "'))<1" + \
" ORDER BY ABS(julianday(d_date) - julianday('" % \
SKGServices::dateToSqlString(QDateTime(opOrigin.getDate())) % "')) \
ASC";
SKGObjectBase::SKGListSKGObjectBase obs;
\
m_document->getObjects("v_operation_display", wc, obs); if(obs.count()) {
@@ -2192,7 +2192,7 @@ SKGError SKGImportExportManager::importQIF()
if(err.isSucceeded()) err = \
opTransfer.setPayee(payeeObj);
if(err.isSucceeded()) err = \
opTransfer.setStatus(opOrigin.getStatus());
if(err.isSucceeded()) err = \
opTransfer.setUnit(unit);
- if(err.isSucceeded()) err = \
opTransfer.setImportID("QIF TRANSFER-" + accountOrigin.getName()); //To be able to \
identify it later + \
if(err.isSucceeded()) err = opTransfer.setImportID("QIF TRANSFER-" % \
accountOrigin.getName()); //To be able to identify it later
if(err.isSucceeded()) err = \
opTransfer.setGroupOperation(opOrigin);
if(err.isSucceeded()) err = \
opTransfer.save();
diff --git a/skgbankmodeler/skgimportgnc.cpp b/skgbankmodeler/skgimportgnc.cpp
index fb860bf..f6cd26d 100644
--- a/skgbankmodeler/skgimportgnc.cpp
+++ b/skgbankmodeler/skgimportgnc.cpp
@@ -158,7 +158,7 @@ SKGError SKGImportGnc::importFile(SKGImportExportManager* \
iImporter, SKGDocument
QDomElement accountParent = \
account.firstChildElement("act:parent");
if(err.isSucceeded() && \
!accountParent.isNull() && mapIdType[accountParent.text()] == 'C')
- fullName = \
mapIdName[accountParent.text()] + OBJECTSEPARATOR + fullName; + \
fullName = mapIdName[accountParent.text()] % OBJECTSEPARATOR % fullName;
SKGCategoryObject catObj;
err = \
SKGCategoryObject::createPathCategory(iDocument, fullName, catObj); @@ -173,7 +173,7 \
@@ SKGError SKGImportGnc::importFile(SKGImportExportManager* iImporter, SKGDocument \
int index = 1;
while(err.isSucceeded() && act.exist()) {
index++;
- realAccountName = accountName.text() + " \
(" + SKGServices::intToString(index) + ')'; + \
realAccountName = accountName.text() % " (" % \
SKGServices::intToString(index) % ')';
err = act.setName(realAccountName);
}
if(err.isSucceeded() && \
accountCode.isNull()) err = act.setNumber(accountCode.text()); @@ -232,7 +232,7 @@ \
SKGError SKGImportGnc::importFile(SKGImportExportManager* iImporter, \
SKGDocument
if(err.isSucceeded()) err = \
operationObj.setPayee(payeeObject); }
if(err.isSucceeded() && !operationPayee.isNull()) err = \
operationObj.setImported(true);
- if(err.isSucceeded() && !operationPayee.isNull()) err = \
operationObj.setImportID("GNC-" + operationId.text()); + \
if(err.isSucceeded() && !operationPayee.isNull()) err = \
operationObj.setImportID("GNC-" % operationId.text());
if(err.isSucceeded()) err = \
operationObj.setUnit(defaultUnit);
if(err.isSucceeded()) {
@@ -548,7 +548,7 @@ SKGError SKGImportGnc::importFile(SKGImportExportManager* \
iImporter, SKGDocument {
if(err.isSucceeded()) err = \
gnucashTemporaryAccount.remove(false, true);
- if(err.isSucceeded()) err = \
iDocument->executeSqliteOrder("DELETE FROM account WHERE rd_bank_id=" + \
SKGServices::intToString(bank.getID()) + " AND (SELECT COUNT(1) FROM operation WHERE \
operation.rd_account_id=account.id)=0"); + \
if(err.isSucceeded()) err = iDocument->executeSqliteOrder("DELETE FROM account WHERE \
rd_bank_id=" % SKGServices::intToString(bank.getID()) % " AND (SELECT COUNT(1) FROM \
operation WHERE operation.rd_account_id=account.id)=0");
if(err.isSucceeded()) err = iDocument->stepForward(6);
}
}
diff --git a/skgbankmodeler/skgimportgsb.cpp b/skgbankmodeler/skgimportgsb.cpp
index 3b61731..6ba7428 100644
--- a/skgbankmodeler/skgimportgsb.cpp
+++ b/skgbankmodeler/skgimportgsb.cpp
@@ -283,7 +283,7 @@ SKGError SKGImportGsb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
opObj.setNumber(SKGServices::stringToInt(getAttribute(transaction, \
"Pc")));
if(err.isSucceeded()) err = \
opObj.setComment(getAttribute(transaction, "No")); if(err.isSucceeded()) err = \
opObj.setImported(true);
- if(err.isSucceeded()) err = opObj.setImportID("GSB-" + \
getAttribute(transaction, "Nb")); + if(err.isSucceeded()) err = \
opObj.setImportID("GSB-" % getAttribute(transaction, "Nb"));
if(err.isSucceeded()) err = \
opObj.setStatus(getAttribute(transaction, "Re") == "0" ? SKGOperationObject::NONE : \
SKGOperationObject::CHECKED);
if(err.isSucceeded()) err = \
opObj.setGroupOperation(mapIdOperation[getAttribute(transaction, "Trt")]); \
if(err.isSucceeded()) err = opObj.save(); @@ -331,7 +331,7 @@ SKGError \
SKGImportGsb::importFile(SKGImportExportManager* iImporter, \
SKGDocument
if(err.isSucceeded()) err = \
opObj.setNumber(SKGServices::stringToInt(getAttribute(transaction, \
"Pc")));
if(err.isSucceeded()) err = \
opObj.setComment(getAttribute(transaction, "No")); if(err.isSucceeded()) err = \
opObj.setImported(true);
- if(err.isSucceeded()) err = opObj.setImportID("GSB-" + \
getAttribute(transaction, "Nb")); + if(err.isSucceeded()) err = \
opObj.setImportID("GSB-" % getAttribute(transaction, "Nb")); if(err.isSucceeded()) \
err = opObj.setTemplate(true); if(err.isSucceeded()) err = opObj.save();
@@ -349,7 +349,7 @@ SKGError SKGImportGsb::importFile(SKGImportExportManager* \
iImporter, SKGDocument SKGOperationObject opObj2;
if(err.isSucceeded()) err = opObj.duplicate(opObj2, \
opObj.getDate(), true);
if(err.isSucceeded()) err = opObj2.setImported(true);
- if(err.isSucceeded()) err = opObj2.setImportID("GSB-" + \
getAttribute(transaction, "Nb") + "_TR"); + \
if(err.isSucceeded()) err = opObj2.setImportID("GSB-" % getAttribute(transaction, \
"Nb") % "_TR"); if(err.isSucceeded()) err = opObj2.save();
SKGObjectBase::SKGListSKGObjectBase subObjs2;
diff --git a/skgbankmodeler/skgimportkmy.cpp b/skgbankmodeler/skgimportkmy.cpp
index 9504c1a..5f14bd5 100644
--- a/skgbankmodeler/skgimportkmy.cpp
+++ b/skgbankmodeler/skgimportkmy.cpp
@@ -298,7 +298,7 @@ SKGError SKGImportKmy::importFile(SKGImportExportManager* \
iImporter, SKGDocument SKGPayeeObject payeeObject;
err = SKGPayeeObject::createPayee(iDocument, \
payee.attribute("name"), payeeObject); if(err.isSucceeded()) {
- QString add = address.attribute("street") + ' ' + \
address.attribute("postcode") + ' ' + address.attribute("city") + ' ' + \
address.attribute("state") + ' ' + address.attribute("telephone"); + \
QString add = address.attribute("street") % ' ' % address.attribute("postcode") % ' ' \
% address.attribute("city") % ' ' % address.attribute("state") % ' ' % \
address.attribute("telephone"); add.replace(" ", " ");
err = payeeObject.setAddress(add.trimmed());
if(err.isSucceeded()) err = payeeObject.save();
@@ -323,7 +323,7 @@ SKGError SKGImportKmy::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
operationObj.setDate(QDate::fromString(operation.attribute("postdate"), \
"yyyy-MM-dd"));
if(err.isSucceeded()) err = \
operationObj.setComment(operation.attribute("memo"));
if(err.isSucceeded()) err = operationObj.setImported(true);
- if(err.isSucceeded()) err = operationObj.setImportID("KMY-" + \
operation.attribute("id")); + if(err.isSucceeded()) err = \
operationObj.setImportID("KMY-" % operation.attribute("id")); if(err.isSucceeded()) \
{
QString unitName = operation.attribute("commodity");
SKGUnitObject unit(iDocument);
@@ -582,7 +582,7 @@ SKGError SKGImportKmy::importFile(SKGImportExportManager* \
iImporter, SKGDocument //Step 8-Remove useless account and temporary account
{
if(err.isSucceeded()) err = kmymoneyTemporaryAccount.remove(false);
- if(err.isSucceeded()) err = iDocument->executeSqliteOrder("DELETE \
FROM account WHERE rd_bank_id=" + SKGServices::intToString(bank.getID()) + " AND \
(SELECT COUNT(1) FROM operation WHERE operation.rd_account_id=account.id)=0"); + \
if(err.isSucceeded()) err = iDocument->executeSqliteOrder("DELETE FROM account WHERE \
rd_bank_id=" % SKGServices::intToString(bank.getID()) % " AND (SELECT COUNT(1) FROM \
operation WHERE operation.rd_account_id=account.id)=0"); }
if(err.isSucceeded()) err = iDocument->stepForward(8);
@@ -1111,13 +1111,13 @@ SKGError SKGImportKmy::exportFile(SKGImportExportManager* \
iImporter, SKGDocument
QString yearString = SKGServices::intToString(year);
int month = obj.getMonth();
QString monthString = SKGServices::intToString(month);
- if(monthString.length() == 0) monthString = '0' + \
monthString; + if(monthString.length() == 0) monthString = '0' \
% monthString; if(currentYear != year) {
budget = doc.createElement("BUDGET");
budgets.appendChild(budget);
budget.setAttribute("version", "2");
budget.setAttribute("id", yearString);
- budget.setAttribute("start", yearString + "-01-01");
+ budget.setAttribute("start", yearString % "-01-01");
budget.setAttribute("name", yearString);
currentYear = year;
@@ -1138,7 +1138,7 @@ SKGError SKGImportKmy::exportFile(SKGImportExportManager* \
iImporter, SKGDocument QDomElement period = doc.createElement("PERIOD");
account.appendChild(period);
period.setAttribute("amount", \
SKGImportKmy::kmyValue(fabs(obj.getBudgetedAmount())));
- period.setAttribute("start", yearString + '-' + \
(obj.getMonth() == 0 ? "01" : monthString) + "-01"); + \
period.setAttribute("start", yearString % '-' % (obj.getMonth() == 0 ? "01" : \
monthString) % "-01");
if(err.isSucceeded()) err = iDocument->stepForward(i + 1);
}
@@ -1398,7 +1398,7 @@ QString SKGImportKmy::kmyValue(double iValue)
QString output;
for(int i = 0; output.isEmpty() && i < 11; ++i) {
QString d = SKGServices::doubleToString(pow(10, i) * iValue);
- if(d.indexOf('.') == -1) output = d + '/' + SKGServices::intToString(pow(10, \
i)); + if(d.indexOf('.') == -1) output = d % '/' % \
SKGServices::intToString(pow(10, i)); }
return output;
}
diff --git a/skgbankmodeler/skgimportmmb.cpp b/skgbankmodeler/skgimportmmb.cpp
index 65b5fa6..59ae0fe 100644
--- a/skgbankmodeler/skgimportmmb.cpp
+++ b/skgbankmodeler/skgimportmmb.cpp
@@ -239,7 +239,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
op.setComment(attributes.at(8));
if(err.isSucceeded()) err = \
op.setDate(SKGServices::stringToTime(attributes.at(11)).date());
if(err.isSucceeded()) err = \
op.setAttribute("t_imported", "T");
- if(err.isSucceeded()) err = op.setImportID("MMEX-" + \
attributes.at(0)); + if(err.isSucceeded()) err = \
op.setImportID("MMEX-" % attributes.at(0)); if(err.isSucceeded()) err = \
op.setUnit(unit);
if(err.isSucceeded()) err = op.bookmark(attributes.at(6) \
== "F");
if(err.isSucceeded()) err = op.setTemplate(recurrent);
@@ -249,7 +249,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument //Get splits
if(err.isSucceeded()) {
SKGStringListList listSubOperations;
- err = \
SKGServices::executeSelectSqliteOrder(&originalDocument, QString("SELECT \
SPLITTRANSID, CATEGID, SUBCATEGID, SPLITTRANSAMOUNT FROM ") + (recurrent ? "BUDGET" : \
"") + "SPLITTRANSACTIONS_V1 WHERE TRANSID=" + attributes.at(0), listSubOperations); + \
err = SKGServices::executeSelectSqliteOrder(&originalDocument, QString("SELECT \
SPLITTRANSID, CATEGID, SUBCATEGID, SPLITTRANSAMOUNT FROM ") % (recurrent ? "BUDGET" : \
"") % "SPLITTRANSACTIONS_V1 WHERE TRANSID=" % attributes.at(0), listSubOperations); \
if(err.isSucceeded()) {
int nb2 = listSubOperations.count() - 1;
if(nb2 <= 0) {
@@ -301,7 +301,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
op2.setStatus(op.getStatus());
if(err.isSucceeded()) err = \
op2.bookmark(op.isBookmarked());
if(err.isSucceeded()) err = \
op2.setAttribute("t_imported", "T");
- if(err.isSucceeded()) err = op2.setImportID("MMEX-" \
+ attributes.at(0) + "_TR"); + if(err.isSucceeded()) \
err = op2.setImportID("MMEX-" % attributes.at(0) % "_TR"); if(err.isSucceeded()) err \
= op2.save();
SKGObjectBase::SKGListSKGObjectBase subops;
@@ -437,7 +437,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = op.setComment(attributes.at(7));
if(err.isSucceeded()) err = \
op.setDate(SKGServices::stringToTime(attributes.at(2)).date());
if(err.isSucceeded()) err = op.setAttribute("t_imported", \
"T");
- if(err.isSucceeded()) err = op.setImportID("MMEX-STOCK-" + \
attributes.at(0)); + if(err.isSucceeded()) err = \
op.setImportID("MMEX-STOCK-" % attributes.at(0)); if(err.isSucceeded()) err = \
op.setUnit(unit); if(err.isSucceeded()) err = op.save();
@@ -451,7 +451,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
op2.setComment(attributes.at(7));
if(err.isSucceeded()) err = \
op2.setDate(SKGServices::stringToTime(attributes.at(2)).date());
if(err.isSucceeded()) err = op2.setAttribute("t_imported", \
"T");
- if(err.isSucceeded()) err = op2.setImportID("MMEX-STOCK-" + \
attributes.at(0)+ "_TR"); + if(err.isSucceeded()) err = \
op2.setImportID("MMEX-STOCK-" % attributes.at(0)% "_TR");
if(err.isSucceeded()) err = op2.setUnit(unitCurrency);
if(err.isSucceeded()) err = op2.save();
@@ -501,7 +501,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument err = unit.setName(attributes.at(2));
if(err.isSucceeded()) err = \
unit.setSymbol(attributes.at(2));
if(err.isSucceeded()) err = \
unit.setType(SKGUnitObject::OBJECT);
- if(err.isSucceeded()) err = \
unit.setInternetCode(QString("=") + (attributes.at(4) == "Depreciates" ? "-" : "+") + \
attributes.at(6)); + if(err.isSucceeded()) err = \
unit.setInternetCode(QString("=") % (attributes.at(4) == "Depreciates" ? "-" : "+") % \
attributes.at(6)); if(err.isSucceeded()) err = unit.save();
SKGUnitValueObject unitValue;
@@ -516,7 +516,7 @@ SKGError SKGImportMmb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
op.setComment(attributes.at(5));
if(err.isSucceeded()) err = \
op.setDate(SKGServices::stringToTime(attributes.at(1)).date());
if(err.isSucceeded()) err = \
op.setAttribute("t_imported", "T");
- if(err.isSucceeded()) err = op.setImportID("MMEX-ASSET-" \
+ attributes.at(0)); + if(err.isSucceeded()) err = \
op.setImportID("MMEX-ASSET-" % attributes.at(0)); if(err.isSucceeded()) err = \
op.setUnit(unit); if(err.isSucceeded()) err = op.save();
diff --git a/skgbankmodeler/skgimportmt940.cpp b/skgbankmodeler/skgimportmt940.cpp
index 7cf5bd5..e080e98 100644
--- a/skgbankmodeler/skgimportmt940.cpp
+++ b/skgbankmodeler/skgimportmt940.cpp
@@ -97,7 +97,7 @@ SKGError SKGImportMt940::importFile(SKGImportExportManager* \
iImporter, SKGDocume
//Search if account is already existing
SKGObjectBase::SKGListSKGObjectBase listAccount;
- err = iDocument->getObjects("v_account", \
"t_number='" + number + '\'', listAccount); + err \
= iDocument->getObjects("v_account", "t_number='" % number % '\'', listAccount); \
if(err.isSucceeded()) { if(listAccount.count() == 1) {
//Yes ! Only one account found
@@ -177,13 +177,13 @@ SKGError SKGImportMt940::importFile(SKGImportExportManager* \
iImporter, SKGDocume
} else if(line.startsWith(QLatin1String(":NS:")) && \
!operation.exist()) {
QString val = line.right(line.count() - 4);
QString comment = account.getComment();
- comment += (comment.isEmpty() || val.isEmpty() ? \
"" : " ") + val; + comment += (comment.isEmpty() \
|| val.isEmpty() ? "" : " ") % val;
if(err.isSucceeded()) err = \
account.setComment(comment);
if(err.isSucceeded()) err = account.save();
} else if(line.startsWith(QLatin1String(":86:")) || \
line.startsWith(QLatin1String(":NS:"))) {
QString val = line.right(line.count() - 4);
QString comment = operation.getComment();
- comment += (comment.isEmpty() || val.isEmpty() ? \
"" : " ") + val; + comment += (comment.isEmpty() \
|| val.isEmpty() ? "" : " ") % val;
if(err.isSucceeded()) err = \
operation.setComment(comment);
if(err.isSucceeded()) err = operation.save();
@@ -191,7 +191,7 @@ SKGError SKGImportMt940::importFile(SKGImportExportManager* \
iImporter, SKGDocume } else if(in86) {
QString val = line;
QString comment = operation.getComment();
- comment += (comment.isEmpty() || val.isEmpty() ? \
"" : " ") + val; + comment += (comment.isEmpty() \
|| val.isEmpty() ? "" : " ") % val;
if(err.isSucceeded()) err = \
operation.setComment(comment);
if(err.isSucceeded()) err = operation.save();
}
diff --git a/skgbankmodeler/skgimportskg.cpp b/skgbankmodeler/skgimportskg.cpp
index 8f4b174..08c0baf 100644
--- a/skgbankmodeler/skgimportskg.cpp
+++ b/skgbankmodeler/skgimportskg.cpp
@@ -258,7 +258,7 @@ SKGError SKGImportSkg::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = operation.setImported(true);
if(err.isSucceeded()) {
QString importID = operationOrigin.getImportID();
- if(importID.isEmpty()) importID = "SKG-" + \
SKGServices::intToString(operationOrigin.getID()); + \
if(importID.isEmpty()) importID = "SKG-" % \
SKGServices::intToString(operationOrigin.getID()); err = \
operation.setImportID(importID); }
if(err.isSucceeded()) {
@@ -366,7 +366,7 @@ SKGError SKGImportSkg::importFile(SKGImportExportManager* \
iImporter, SKGDocument SKGNodeObject nodeOrigin = listNodes.at(i);
SKGNodeObject node;
- err = SKGNodeObject::createPathNode(iDocument, i18n("Imported \
bookmarks") + OBJECTSEPARATOR + nodeOrigin.getFullName(), node); + \
err = SKGNodeObject::createPathNode(iDocument, i18n("Imported bookmarks") % \
OBJECTSEPARATOR % nodeOrigin.getFullName(), node);
if(err.isSucceeded()) err = node.setData(nodeOrigin.getData());
if(err.isSucceeded()) err = \
node.setOrder(nodeOrigin.getOrder());
if(err.isSucceeded()) err = \
node.setAutoStart(nodeOrigin.isAutoStart()); @@ -475,7 +475,7 @@ SKGError \
SKGImportSkg::copyParameters(const SKGObjectBase& iFrom, const SKGObjec SKGError \
err;
SKGObjectBase::SKGListSKGObjectBase params;
- err = iFrom.getDocument()->getObjects("parameters", "t_uuid_parent='" + \
SKGServices::stringToSqlString(iFrom.getUniqueID()) + '\'', params); + err = \
iFrom.getDocument()->getObjects("parameters", "t_uuid_parent='" % \
SKGServices::stringToSqlString(iFrom.getUniqueID()) % '\'', params); \
if(err.isSucceeded()) { int nb = params.count();
SKGDocument* documentTarget = (SKGDocument*) iTo.getDocument();
diff --git a/skgbankmodeler/skgimportxhb.cpp b/skgbankmodeler/skgimportxhb.cpp
index 51d6f25..9b298cb 100644
--- a/skgbankmodeler/skgimportxhb.cpp
+++ b/skgbankmodeler/skgimportxhb.cpp
@@ -181,7 +181,7 @@ SKGError SKGImportXhb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
budget.setCategory(catObj);
if(err.isSucceeded()) err = \
budget.setYear(year);
if(err.isSucceeded()) err = budget.setMonth(m);
- if(err.isSucceeded()) err = \
budget.setBudgetedAmount(SKGServices::stringToDouble(getAttribute(category, 'b' + \
SKGServices::intToString(b0.isEmpty() ? m : 0)))); + \
if(err.isSucceeded()) err = \
budget.setBudgetedAmount(SKGServices::stringToDouble(getAttribute(category, 'b' % \
SKGServices::intToString(b0.isEmpty() ? m : 0))));
if(err.isSucceeded()) err = budget.save();
}
}
@@ -219,7 +219,7 @@ SKGError SKGImportXhb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
else if(mode == "3") mode = i18nc("Noun: type of \
payement", "Cash");
else if(mode == "4" || mode == "5") mode = i18nc("Noun: \
type of payement", "Transfer");
else mode = i18nc("Noun: type of payement", "Other");
- QString comment = QString(getAttribute(transaction, \
"wording") + ' ' + getAttribute(transaction, "info")).trimmed(); + \
QString comment = QString(getAttribute(transaction, "wording") % ' ' % \
getAttribute(transaction, "info")).trimmed();
int flags = \
SKGServices::stringToInt(getAttribute(transaction, "flags"));
double amount = \
SKGServices::stringToDouble(getAttribute(transaction, "amount"));
SKGOperationObject::OperationStatus status = (flags == 1 \
|| flags == 3 ? SKGOperationObject::CHECKED : SKGOperationObject::NONE); @@ -237,7 \
+237,7 @@ SKGError SKGImportXhb::importFile(SKGImportExportManager* iImporter, \
SKGDocument
if(err.isSucceeded()) err = opObj.setComment(comment);
if(err.isSucceeded()) err = opObj.setTemplate(j == 2);
if(err.isSucceeded()) err = opObj.setImported(true);
- if(err.isSucceeded()) err = opObj.setImportID("HXB-" + \
SKGServices::intToString(i)); + if(err.isSucceeded()) err \
= opObj.setImportID("HXB-" % SKGServices::intToString(i));
if(err.isSucceeded()) err = opObj.setStatus(status);
if(err.isSucceeded()) err = opObj.save();
@@ -261,7 +261,7 @@ SKGError SKGImportXhb::importFile(SKGImportExportManager* \
iImporter, SKGDocument
if(err.isSucceeded()) err = \
op2Obj.setComment(comment);
if(err.isSucceeded()) err = op2Obj.setTemplate(j == \
2);
if(err.isSucceeded()) err = \
op2Obj.setImported(true);
- if(err.isSucceeded()) err = \
op2Obj.setImportID("HXB-" + SKGServices::intToString(i) + "_TR"); + \
if(err.isSucceeded()) err = op2Obj.setImportID("HXB-" % SKGServices::intToString(i) % \
"_TR");
if(err.isSucceeded()) err = \
op2Obj.setStatus(status);
if(err.isSucceeded()) err = op2Obj.save();
diff --git a/skgbankmodeler/skginterestobject.cpp \
b/skgbankmodeler/skginterestobject.cpp index e1d2990..390b412 100644
--- a/skgbankmodeler/skginterestobject.cpp
+++ b/skgbankmodeler/skginterestobject.cpp
@@ -111,7 +111,7 @@ QString SKGInterestObject::getWhereclauseId() const
if(output.isEmpty()) {
//No, so we use the date and parent
if(!(getAttribute("d_date").isEmpty()) && \
!(getAttribute("rd_account_id").isEmpty())) {
- output = "d_date='" + getAttribute("d_date") + "' AND rd_account_id=" + \
getAttribute("rd_account_id"); + output = "d_date='" % \
getAttribute("d_date") % "' AND rd_account_id=" % getAttribute("rd_account_id"); }
}
return output;
@@ -124,7 +124,7 @@ SKGError SKGInterestObject::setAccount(const SKGAccountObject& \
iAccount)
SKGError SKGInterestObject::getAccount(SKGAccountObject& oAccount) const
{
- SKGError err = getDocument()->getObject("v_account", "id=" + \
getAttribute("rd_account_id"), oAccount); + SKGError err = \
getDocument()->getObject("v_account", "id=" % getAttribute("rd_account_id"), \
oAccount); return err;
}
diff --git a/skgbankmodeler/skgoperationobject.cpp \
b/skgbankmodeler/skgoperationobject.cpp index 48a0f44..8bf4fe4 100644
--- a/skgbankmodeler/skgoperationobject.cpp
+++ b/skgbankmodeler/skgoperationobject.cpp
@@ -136,7 +136,7 @@ SKGError SKGOperationObject::duplicate(SKGOperationObject& \
oOperation, const QDa SKGError \
SKGOperationObject::getParentAccount(SKGAccountObject& oAccount) const {
SKGObjectBase objTmp;
- SKGError err = getDocument()->getObject("v_account", "id=" + \
getAttribute("rd_account_id"), objTmp); + SKGError err = \
getDocument()->getObject("v_account", "id=" % getAttribute("rd_account_id"), objTmp); \
oAccount = objTmp; return err;
}
@@ -173,7 +173,7 @@ SKGError SKGOperationObject::setPayee(const SKGPayeeObject& \
iPayee)
SKGError SKGOperationObject::getPayee(SKGPayeeObject& oPayee) const
{
- SKGError err = getDocument()->getObject("v_payee", "id=" + \
SKGServices::intToString(SKGServices::stringToInt(getAttribute("r_payee_id"))), \
oPayee); + SKGError err = getDocument()->getObject("v_payee", "id=" % \
SKGServices::intToString(SKGServices::stringToInt(getAttribute("r_payee_id"))), \
oPayee); return err;
}
@@ -222,7 +222,7 @@ QDate SKGOperationObject::getDate() const
SKGError SKGOperationObject::getUnit(SKGUnitObject& oUnit) const
{
- SKGError err = getDocument()->getObject("v_unit", "id=" + \
getAttribute("rc_unit_id"), oUnit); + SKGError err = \
getDocument()->getObject("v_unit", "id=" % getAttribute("rc_unit_id"), oUnit); \
return err; }
@@ -267,13 +267,13 @@ SKGError \
SKGOperationObject::getGroupedOperations(SKGListSKGObjectBase& oGrouped SKGError \
err; QString gpId1 = getAttribute("i_group_id");
if(gpId1 == "0") oGroupedOperations.clear();
- else err = getDocument()->getObjects("v_operation", "i_group_id=" + gpId1, \
oGroupedOperations); + else err = getDocument()->getObjects("v_operation", \
"i_group_id=" % gpId1, oGroupedOperations); return err;
}
SKGError SKGOperationObject::getGroupOperation(SKGOperationObject& oOperation) const
{
- SKGError err = getDocument()->getObject("v_operation", "id=" + \
getAttribute("i_group_id"), oOperation); + SKGError err = \
getDocument()->getObject("v_operation", "id=" % getAttribute("i_group_id"), \
oOperation); return err;
}
@@ -393,7 +393,7 @@ SKGError \
SKGOperationObject::getSubOperations(SKGListSKGObjectBase& oSubOperatio else {
err = getDocument()->getObjects("v_suboperation",
- "rd_operation_id=" + \
SKGServices::intToString(getID()), oSubOperations); + \
"rd_operation_id=" % SKGServices::intToString(getID()), oSubOperations); }
return err;
}
@@ -408,8 +408,8 @@ double SKGOperationObject::getBalance() const
double output = 0.0;
SKGStringListList result;
SKGError err = getDocument()->executeSelectSqliteOrder("SELECT \
TOTAL(f_CURRENTAMOUNT) FROM v_operation WHERE t_template='N' AND "
- "rd_account_id=" + getAttribute("rd_account_id") + " AND \
(d_date<'" + getAttribute("d_date") + "' OR "
- "(d_date='" + getAttribute("d_date") + "' AND id<=" + \
SKGServices::intToString(getID()) + "))", result); + \
"rd_account_id=" % getAttribute("rd_account_id") % " AND (d_date<'" % \
getAttribute("d_date") % "' OR " + "(d_date='" % \
getAttribute("d_date") % "' AND id<=" % SKGServices::intToString(getID()) % "))", \
result); if(err.isSucceeded()) {
output = SKGServices::stringToDouble(result.at(1).at(0));
}
@@ -424,7 +424,7 @@ double SKGOperationObject::getAmount(const QDate& iDate) const
//Is the unit value already in cache ?
double coef = 1;
- QString val = getDocument()->getCachedValue("unitvalue-" + \
getAttribute("rc_unit_id")); + QString val = \
getDocument()->getCachedValue("unitvalue-" % getAttribute("rc_unit_id")); \
if(!val.isEmpty()) { //Yes
coef = SKGServices::stringToDouble(val);
@@ -455,7 +455,7 @@ SKGError \
SKGOperationObject::getRecurrentOperations(SKGListSKGObjectBase& oRecur if(getID() \
== 0) err = SKGError(ERR_FAIL, i18nc("Error message", "%1 failed because linked \
object is not yet saved in the database.", \
QString("SKGOperationObject::getRecurrentOperation"))); else {
err = getDocument()->getObjects("v_recurrentoperation",
- "rd_operation_id=" + \
SKGServices::intToString(getID()), oRecurrentOperation); + \
"rd_operation_id=" % SKGServices::intToString(getID()), oRecurrentOperation); }
return err;
}
diff --git a/skgbankmodeler/skgpayeeobject.cpp b/skgbankmodeler/skgpayeeobject.cpp
index 26d3377..cad7daa 100644
--- a/skgbankmodeler/skgpayeeobject.cpp
+++ b/skgbankmodeler/skgpayeeobject.cpp
@@ -67,7 +67,7 @@ SKGError SKGPayeeObject::createPayee(SKGDocumentBank* iDocument,
if(iName.isEmpty()) {
oPayee = SKGPayeeObject(NULL, 0);
} else if(iDocument) {
- iDocument->getObject("v_payee", "t_name='" + \
SKGServices::stringToSqlString(iName) + '\'', oPayee); + \
iDocument->getObject("v_payee", "t_name='" % SKGServices::stringToSqlString(iName) % \
'\'', oPayee); if(oPayee.getID() == 0) {
//No, we have to create it
oPayee = SKGPayeeObject(iDocument);
@@ -86,7 +86,7 @@ SKGError SKGPayeeObject::createPayee(SKGDocumentBank* iDocument,
SKGError SKGPayeeObject::getOperations(SKGListSKGObjectBase& oOperations) const
{
SKGError err = getDocument()->getObjects("v_operation",
- "r_payee_id=" + SKGServices::intToString(getID()) ,
+ "r_payee_id=" % SKGServices::intToString(getID()) ,
oOperations);
return err;
}
diff --git a/skgbankmodeler/skgrecurrentoperationobject.cpp \
b/skgbankmodeler/skgrecurrentoperationobject.cpp index 66df1b4..7577c18 100644
--- a/skgbankmodeler/skgrecurrentoperationobject.cpp
+++ b/skgbankmodeler/skgrecurrentoperationobject.cpp
@@ -59,7 +59,7 @@ const SKGRecurrentOperationObject& \
SKGRecurrentOperationObject::operator= (const SKGError \
SKGRecurrentOperationObject::getParentOperation(SKGOperationObject& oOperation) const \
{ SKGObjectBase objTmp;
- SKGError err = getDocument()->getObject("v_operation", "id=" + \
getAttribute("rd_operation_id"), objTmp); + SKGError err = \
getDocument()->getObject("v_operation", "id=" % getAttribute("rd_operation_id"), \
objTmp); oOperation = objTmp;
return err;
}
@@ -193,7 +193,7 @@ bool SKGRecurrentOperationObject::isAutoWriteEnabled() const
SKGError SKGRecurrentOperationObject::getRecurredOperations(SKGListSKGObjectBase& \
oOperations) const {
- return getDocument()->getObjects("v_operation", "r_recurrentoperation_id=" + \
SKGServices::intToString(getID()), oOperations); + return \
getDocument()->getObjects("v_operation", "r_recurrentoperation_id=" % \
SKGServices::intToString(getID()), oOperations); }
SKGError SKGRecurrentOperationObject::process(int& oNbInserted, bool iForce, const \
QDate& iDate)
diff --git a/skgbankmodeler/skgruleobject.cpp b/skgbankmodeler/skgruleobject.cpp
index 16fd91f..563f438 100644
--- a/skgbankmodeler/skgruleobject.cpp
+++ b/skgbankmodeler/skgruleobject.cpp
@@ -152,10 +152,10 @@ QString SKGRuleObject::getSelectSqlOrder(const QString& \
iAdditionalCondition) co
QString wc2 = SKGRuleObject::getDescriptionFromXML((SKGDocument*) getDocument(), \
getXMLSearchDefinition(), true, SEARCH); if(!wc2.isEmpty()) {
if(wc.isEmpty()) wc = wc2;
- else wc = '(' + wc + ") AND (" + wc2 + ')';
+ else wc = '(' % wc % ") AND (" % wc2 % ')';
}
if(wc.isEmpty()) wc = "1=1";
- wc = "d_date!='0000-00-00' AND (" + wc + ')';
+ wc = "d_date!='0000-00-00' AND (" % wc % ')';
return wc;
}
@@ -453,7 +453,7 @@ QStringList SKGRuleObject::getFromXML(SKGDocument* iDocument, \
const QString& iXM //Case property
propName = attribute.right(attribute.length() - 2);
if(iType == SEARCH) {
- attribute = "i_PROPPNAME='" + \
SKGServices::stringToSqlString(propName) + "' AND i_PROPVALUE"; + \
attribute = "i_PROPPNAME='" % SKGServices::stringToSqlString(propName) % "' AND \
i_PROPVALUE"; } else {
attribute = "t_value";
}
@@ -468,7 +468,7 @@ QStringList SKGRuleObject::getFromXML(SKGDocument* iDocument, \
const QString& iXM
elementDescription += part;
} else {
- attribute = "operation." + attribute;
+ attribute = "operation." % attribute;
if(iDocument) attribute = iDocument->getDisplay(attribute);
if(iType != ALARM) {
@@ -493,9 +493,9 @@ QStringList SKGRuleObject::getFromXML(SKGDocument* iDocument, \
const QString& iXM if(iSQL) {
if(attribute2.startsWith(QLatin1String("p_"))) {
QString propertyName = \
attribute2.right(attribute2.length() - 2);
- attribute2 = "ifnull((SELECT \
v_operation_prop.i_PROPVALUE FROM v_operation_prop WHERE \
v_operation_prop.id=operation.id AND v_operation_prop.i_PROPPNAME='" + \
SKGServices::stringToSqlString(propertyName) + "'),'')"; + \
attribute2 = "ifnull((SELECT v_operation_prop.i_PROPVALUE FROM v_operation_prop WHERE \
v_operation_prop.id=operation.id AND v_operation_prop.i_PROPPNAME='" % \
SKGServices::stringToSqlString(propertyName) % "'),'')"; } else {
- attribute2 = "(SELECT " + attribute2 + " FROM \
v_operation_consolidated WHERE v_operation_consolidated.id=operation.id)"; + \
attribute2 = "(SELECT " % attribute2 % " FROM v_operation_consolidated WHERE \
v_operation_consolidated.id=operation.id)"; }
}
elementDescription = elementDescription.replace("#ATT2#", \
attribute2); @@ -509,26 +509,26 @@ QStringList SKGRuleObject::getFromXML(SKGDocument* \
iDocument, const QString& iXM QString sqlOrder;
if(attribute == "t_REALCATEGORY") {
elementDescription.replace(attribute, \
"t_fullname");
- output.push_back("UPDATE suboperation set \
r_category_id=(SELECT id FROM category WHERE " + elementDescription + ") WHERE \
i_tmp=1"); + output.push_back("UPDATE suboperation \
set r_category_id=(SELECT id FROM category WHERE " % elementDescription % ") WHERE \
i_tmp=1"); } else if(attribute == "t_ACCOUNT") {
elementDescription.replace(attribute, "t_name");
- output.push_back("UPDATE operation set \
rd_account_id=(SELECT id FROM account WHERE " + elementDescription + ") WHERE \
i_tmp=1"); + output.push_back("UPDATE operation \
set rd_account_id=(SELECT id FROM account WHERE " % elementDescription % ") WHERE \
i_tmp=1"); } else if(attribute == "t_PAYEE") {
elementDescription.replace(attribute, "t_name");
- output.push_back("UPDATE operation set \
r_payee_id=(SELECT id FROM payee WHERE " + elementDescription + ") WHERE i_tmp=1"); + \
output.push_back("UPDATE operation set r_payee_id=(SELECT id FROM payee WHERE " % \
elementDescription % ") WHERE i_tmp=1"); } else if(attribute == "t_REALREFUND") {
elementDescription.replace(attribute, "t_name");
- output.push_back("UPDATE suboperation set \
r_refund_id=(SELECT id FROM refund WHERE " + elementDescription + ") WHERE i_tmp=1"); \
+ output.push_back("UPDATE suboperation set \
r_refund_id=(SELECT id FROM refund WHERE " % elementDescription % ") \
WHERE i_tmp=1");
} else \
if(element.attribute("attribute").startsWith(QLatin1String("p_"))) {
- output.push_back("INSERT OR IGNORE INTO \
parameters (t_uuid_parent, t_name, i_tmp) SELECT o.id||'-operation', '" + \
SKGServices::stringToSqlString(propName) + "', 1 FROM operation o \
WHERE o.i_tmp=1");
- output.push_back("UPDATE parameters set " + \
elementDescription + " WHERE i_tmp=1 AND t_name='" + \
SKGServices::stringToSqlString(propName) + "' AND NOT(" + \
elementDescription + ')');
- output.push_back("DELETE FROM parameters WHERE \
i_tmp=1 AND t_name='" + SKGServices::stringToSqlString(propName) + "' AND \
t_value=''"); + output.push_back("INSERT OR IGNORE \
INTO parameters (t_uuid_parent, t_name, i_tmp) SELECT o.id||'-operation', '" % \
SKGServices::stringToSqlString(propName) % "', 1 FROM operation o WHERE o.i_tmp=1"); \
+ output.push_back("UPDATE parameters set " % \
elementDescription % " WHERE i_tmp=1 AND t_name='" % \
SKGServices::stringToSqlString(propName) % "' AND NOT(" % elementDescription % ')'); \
+ output.push_back("DELETE FROM parameters WHERE \
i_tmp=1 AND t_name='" % SKGServices::stringToSqlString(propName) % "' AND \
t_value=''"); } else {
- output.push_back("UPDATE operation set " + \
elementDescription + " WHERE i_tmp=1 AND NOT(" + elementDescription + ')'); + \
output.push_back("UPDATE operation set " % elementDescription % " WHERE i_tmp=1 AND \
NOT(" % elementDescription % ')'); }
}
} else if(iType == ALARM) {
- output.push_back("SELECT " + elementDescription + " FROM \
v_operation_consolidated WHERE #WC#"); + \
output.push_back("SELECT " % elementDescription % " FROM v_operation_consolidated \
WHERE #WC#"); }
}
@@ -542,7 +542,7 @@ QStringList SKGRuleObject::getFromXML(SKGDocument* iDocument, \
const QString& iXM }
if(!(iType != SEARCH && iSQL) && !lineDescription.isEmpty()) {
- if(iType == SEARCH && parenthesisNeeded) lineDescription = '(' + \
lineDescription + ')'; + if(iType == SEARCH && parenthesisNeeded) \
lineDescription = '(' % lineDescription % ')'; output.push_back(lineDescription);
}
}
diff --git a/skgbankmodeler/skgsuboperationobject.cpp \
b/skgbankmodeler/skgsuboperationobject.cpp index 01013a8..04e5526 100644
--- a/skgbankmodeler/skgsuboperationobject.cpp
+++ b/skgbankmodeler/skgsuboperationobject.cpp
@@ -78,7 +78,7 @@ SKGError SKGSubOperationObject::setFormula(const QString& iFormula)
SKGError SKGSubOperationObject::getParentOperation(SKGOperationObject& oOperation) \
const {
- SKGError err = getDocument()->getObject("v_operation", "id=" + \
getAttribute("rd_operation_id"), oOperation); + SKGError err = \
getDocument()->getObject("v_operation", "id=" % getAttribute("rd_operation_id"), \
oOperation); return err;
}
@@ -90,7 +90,7 @@ SKGError SKGSubOperationObject::setParentOperation(const \
SKGOperationObject& iOp
SKGError SKGSubOperationObject::getCategory(SKGCategoryObject& oCategory) const
{
- SKGError err = getDocument()->getObject("v_category", "id=" + \
getAttribute("r_category_id"), oCategory); + SKGError err = \
getDocument()->getObject("v_category", "id=" % getAttribute("r_category_id"), \
oCategory); return err;
}
@@ -131,7 +131,7 @@ SKGError SKGSubOperationObject::getTracker(SKGTrackerObject& \
oTracker) const {
QString idS = getAttribute("r_refund_id");
if(idS.isEmpty()) idS = '0';
- SKGError err = getDocument()->getObject("v_refund", "id=" + idS, oTracker);
+ SKGError err = getDocument()->getObject("v_refund", "id=" % idS, oTracker);
return err;
}
diff --git a/skgbankmodeler/skgtrackerobject.cpp \
b/skgbankmodeler/skgtrackerobject.cpp index dd3ae0e..8fe1d64 100644
--- a/skgbankmodeler/skgtrackerobject.cpp
+++ b/skgbankmodeler/skgtrackerobject.cpp
@@ -66,7 +66,7 @@ SKGError SKGTrackerObject::createTracker(SKGDocumentBank* \
iDocument, if(iName.isEmpty()) {
oTracker = SKGTrackerObject(NULL, 0);
} else if(iDocument) {
- iDocument->getObject("v_refund", "t_name='" + \
SKGServices::stringToSqlString(iName) + '\'', oTracker); + \
iDocument->getObject("v_refund", "t_name='" % SKGServices::stringToSqlString(iName) % \
'\'', oTracker); if(oTracker.getID() == 0) {
//No, we have to create it
oTracker = SKGTrackerObject(iDocument);
@@ -85,7 +85,7 @@ SKGError SKGTrackerObject::createTracker(SKGDocumentBank* \
iDocument, SKGError SKGTrackerObject::getSubOperations(SKGListSKGObjectBase& \
oSubOperations) const {
SKGError err = getDocument()->getObjects("v_suboperation",
- "r_refund_id=" + SKGServices::intToString(getID()) ,
+ "r_refund_id=" % SKGServices::intToString(getID()) ,
oSubOperations);
return err;
}
diff --git a/skgbankmodeler/skgunitobject.cpp b/skgbankmodeler/skgunitobject.cpp
index 37ca5e2..2b27f6d 100644
--- a/skgbankmodeler/skgunitobject.cpp
+++ b/skgbankmodeler/skgunitobject.cpp
@@ -77,14 +77,14 @@ QString SKGUnitObject::getWhereclauseId() const
QString output = SKGObjectBase::getWhereclauseId();
if(output.isEmpty()) {
QString name = getName();
- if(!name.isEmpty()) output = "t_name='" + \
SKGServices::stringToSqlString(name) + '\''; + if(!name.isEmpty()) output = \
"t_name='" % SKGServices::stringToSqlString(name) % '\'';
QString symbol = getSymbol();
if(!symbol.isEmpty()) {
if(!output.isEmpty()) output += " OR ";
- output += "t_symbol='" + SKGServices::stringToSqlString(symbol) + '\'';
+ output += "t_symbol='" % SKGServices::stringToSqlString(symbol) % '\'';
}
- if(!output.isEmpty()) output = '(' + output + ')';
+ if(!output.isEmpty()) output = '(' % output % ')';
}
return output;
@@ -97,7 +97,7 @@ QStringList SKGUnitObject::getListofKnownCurrencies(bool \
iIncludingObsolete) QStringList units = \
KCurrencyCode::allCurrencyCodesList(iIncludingObsolete ? \
KCurrencyCode::ActiveCurrency | KCurrencyCode::SuspendedCurrency | \
KCurrencyCode::ObsoleteCurrency : KCurrencyCode::ActiveCurrency); int nb = \
units.count(); for(int i = 0; i < nb; ++i) {
- output << KCurrencyCode::currencyCodeToName(units.at(i), KGlobal::locale() \
== NULL ? "en" : "") + " (" + units.at(i) + ')'; + output << \
KCurrencyCode::currencyCodeToName(units.at(i), KGlobal::locale() == NULL ? "en" : "") \
% " (" % units.at(i) % ')'; }
output.sort();
@@ -148,7 +148,7 @@ SKGServices::SKGUnitInfo SKGUnitObject::getUnitInfo(const \
QString& iUnitName) //Principal units
if(KCurrencyCode::isValid(isoCode)) {
KCurrencyCode unitCode(isoCode, KGlobal::locale() == NULL ? "en" : "");
- info.Name = unitCode.name() + " (" + unitCode.isoCurrencyCode() + ')';
+ info.Name = unitCode.name() % " (" % unitCode.isoCurrencyCode() % ')';
info.Symbol = unitCode.unambiguousSymbol();
if(info.Symbol.isEmpty()) info.Symbol = unitCode.name();
QStringList counties = unitCode.countriesUsingCurrency();
@@ -230,7 +230,7 @@ SKGError SKGUnitObject::createCurrencyUnit(SKGDocumentBank* \
iDocument, const QSt
QString codeprimunit = getInternationalCode(primunit.getName());
QString codeunit = getInternationalCode(info.Name);
if(!codeprimunit.isEmpty()) {
- info.Internet = codeunit + codeprimunit + "=X";
+ info.Internet = codeunit % codeprimunit % "=X";
info.Value = -1;
parentUnit = SKGUnitObject(iDocument);
@@ -340,7 +340,7 @@ SKGUnitObject::UnitType SKGUnitObject::getType() const
SKGError SKGUnitObject::getUnit(SKGUnitObject& oUnit) const
{
SKGError err;
- if(getDocument()) err = getDocument()->getObject("v_unit", "id=" + \
getAttribute("rd_unit_id"), oUnit); + if(getDocument()) err = \
getDocument()->getObject("v_unit", "id=" % getAttribute("rd_unit_id"), oUnit); \
return err; }
@@ -373,7 +373,7 @@ SKGError SKGUnitObject::addUnitValue(SKGUnitValueObject& \
oUnitValue) SKGError SKGUnitObject::getUnitValues(SKGListSKGObjectBase& \
oUnitValueList) const {
SKGError err = getDocument()->getObjects("v_unitvalue",
- "rd_unit_id=" + SKGServices::intToString(getID()),
+ "rd_unit_id=" % SKGServices::intToString(getID()),
oUnitValueList);
return err;
}
@@ -381,7 +381,7 @@ SKGError SKGUnitObject::getUnitValues(SKGListSKGObjectBase& \
oUnitValueList) cons SKGError SKGUnitObject::getLastUnitValue(SKGUnitValueObject& \
oUnitValue) const {
return SKGObjectBase::getDocument()->getObject("v_unitvalue",
- "rd_unit_id=" + SKGServices::intToString(getID()) + " AND d_date=(select \
MAX(u2.d_date) from unitvalue u2 where u2.rd_unit_id=" + \
SKGServices::intToString(getID()) + ')', + "rd_unit_id=" % \
SKGServices::intToString(getID()) % " AND d_date=(select MAX(u2.d_date) from \
unitvalue u2 where u2.rd_unit_id=" % SKGServices::intToString(getID()) % ')', \
oUnitValue); }
@@ -390,17 +390,17 @@ SKGError SKGUnitObject::getUnitValue(const QDate& iDate, \
SKGUnitValueObject& oUn QString ids = SKGServices::intToString(getID());
QString dates = SKGServices::dateToSqlString(QDateTime(iDate));
SKGError err = SKGObjectBase::getDocument()->getObject("v_unitvalue",
- "rd_unit_id=" + ids + " AND d_date<='" + dates +
- "' AND ABS(strftime('%s','" + dates +
- "')-strftime('%s',d_date))=(select MIN(ABS(strftime('%s','" + \
dates +
- "')-strftime('%s',u2.d_date))) from unitvalue u2 where \
u2.rd_unit_id=" + ids +
- " AND u2.d_date<='" + dates + "')",
+ "rd_unit_id=" % ids % " AND d_date<='" % dates %
+ "' AND ABS(strftime('%s','" % dates %
+ "')-strftime('%s',d_date))=(select MIN(ABS(strftime('%s','" % \
dates % + "')-strftime('%s',u2.d_date))) from unitvalue u2 where \
u2.rd_unit_id=" % ids % + " AND u2.d_date<='" % dates % "')",
oUnitValue);
//If not found then get first
if(err.isFailed()) err = SKGObjectBase::getDocument()->getObject("v_unitvalue",
- "rd_unit_id=" + SKGServices::intToString(getID()) + \
" AND d_date=(select MIN(d_date) from unitvalue where rd_unit_id=" +
- SKGServices::intToString(getID()) + ')',
+ "rd_unit_id=" % SKGServices::intToString(getID()) % \
" AND d_date=(select MIN(d_date) from unitvalue where rd_unit_id=" % + \
SKGServices::intToString(getID()) % ')', oUnitValue);
return err;
}
@@ -412,7 +412,7 @@ double SKGUnitObject::getAmount(const QDate& iDate) const
//Search result in cache
QString ids = SKGServices::intToString(getID());
QString dates = SKGServices::dateToSqlString(QDateTime(iDate));
- QString key = "unitvalue-" + ids + '-' + dates;
+ QString key = "unitvalue-" % ids % '-' % dates;
QString val = getDocument()->getCachedValue(key);
if(val.isEmpty()) {
//Get quantity
@@ -429,7 +429,7 @@ double SKGUnitObject::getAmount(const QDate& iDate) const
if(getAttribute("i_NBVALUES") == "1") {
//Store value for this symbol for all date
- ((SKGDocument*) getDocument())->addValueInCache("unitvalue-" + ids, \
SKGServices::doubleToString(output)); + ((SKGDocument*) \
getDocument())->addValueInCache("unitvalue-" % ids, \
SKGServices::doubleToString(output)); }
} else {
output = SKGServices::stringToDouble(val);
@@ -444,9 +444,9 @@ double SKGUnitObject::getDailyChange(const QDate& iDate) const
double output = 0;
SKGStringListList result;
SKGError err = getDocument()->executeSelectSqliteOrder(
- "SELECT d_date, f_quantity from unitvalue where rd_unit_id=" \
+
- SKGServices::intToString(getID()) +
- " AND d_date<='" + \
SKGServices::dateToSqlString(QDateTime(iDate)) + + "SELECT \
d_date, f_quantity from unitvalue where rd_unit_id=" % + \
SKGServices::intToString(getID()) % + " AND d_date<='" % \
SKGServices::dateToSqlString(QDateTime(iDate)) % "' ORDER BY d_date DESC LIMIT 2",
result);
if(err.isSucceeded() && result.count() == 3) {
@@ -466,10 +466,10 @@ SKGError SKGUnitObject::split(double iRatio) const
SKGError err;
if(iRatio > 0) {
- err = getDocument()->executeSqliteOrder("UPDATE unitvalue SET \
f_quantity=f_quantity/" + SKGServices::doubleToString(iRatio) +
- " WHERE rd_unit_id=" + \
SKGServices::intToString(getID()));
- if(err.isSucceeded()) err = getDocument()->executeSqliteOrder("UPDATE \
suboperation SET f_value=f_value*" + \
SKGServices::doubleToString(iRatio) +
- " WHERE rd_operation_id IN (SELECT id FROM \
operation WHERE rc_unit_id=" + SKGServices::intToString(getID()) + ')'); + err \
= getDocument()->executeSqliteOrder("UPDATE unitvalue SET f_quantity=f_quantity/" % \
SKGServices::doubleToString(iRatio) % + \
" WHERE rd_unit_id=" % SKGServices::intToString(getID())); + \
if(err.isSucceeded()) err = getDocument()->executeSqliteOrder("UPDATE suboperation \
SET f_value=f_value*" % SKGServices::doubleToString(iRatio) % + \
" WHERE rd_operation_id IN (SELECT id FROM operation WHERE rc_unit_id=" % \
SKGServices::intToString(getID()) % ')');
} else err = SKGError(ERR_INVALIDARG, i18nc("Error message", "Invalid ratio. \
Ratio must be greater than 0.")); return err;
}
@@ -487,10 +487,10 @@ SKGError SKGUnitObject::downloadUnitValue(UnitDownloadMode \
iMode, int nbMaxValue QDate firstDate;
SKGStringListList result;
QString dateParameters;
- doc->executeSelectSqliteOrder("SELECT MAX(d_date) FROM unitvalue where \
rd_unit_id=(SELECT id from unit where t_name='" + \
SKGServices::stringToSqlString(unitname) + "')", result); + \
doc->executeSelectSqliteOrder("SELECT MAX(d_date) FROM unitvalue where \
rd_unit_id=(SELECT id from unit where t_name='" % \
SKGServices::stringToSqlString(unitname) % "')", result); if(result.count() == 2) {
firstDate = SKGServices::stringToTime(result.at(1).at(0)).date();
- dateParameters = "a=" + SKGServices::intToString(firstDate.month() - 1) \
+ "&b=" + SKGServices::intToString(firstDate.day()) + "&c=" + \
SKGServices::intToString(firstDate.year()); + dateParameters = "a=" % \
SKGServices::intToString(firstDate.month() - 1) % "&b=" % \
SKGServices::intToString(firstDate.day()) % "&c=" % \
SKGServices::intToString(firstDate.year()); }
if(code.startsWith(QLatin1String("="))) {
@@ -507,7 +507,7 @@ SKGError SKGUnitObject::downloadUnitValue(UnitDownloadMode iMode, \
int nbMaxValue //Get last value
SKGStringListList result;
double value = 100;
- doc->executeSelectSqliteOrder("SELECT f_quantity FROM unitvalue where \
rd_unit_id=(SELECT id from unit where t_name='" + \
SKGServices::stringToSqlString(unitname) + "') AND d_date='" + \
SKGServices::dateToSqlString(QDateTime(firstDate)) + '\'', result); + \
doc->executeSelectSqliteOrder("SELECT f_quantity FROM unitvalue where \
rd_unit_id=(SELECT id from unit where t_name='" % \
SKGServices::stringToSqlString(unitname) % "') AND d_date='" % \
SKGServices::dateToSqlString(QDateTime(firstDate)) % '\'', result);
if(result.count() == 2) value = \
SKGServices::stringToDouble(result.at(1).at(0));
//Compute and add values
@@ -546,17 +546,17 @@ SKGError SKGUnitObject::downloadUnitValue(UnitDownloadMode \
iMode, int nbMaxValue //&g=m = monthly
QString parameters;
bool last = (iMode == LAST);
- if(last) parameters = dateParameters + "&g=d";
- else if(iMode == LAST_MONTHLY) parameters = dateParameters + "&g=m";
- else if(iMode == LAST_WEEKLY) parameters = dateParameters + "&g=w";
- else if(iMode == LAST_DAILY) parameters = dateParameters + "&g=d";
+ if(last) parameters = dateParameters % "&g=d";
+ else if(iMode == LAST_MONTHLY) parameters = dateParameters % "&g=m";
+ else if(iMode == LAST_WEEKLY) parameters = dateParameters % "&g=w";
+ else if(iMode == LAST_DAILY) parameters = dateParameters % "&g=d";
else if(iMode == ALL_MONTHLY) parameters = "g=m";
else if(iMode == ALL_WEEKLY) parameters = "g=w";
else if(iMode == ALL_DAILY) parameters = "g=d";
//Download history
if(!last) {
- QString path = "http://ichart.finance.yahoo.com/table.csv?s=" + code \
+ "&ignore=.csv&" + parameters; + QString path = \
"http://ichart.finance.yahoo.com/table.csv?s=" % code % "&ignore=.csv&" % parameters; \
KUrl url(path); QString tmpFile;
if(KIO::NetAccess::download(url, tmpFile, NULL)) {
@@ -779,10 +779,10 @@ SKGError SKGUnitObject::downloadUnitValue(UnitDownloadMode \
iMode, int nbMaxValue }
//Add yahoo url
- err = setProperty(i18nc("Yahoo title for a downloaded \
information of a share", "Yahoo page"), "http://finance.yahoo.com/q?s=" + code); + \
err = setProperty(i18nc("Yahoo title for a downloaded information of a share", "Yahoo \
page"), "http://finance.yahoo.com/q?s=" % code); }
- QString path = "http://download.finance.yahoo.com/d/quotes.csv?s=" + \
code + "&f=l1d1" + yahooString;//l1=val d1=date + QString path = \
"http://download.finance.yahoo.com/d/quotes.csv?s=" % code % "&f=l1d1" % \
yahooString;//l1=val d1=date KUrl url(path);
QString tmpFile;
if(err.isSucceeded() && KIO::NetAccess::download(url, tmpFile, \
NULL)) { @@ -841,7 +841,7 @@ SKGError \
SKGUnitObject::downloadUnitValue(UnitDownloadMode iMode, int nbMaxValue SKGError \
SKGUnitObject::getOperations(SKGObjectBase::SKGListSKGObjectBase& oOperations) const \
{ SKGError err = getDocument()->getObjects("v_operation",
- "rc_unit_id=" + SKGServices::intToString(getID()) ,
+ "rc_unit_id=" % SKGServices::intToString(getID()) ,
oOperations);
return err;
}
diff --git a/skgbankmodeler/skgunitvalueobject.cpp \
b/skgbankmodeler/skgunitvalueobject.cpp index a666c39..eb792f8 100644
--- a/skgbankmodeler/skgunitvalueobject.cpp
+++ b/skgbankmodeler/skgunitvalueobject.cpp
@@ -82,7 +82,7 @@ QString SKGUnitValueObject::getWhereclauseId() const
if(output.isEmpty()) {
//No, so we use the date and parent
if(!(getAttribute("d_date").isEmpty()) && \
!(getAttribute("rd_unit_id").isEmpty())) {
- output = "d_date='" + getAttribute("d_date") + "' AND rd_unit_id=" + \
getAttribute("rd_unit_id"); + output = "d_date='" % getAttribute("d_date") \
% "' AND rd_unit_id=" % getAttribute("rd_unit_id"); }
}
return output;
@@ -91,7 +91,7 @@ QString SKGUnitValueObject::getWhereclauseId() const
SKGError SKGUnitValueObject::getUnit(SKGUnitObject& oUnit) const
{
SKGError err;
- if(getDocument()) err = getDocument()->getObject("v_unit", "id=" + \
getAttribute("rd_unit_id"), oUnit); + if(getDocument()) err = \
getDocument()->getObject("v_unit", "id=" % getAttribute("rd_unit_id"), oUnit); \
return err; }
#include "skgunitvalueobject.moc"
diff --git a/skgbankmodelertest/skgtestautoreconcile.cpp \
b/skgbankmodelertest/skgtestautoreconcile.cpp index 5f3f432..04e73f9 100644
--- a/skgbankmodelertest/skgtestautoreconcile.cpp
+++ b/skgbankmodelertest/skgtestautoreconcile.cpp
@@ -44,7 +44,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_BP_CSV", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/bankperfect.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/bankperfect.csv"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestbigdocument.cpp \
b/skgbankmodelertest/skgtestbigdocument.cpp index e7d04e0..ef6a1e4 100644
--- a/skgbankmodelertest/skgtestbigdocument.cpp
+++ b/skgbankmodelertest/skgtestbigdocument.cpp
@@ -41,7 +41,7 @@ int main(int argc, char** argv)
//============================================================================
//Init
- QString filename = getTestPath("OUT") + \
"/skgtestbigdocument/skgtestbigdocument.skg"; + QString filename = \
getTestPath("OUT") % "/skgtestbigdocument/skgtestbigdocument.skg";
{
//Test bank document
@@ -80,13 +80,13 @@ int main(int argc, char** argv)
SKGCategoryObject* cats = new SKGCategoryObject[30];
for(int i = 0; i < 10; ++i) {
cats[i] = SKGCategoryObject(&document1);
- SKGTESTERROR("CAT:setName", cats[i].setName("cat_" + \
SKGServices::intToString(i)), true); + SKGTESTERROR("CAT:setName", \
cats[i].setName("cat_" % SKGServices::intToString(i)), true); \
SKGTESTERROR("CAT:save", cats[i].save(), true);
for(int j = 0; j < 2; ++j) {
int indexSubCat = 10 * (j + 1) + i;
SKGTESTERROR("CAT:addCategory", \
cats[i].addCategory(cats[indexSubCat]), true);
- SKGTESTERROR("CAT:setName", cats[indexSubCat].setName("cat_" + \
SKGServices::intToString(i) + '_' + SKGServices::intToString(j)), true); + \
SKGTESTERROR("CAT:setName", cats[indexSubCat].setName("cat_" % \
SKGServices::intToString(i) % '_' % SKGServices::intToString(j)), \
true);
SKGTESTERROR("CAT:save", cats[indexSubCat].save(), true);
}
}
@@ -170,7 +170,7 @@ int main(int argc, char** argv)
SKGDocumentBank document1;
{
SKGTRACEIN(0, "openTest-Load");
- SKGTESTERROR("document1.load", document1.load(getTestPath("OUT") + \
"/skgtestbigdocument/skgtestbigdocument.skg"), true); + \
SKGTESTERROR("document1.load", document1.load(getTestPath("OUT") % \
"/skgtestbigdocument/skgtestbigdocument.skg"), true); }
{
diff --git a/skgbankmodelertest/skgtestbudget.cpp \
b/skgbankmodelertest/skgtestbudget.cpp index 755f11f..a5dacc4 100644
--- a/skgbankmodelertest/skgtestbudget.cpp
+++ b/skgbankmodelertest/skgtestbudget.cpp
@@ -40,7 +40,7 @@ int main(int argc, char** argv)
{
//Import
SKGDocumentBank document1;
- SKGTESTERROR("document1.load()", document1.load(getTestPath("IN") + \
"skgtestbudget/budget.skg"), true); + SKGTESTERROR("document1.load()", \
document1.load(getTestPath("IN") % "skgtestbudget/budget.skg"), true); SKGError err;
{
//Scope of the transaction
@@ -102,7 +102,7 @@ int main(int argc, char** argv)
SKGTESTERROR("BUDGETRULE.processAllRules", \
SKGBudgetRuleObject::processAllRules(&document1), true); }
- SKGTESTERROR("document1.saveAs()", document1.saveAs(getTestPath("OUT") + \
"skgtestbudget/budget.skg", true), true); + SKGTESTERROR("document1.saveAs()", \
document1.saveAs(getTestPath("OUT") % "skgtestbudget/budget.skg", true), true); }
//End test
diff --git a/skgbankmodelertest/skgtestcategory.cpp \
b/skgbankmodelertest/skgtestcategory.cpp index fc31965..85a7d78 100644
--- a/skgbankmodelertest/skgtestcategory.cpp
+++ b/skgbankmodelertest/skgtestcategory.cpp
@@ -47,7 +47,7 @@ int main(int argc, char** argv)
//Create category 0
SKGCategoryObject cat0(&document1);
- SKGTESTERROR("CAT:setName+invalid name", cat0.setName('a' + \
OBJECTSEPARATOR + 'b'), false); + SKGTESTERROR("CAT:setName+invalid name", \
cat0.setName('a' % OBJECTSEPARATOR % 'b'), false); SKGTEST("CAT:exist", \
cat0.exist(), false); SKGTESTERROR("CAT:save", cat0.save(), false);
@@ -63,7 +63,7 @@ int main(int argc, char** argv)
SKGCategoryObject cat11 = obj1;
//Update with bad name
- SKGTESTERROR("CAT:setName", cat1.setName("root1" + OBJECTSEPARATOR + \
'A'), false); + SKGTESTERROR("CAT:setName", cat1.setName("root1" % \
OBJECTSEPARATOR % 'A'), false); SKGTESTERROR("CAT:load", cat1.load(), true);
SKGTEST("CAT:getFullName", cat1.getFullName(), "root1");
@@ -72,12 +72,12 @@ int main(int argc, char** argv)
SKGTESTERROR("CAT:addCategory", cat1.addCategory(cat1_1), true);
SKGTESTERROR("CAT:setName", cat1_1.setName("cat1"), true);
SKGTESTERROR("CAT:save", cat1_1.save(), true);
- SKGTEST("CAT:getFullName", cat1_1.getFullName(), "root1" + \
OBJECTSEPARATOR + "cat1"); + SKGTEST("CAT:getFullName", \
cat1_1.getFullName(), "root1" % OBJECTSEPARATOR % "cat1");
//Update cat1_1
SKGTESTERROR("CAT:setName", cat1_1.setName("CAT1"), true);
SKGTESTERROR("CAT:save", cat1_1.save(), true);
- SKGTEST("CAT:getFullName", cat1_1.getFullName(), "root1" + \
OBJECTSEPARATOR + "CAT1"); + SKGTEST("CAT:getFullName", \
cat1_1.getFullName(), "root1" % OBJECTSEPARATOR % "CAT1");
//Update cat1
SKGTESTERROR("CAT:setName", cat1.setName("ROOT1"), true);
@@ -85,39 +85,39 @@ int main(int argc, char** argv)
SKGTEST("CAT:getFullName", cat1.getFullName(), "ROOT1");
SKGTESTERROR("CAT:load", cat1_1.load(), true);
- SKGTEST("CAT:getFullName", cat1_1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "CAT1"); + SKGTEST("CAT:getFullName", \
cat1_1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT1");
//Create category 1.2
SKGCategoryObject cat1_2;
SKGTESTERROR("CAT:addCategory", cat1.addCategory(cat1_2), true);
SKGTESTERROR("CAT:setName", cat1_2.setName("CAT2"), true);
SKGTESTERROR("CAT:save", cat1_2.save(), true);
- SKGTEST("CAT:getFullName", cat1_2.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "CAT2"); + SKGTEST("CAT:getFullName", \
cat1_2.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT2");
//Create category end
SKGCategoryObject end1;
SKGTESTERROR("CAT:addCategory", cat1_1.addCategory(end1), true);
SKGTESTERROR("CAT:setName", end1.setName("END"), true);
SKGTESTERROR("CAT:save", end1.save(), true);
- SKGTEST("CAT:getFullName", end1.getFullName(), "ROOT1" + OBJECTSEPARATOR \
+ "CAT1" + OBJECTSEPARATOR + "END"); + SKGTEST("CAT:getFullName", \
end1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT1" % OBJECTSEPARATOR % "END");
//Create category end
SKGCategoryObject end2;
SKGTESTERROR("CAT:addCategory", cat1_2.addCategory(end2), true);
SKGTESTERROR("CAT:setName", end2.setName("END"), true);
SKGTESTERROR("CAT:save", end2.save(), true);
- SKGTEST("CAT:getFullName", end2.getFullName(), "ROOT1" + OBJECTSEPARATOR \
+ "CAT2" + OBJECTSEPARATOR + "END"); + SKGTEST("CAT:getFullName", \
end2.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT2" % OBJECTSEPARATOR % "END");
SKGCategoryObject end2_1;
SKGTESTERROR("CAT:addCategory", end2.addCategory(end2_1), true);
SKGTESTERROR("CAT:setName", end2_1.setName("REALEND"), true);
SKGTESTERROR("CAT:save", end2_1.save(), true);
- SKGTEST("CAT:getFullName", end2_1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "CAT2" + OBJECTSEPARATOR + "END" + OBJECTSEPARATOR + "REALEND"); + \
SKGTEST("CAT:getFullName", end2_1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT2" % \
OBJECTSEPARATOR % "END" % OBJECTSEPARATOR % "REALEND");
//Get parent
SKGCategoryObject parent1;
SKGTESTERROR("CAT:getParentCategory", end2.getParentCategory(parent1), \
true);
- SKGTEST("CAT:getFullName", parent1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "CAT2"); + SKGTEST("CAT:getFullName", \
parent1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "CAT2");
//Get parent
SKGTESTERROR("CAT:getParentCategory", \
parent1.getParentCategory(parent2), true); @@ -178,7 +178,7 @@ int main(int argc, \
char** argv) SKGBEGINTRANSACTION(document1, "CAT_T1", err);
SKGCategoryObject cat;
- SKGTESTERROR("CAT:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' + OBJECTSEPARATOR + 'A', cat), \
true); + SKGTESTERROR("CAT:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' % OBJECTSEPARATOR % 'A', cat), \
true); QStringList oResult;
SKGTESTERROR("CAT:getDistinctValues", \
document1.getDistinctValues("category", "id", oResult), true); \
SKGTEST("CAT:oResult.size", oResult.size(), 2); @@ -194,7 +194,7 @@ int main(int \
argc, char** argv) SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGCategoryObject categoryB;
- SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' + OBJECTSEPARATOR + 'B', \
categoryB), true); + SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' % OBJECTSEPARATOR % 'B', \
categoryB), true); SKGCategoryObject categoryC;
SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, "C", categoryC), true); \
SKGCategoryObject categoryA; @@ -218,11 +218,11 @@ int main(int argc, char** argv)
SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGCategoryObject categoryB;
- SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' + OBJECTSEPARATOR + 'B', \
categoryB), true); + SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'A' % OBJECTSEPARATOR % 'B', \
categoryB), true); SKGCategoryObject categoryC;
SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, "C", categoryC), true); \
SKGCategoryObject categoryA;
- SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'C' + OBJECTSEPARATOR + 'A', \
categoryA), true); + SKGTESTERROR("NOD:createPathCategory", \
SKGCategoryObject::createPathCategory(&document1, 'C' % OBJECTSEPARATOR % 'A', \
categoryA), true);
QStringList oResult;
SKGTESTERROR("CAT:getDistinctValues", \
document1.getDistinctValues("category", "id", oResult), true);
diff --git a/skgbankmodelertest/skgtestimportcsv.cpp \
b/skgbankmodelertest/skgtestimportcsv.cpp index 557019f..779e9f7 100644
--- a/skgbankmodelertest/skgtestimportcsv.cpp
+++ b/skgbankmodelertest/skgtestimportcsv.cpp
@@ -47,7 +47,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_CSV", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/skrooge_partial.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/skrooge_partial.csv"); \
SKGTESTERROR("imp1.setCodec", imp1.setCodec(""), true); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
@@ -96,7 +96,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_CSV", err);
//Date;Libell�;Libell� compl�mentaire;Montant;Sens;Num�ro de \
ch�que
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/coopanet.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/coopanet.csv"); QStringList \
map;
map << "date" << "comment" << "" << "amount" << "sign" << "number";
SKGTESTERROR("imp1.setCSVMapping", imp1.setCSVMapping(&map), true);
@@ -150,7 +150,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_BP_CSV", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/bankperfect.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsv/bankperfect.csv");
SKGTESTERROR("QIF.setDefaultAccount", imp1.setDefaultAccount(&account1), \
true); SKGTESTERROR("imp1.importFile", imp1.importFile(), true);
}
@@ -158,7 +158,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_BP_CSV", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/bankperfect2.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsv/bankperfect2.csv");
SKGTESTERROR("QIF.setDefaultAccount", imp1.setDefaultAccount(&account2), \
true); SKGTESTERROR("imp1.importFile", imp1.importFile(), true);
@@ -173,7 +173,7 @@ int main(int argc, char** argv)
SKGTESTERROR("ACCOUNT.load", account2.load(), true);
SKGTEST("ACCOUNT:getCurrentAmount", \
SKGServices::doubleToString(account2.getCurrentAmount()), "1500");
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportcsv/bankperfect.csv"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % \
"/skgtestimportcsv/bankperfect.csv");
SKGTESTERROR("SKGImportExportManager::CSV.exportFile", exp1.exportFile(), \
true);
{
@@ -214,13 +214,13 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_SKROOGE_CSV", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportcsv/bankperfect.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % "/skgtestimportcsv/bankperfect.csv"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true);
SKGTEST("imp1:getCSVMapping", \
SKGServices::stringsToCsv(imp1.getCSVMapping()), \
"\"date\";\"account\";\"number\";\"mode\";\"payee\";\"comment\";\"quantity\";\"unit\"; \
\"amount\";\"sign\";\"category\";\"status\";\"bookmarked\";\"\";\"idtransaction\";\"idgroup\"");
}
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportcsv/bankperfect2.csv"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % \
"/skgtestimportcsv/bankperfect2.csv");
SKGTESTERROR("SKGImportExportManager::CSV.exportFile", exp1.exportFile(), \
true); }
@@ -232,7 +232,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OPTIM", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/bankperfect.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/bankperfect.csv"); \
SKGTESTERROR("OPTIM.importFile", imp1.importFile(), true); }
@@ -247,14 +247,14 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/remi_1.txt"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/remi_1.txt"); \
SKGTESTERROR("OPTIM.importFile", imp1.importFile(), true); \
//document1.dump(DUMPOPERATION); }
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/remi_1.txt"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/remi_1.txt"); \
SKGTESTERROR("OPTIM.importFile", imp1.importFile(), true); \
//document1.dump(DUMPOPERATION); }
@@ -272,7 +272,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/XXXXXXMxxxXXXXXXX.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsv/XXXXXXMxxxXXXXXXX.csv");
SKGTEST("CSV.getCSVHeaderIndex", imp1.getCSVHeaderIndex(), 8);
SKGTESTERROR("CSV.importFile", imp1.importFile(), true);
//document1.dump(DUMPOPERATION);
@@ -291,7 +291,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/206894.csv"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/206894.csv"); SKGTESTERROR("CSV.importFile", \
imp1.importFile(), true); //document1.dump(DUMPOPERATION);
}
@@ -310,7 +310,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/mutual fund.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/mutual fund.csv"); \
SKGTESTERROR("CSV.importFile", imp1.importFile(), true); \
//document1.dump(DUMPOPERATION); }
@@ -330,13 +330,13 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/209705.csv"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/209705.csv"); SKGTESTERROR("CSV.importFile", \
imp1.importFile(), true); }
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/209705_2.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportcsv/209705_2.csv"); \
SKGTESTERROR("CSV.importFile", imp1.importFile(), true); \
//document1.dump(DUMPOPERATION); }
@@ -363,7 +363,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/compte.csv"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/compte.csv"); SKGTESTERROR("CSV.importFile", \
imp1.importFile(), true); }
@@ -382,7 +382,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/mmex.csv"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/mmex.csv"); SKGTESTERROR("CSV.importFile", \
imp1.importFile(), true); //document1.dump(DUMPOPERATION);
}
@@ -404,7 +404,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/mmex_no_header.csv"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsv/mmex_no_header.csv");
QStringList mapping = \
SKGServices::splitCSVLine("date|comment|sign|amount|category", '|', \
false);
SKGTESTERROR("CSV.setCSVMapping", imp1.setCSVMapping(&mapping), true);
SKGTESTERROR("CSV.setCSVHeaderIndex", imp1.setCSVHeaderIndex(0), true);
@@ -426,7 +426,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsv/263263.csv"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportcsv/263263.csv"); QMap<QString, QString> rule = \
imp1.getCSVMappingRules(); rule["debit"] = "kreditrente";
SKGTESTERROR("CSV.setCSVMapping", imp1.setCSVMappingRules(rule), true);
diff --git a/skgbankmodelertest/skgtestimportcsvunit.cpp \
b/skgbankmodelertest/skgtestimportcsvunit.cpp index 9e33c11..64e89a0 100644
--- a/skgbankmodelertest/skgtestimportcsvunit.cpp
+++ b/skgbankmodelertest/skgtestimportcsvunit.cpp
@@ -48,15 +48,15 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsvunit/notfound.csv", SKGImportExportManager::CSVUNIT); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsvunit/notfound.csv", \
SKGImportExportManager::CSVUNIT);
SKGTESTERROR("imp1.importFile", imp1.importFile(), false); //FILE \
NOT FOUND }
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsvunit/test.csv", SKGImportExportManager::CSVUNIT); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsvunit/test.csv", SKGImportExportManager::CSVUNIT); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportcsvunit/test2.csv", SKGImportExportManager::CSVUNIT); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportcsvunit/test2.csv", SKGImportExportManager::CSVUNIT); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
}
diff --git a/skgbankmodelertest/skgtestimportgnucash.cpp \
b/skgbankmodelertest/skgtestimportgnucash.cpp index 660cf50..285a27b 100644
--- a/skgbankmodelertest/skgtestimportgnucash.cpp
+++ b/skgbankmodelertest/skgtestimportgnucash.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/test_data.uncompressed"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/test_data.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -67,7 +67,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/all.uncompressed"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/all.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/initial_balance.uncompressed"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/initial_balance.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -138,7 +138,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/transfert-CPP-vers-PEE.uncompressed"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/transfert-CPP-vers-PEE.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -179,7 +179,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/transfert-PEE-vers-CCP.uncompressed"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/transfert-PEE-vers-CCP.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -223,7 +223,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/interet-revenue-frais.gnucash"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/interet-revenue-frais.gnucash"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -258,7 +258,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/rapprochement-incorrect.uncompressed"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/rapprochement-incorrect.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -279,7 +279,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/scheduled-action.uncompressed"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportgnucash/scheduled-action.uncompressed"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -311,7 +311,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/228808.gnc"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/228808.gnc"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -342,7 +342,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/228904.gnucash"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/228904.gnucash"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -363,7 +363,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/228901.gnucash"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/228901.gnucash"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
@@ -379,7 +379,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/228901.gnucash"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/228901.gnucash"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
}
@@ -393,7 +393,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/234608.gnc"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/234608.gnc"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
}
@@ -407,7 +407,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/234597.gnc"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/234597.gnc"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
{
@@ -426,7 +426,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GNUCASH", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgnucash/243738.gnucash"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgnucash/243738.gnucash"); \
SKGTESTERROR("GNUCASH.importFile", imp1.importFile(), true); }
}
diff --git a/skgbankmodelertest/skgtestimportgsb.cpp \
b/skgbankmodelertest/skgtestimportgsb.cpp index 2921baa..078dd0c 100644
--- a/skgbankmodelertest/skgtestimportgsb.cpp
+++ b/skgbankmodelertest/skgtestimportgsb.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GSB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgsb/test-obfuscated.gsb"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgsb/test-obfuscated.gsb"); \
SKGTESTERROR("GSB.importFile", imp1.importFile(), true); }
@@ -84,7 +84,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GSB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgsb/version_0.5.9.gsb"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportgsb/version_0.5.9.gsb"); \
SKGTESTERROR("GSB.importFile", imp1.importFile(), false); }
}
@@ -98,14 +98,14 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GSB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgsb/essai.gsb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportgsb/essai.gsb"); SKGTESTERROR("GSB.importFile", \
imp1.importFile(), true); }
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_GSB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportgsb/essai.gsb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportgsb/essai.gsb"); SKGTESTERROR("GSB.importFile", \
imp1.importFile(), true); }
}
diff --git a/skgbankmodelertest/skgtestimportkmy.cpp \
b/skgbankmodelertest/skgtestimportkmy.cpp index 1a171e2..940cf2c 100644
--- a/skgbankmodelertest/skgtestimportkmy.cpp
+++ b/skgbankmodelertest/skgtestimportkmy.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMY", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportkmy/rapprochement-incorrect.kmy"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportkmy/rapprochement-incorrect.kmy"); SKGTESTERROR("KMY.importFile", \
imp1.importFile(), true); }
@@ -72,7 +72,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportkmy/rapprochement-incorrect.kmy"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % \
"/skgtestimportkmy/rapprochement-incorrect.kmy"); SKGTESTERROR("KMY.exportFile", \
imp1.exportFile(), true); }
}
@@ -86,7 +86,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMY", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportkmy/mytest.kmy"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportkmy/mytest.kmy"); SKGTESTERROR("KMY.importFile", \
imp1.importFile(), true); }
@@ -104,7 +104,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMY", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportkmy/action.kmy"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportkmy/action.kmy"); SKGTESTERROR("KMY.importFile", \
imp1.importFile(), true); }
@@ -127,7 +127,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMY", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportkmy/action.kmy"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportkmy/action.kmy"); SKGTESTERROR("KMY.importFile", \
imp1.importFile(), true); }
}
@@ -141,7 +141,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMY", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportkmy/252869.kmy"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportkmy/252869.kmy"); SKGTESTERROR("KMY.importFile", \
imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestimportmmb.cpp \
b/skgbankmodelertest/skgtestimportmmb.cpp index f4b8d78..fdf8778 100644
--- a/skgbankmodelertest/skgtestimportmmb.cpp
+++ b/skgbankmodelertest/skgtestimportmmb.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MMB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmmb/test.mmb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportmmb/test.mmb"); SKGTESTERROR("MMB.importFile", \
imp1.importFile(), true); }
@@ -84,7 +84,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MMB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmmb/jd.mmb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportmmb/jd.mmb"); SKGTESTERROR("MMB.importFile", \
imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestimportmt940.cpp \
b/skgbankmodelertest/skgtestimportmt940.cpp index 3cb52ba..41c1a89 100644
--- a/skgbankmodelertest/skgtestimportmt940.cpp
+++ b/skgbankmodelertest/skgtestimportmt940.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MT940", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmt940/test1.mt940"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportmt940/test1.mt940"); \
SKGTESTERROR("MT940.importFile", imp1.importFile(), true); }
@@ -66,7 +66,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MT940", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmt940/583501.mt940"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportmt940/583501.mt940"); \
SKGTESTERROR("MT940.importFile", imp1.importFile(), true); }
@@ -87,7 +87,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MT940", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmt940/341076.mt940"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportmt940/341076.mt940"); \
SKGTESTERROR("MT940.importFile", imp1.importFile(), true); }
@@ -108,7 +108,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MT940", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmt940/267442_1.mt940"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportmt940/267442_1.mt940"); \
SKGTESTERROR("MT940.importFile", imp1.importFile(), true); }
@@ -129,7 +129,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_MT940", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportmt940/267442_2.mt940"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportmt940/267442_2.mt940"); \
SKGTESTERROR("MT940.importFile", imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestimportofx.cpp \
b/skgbankmodelertest/skgtestimportofx.cpp index 1dd6e5b..49fa369 100644
--- a/skgbankmodelertest/skgtestimportofx.cpp
+++ b/skgbankmodelertest/skgtestimportofx.cpp
@@ -47,7 +47,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/ofx_spec160_stmtrs_example.ofx"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportofx/ofx_spec160_stmtrs_example.ofx"); SKGTESTERROR("imp1.importFile", \
imp1.importFile(), true); //document1.dump ( DUMPOPERATION|DUMPACCOUNT );
}
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
{
//To check double import
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/ofx_spec160_stmtrs_example.ofx"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportofx/ofx_spec160_stmtrs_example.ofx"); SKGTESTERROR("imp1.importFile", \
imp1.importFile(), true); }
SKGAccountObject account;
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/ofx_spec201_stmtrs_example.ofx"); + \
SKGImportExportManager imp1(&document1, getTestPath("IN") % \
"/skgtestimportofx/ofx_spec201_stmtrs_example.ofx"); SKGTESTERROR("imp1.importFile", \
imp1.importFile(), true); //document1.dump ( DUMPOPERATION|DUMPACCOUNT );
}
@@ -93,7 +93,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/t1.ofx"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportofx/t1.ofx"); SKGTESTERROR("imp1.importFile", \
imp1.importFile(), true); //document1.dump ( DUMPOPERATION|DUMPACCOUNT );
}
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/385366.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/385366.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -133,7 +133,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/430130.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/430130.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -153,7 +153,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/ca_remi.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/ca_remi.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -177,7 +177,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/initial_balance.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/initial_balance.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -202,7 +202,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/bug_statement.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/bug_statement.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -232,7 +232,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/234771.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/234771.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); //document1.dump ( \
DUMPOPERATION|DUMPACCOUNT ); }
@@ -247,7 +247,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/UTF8.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/UTF8.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
}
@@ -261,7 +261,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/exception.ofx"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportofx/exception.ofx"); \
SKGTESTERROR("imp1.importFile", imp1.importFile(), true); }
}
diff --git a/skgbankmodelertest/skgtestimportqif.cpp \
b/skgbankmodelertest/skgtestimportqif.cpp index 1aeffee..8aa5be4 100644
--- a/skgbankmodelertest/skgtestimportqif.cpp
+++ b/skgbankmodelertest/skgtestimportqif.cpp
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_BP_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/ref.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/ref.qif");
SKGTESTERROR("QIF.setDefaultAccount", imp1.setDefaultAccount(&account), \
true);
SKGTESTERROR("QIF.setDefaultUnit", imp1.setDefaultUnit(&unit_euro), \
true); SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
@@ -95,7 +95,7 @@ int main(int argc, char** argv)
int out = 0;
SKGTESTERROR("QIF.findAndGroupTransfers", \
imp1.findAndGroupTransfers(out), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/ref.qif"); + SKGImportExportManager exp1(&document1, \
getTestPath("OUT") % "/skgtestimportqif/ref.qif"); SKGTESTERROR("QIF.exportFile", \
exp1.exportFile(), true); }
@@ -141,7 +141,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_BP_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/E0269787.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % \
"/skgtestimportqif/E0269787.qif");
SKGTESTERROR("QIF.setDefaultAccount", imp1.setDefaultAccount(&account), \
true);
SKGTESTERROR("QIF.setDefaultUnit", imp1.setDefaultUnit(&unit_euro), \
true); SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
@@ -150,7 +150,7 @@ int main(int argc, char** argv)
SKGTESTERROR("QIF.findAndGroupTransfers", \
imp1.findAndGroupTransfers(out), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787.qif"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787.qif"); \
SKGTESTERROR("QIF.exportFile", exp1.exportFile(), true); }
@@ -173,20 +173,20 @@ int main(int argc, char** argv)
SKGTESTERROR("UNITVALUE:setDate", unit_euro_val1.setDate(d), true);
SKGTESTERROR("UNITVALUE:save", unit_euro_val1.save(), true);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
SKGTESTERROR("QIF.cleanBankImport", imp1.cleanBankImport(), true);
int out = 0;
SKGTESTERROR("QIF.findAndGroupTransfers", \
imp1.findAndGroupTransfers(out), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787_bis.qif"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787_bis.qif"); \
SKGTESTERROR("QIF.exportFile", exp1.exportFile(), true); }
//Check multi import
SKGTESTERROR("document1.initialize()", document1.initialize(), true);
{
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/ref.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("OUT") % "/skgtestimportqif/ref.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true);
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); //Double \
import
SKGTESTERROR("QIF.cleanBankImport", imp1.cleanBankImport(), true);
@@ -197,22 +197,22 @@ int main(int argc, char** argv)
//Check import with account retrieved from files
SKGTESTERROR("document1.initialize()", document1.initialize(), true);
{
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/ref.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("OUT") % "/skgtestimportqif/ref.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true);
- SKGImportExportManager imp2(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787.qif"); + SKGImportExportManager \
imp2(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787.qif"); \
SKGTESTERROR("QIF.importFile", imp2.importFile(), true);
SKGTESTERROR("QIF.cleanBankImport", imp1.cleanBankImport(), true);
int out = 0;
SKGTESTERROR("QIF.findAndGroupTransfers", \
imp1.findAndGroupTransfers(out), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787_ref.qif"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787_ref.qif"); \
SKGTESTERROR("QIF.exportFile", exp1.exportFile(), true); }
//Check import qif multi accounts
SKGTESTERROR("document1.initialize()", document1.initialize(), true);
{
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/E0269787_ref.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % "/skgtestimportqif/E0269787_ref.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
SKGTESTERROR("QIF.cleanBankImport", imp1.cleanBankImport(), true);
int out = 0;
@@ -262,7 +262,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_ING_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/ing.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/ing.qif");
SKGTESTERROR("QIF.setDefaultAccount", imp1.setDefaultAccount(&account), \
true);
SKGTESTERROR("QIF.setDefaultUnit", imp1.setDefaultUnit(&unit_euro), \
true); SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
@@ -271,7 +271,7 @@ int main(int argc, char** argv)
SKGTESTERROR("QIF.findAndGroupTransfers", \
imp1.findAndGroupTransfers(out), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/ing.qif"); + SKGImportExportManager exp1(&document1, \
getTestPath("OUT") % "/skgtestimportqif/ing.qif"); SKGTESTERROR("QIF.exportFile", \
exp1.exportFile(), true); }
}
@@ -285,7 +285,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_ING_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/moto.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/moto.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -316,7 +316,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_ING_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/moto.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/moto.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -337,7 +337,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMM_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/kmm-without-category.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/kmm-without-category.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
@@ -358,7 +358,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_KMM_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/kmm-with-category.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/kmm-with-category.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
@@ -379,14 +379,14 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_REMI_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/remi_2.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/remi_2.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_REMI_QIF", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/remi_2.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/remi_2.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
{
@@ -406,7 +406,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_DOUBLE", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/double.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/double.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
{
@@ -426,7 +426,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/350286.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/350286.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -447,7 +447,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/393596.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/393596.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -468,7 +468,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/503166.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/503166.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -489,7 +489,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/392707.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/392707.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -510,7 +510,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/373584.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/373584.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -531,7 +531,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/199818.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/199818.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -552,7 +552,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/201316.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/201316.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -578,7 +578,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/201451.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/201451.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
@@ -599,7 +599,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/BNP_CC_virement.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/BNP_CC_virement.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
@@ -626,10 +626,10 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/Fortuneo PEA (Caisse).qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/Fortuneo PEA (Caisse).qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
- SKGImportExportManager imp2(&document1, getTestPath("IN") + \
"/skgtestimportqif/Fortuneo PEA.qif"); + SKGImportExportManager \
imp2(&document1, getTestPath("IN") % "/skgtestimportqif/Fortuneo PEA.qif"); \
SKGTESTERROR("QIF.importFile", imp2.importFile(), true); }
@@ -668,10 +668,10 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/Cortal PEA.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/Cortal PEA.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
- SKGImportExportManager imp2(&document1, getTestPath("IN") + \
"/skgtestimportqif/EADS.qif"); + SKGImportExportManager imp2(&document1, \
getTestPath("IN") % "/skgtestimportqif/EADS.qif"); SKGTESTERROR("QIF.importFile", \
imp2.importFile(), true); }
}
@@ -685,7 +685,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/216520.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/216520.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true); }
{
@@ -712,11 +712,11 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/exp_inv.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/exp_inv.qif"); \
SKGTESTERROR("QIF.setCodec", imp1.setCodec("UTF-8"), true); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/exp_inv.qif"); + SKGImportExportManager \
exp1(&document1, getTestPath("OUT") % "/skgtestimportqif/exp_inv.qif"); \
SKGTESTERROR("QIF.setCodec", exp1.setCodec("UTF-8"), true); \
SKGTESTERROR("QIF.exportFile", exp1.exportFile(), true);
@@ -733,7 +733,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/t2.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/t2.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true);
}
@@ -760,7 +760,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/233930.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/233930.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true);
}
@@ -775,7 +775,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/quicken.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/quicken.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
}
@@ -790,12 +790,12 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/267996.qif"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportqif/267996.qif"); SKGTESTERROR("QIF.importFile", \
imp1.importFile(), true);
}
{
- SKGImportExportManager exp1(&document1, getTestPath("OUT") + \
"/skgtestimportqif/267996.csv"); + SKGImportExportManager exp1(&document1, \
getTestPath("OUT") % "/skgtestimportqif/267996.csv"); SKGTESTERROR("QIF.exportFile", \
exp1.exportFile(), true); }
}
@@ -810,19 +810,19 @@ int main(int argc, char** argv)
SKGBEGINTRANSACTION(document1, "IMPORT", err);
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/271708/10-Compte A.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/271708/10-Compte A.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/271708/20-Compte B.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/271708/20-Compte B.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/271708/30-Compte C.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/271708/30-Compte C.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
{
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportqif/271708/40-Compte D.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportqif/271708/40-Compte D.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestimportskg.cpp \
b/skgbankmodelertest/skgtestimportskg.cpp index 5d2d2f9..a95639b 100644
--- a/skgbankmodelertest/skgtestimportskg.cpp
+++ b/skgbankmodelertest/skgtestimportskg.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_SKG", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportskg/all_types.skg"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportskg/all_types.skg"); \
SKGTESTERROR("SKG.importFile", imp1.importFile(), true); }
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_SKG", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportskg/all_types.skg"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportskg/all_types.skg"); \
SKGTESTERROR("SKG.importFile", imp1.importFile(), true); }
@@ -82,7 +82,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "EXPORT_XML", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportskg/all_types.xml"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % "/skgtestimportskg/all_types.xml"); \
SKGTESTERROR("SKG.exportFile", imp1.exportFile(), true); }
@@ -91,16 +91,16 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "EXPORT_SKG", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportskg/all_types_exp_from_mem.skg"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % \
"/skgtestimportskg/all_types_exp_from_mem.skg"); SKGTESTERROR("SKG.exportFile", \
imp1.exportFile(), true); }
- SKGTESTERROR("SKG.saveAs", document1.saveAs(getTestPath("OUT") + \
"/skgtestimportskg/all_types_save.skg", true), true);
- SKGTESTERROR("SKG.load", document1.load(getTestPath("OUT") + \
"/skgtestimportskg/all_types_save.skg"), true); + SKGTESTERROR("SKG.saveAs", \
document1.saveAs(getTestPath("OUT") % "/skgtestimportskg/all_types_save.skg", true), \
true); + SKGTESTERROR("SKG.load", document1.load(getTestPath("OUT") % \
"/skgtestimportskg/all_types_save.skg"), true); {
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "EXPORT_SKG", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportskg/all_types_exp_from_file.skg"); + SKGImportExportManager \
imp1(&document1, getTestPath("OUT") % \
"/skgtestimportskg/all_types_exp_from_file.skg"); SKGTESTERROR("SKG.exportFile", \
imp1.exportFile(), true); }
@@ -108,14 +108,14 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "EXPORT_SQLITE", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportskg/all_types_exp_from_file.sqlite"); + \
SKGImportExportManager imp1(&document1, getTestPath("OUT") % \
"/skgtestimportskg/all_types_exp_from_file.sqlite"); SKGTESTERROR("SKG.exportFile", \
imp1.exportFile(), true); }
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "EXPORT_SKG", err);
- SKGImportExportManager imp1(&document1, getTestPath("OUT") + \
"/skgtestimportskg/all_types_exp_from_file.sqlite"); + \
SKGImportExportManager imp1(&document1, getTestPath("OUT") % \
"/skgtestimportskg/all_types_exp_from_file.sqlite"); SKGTESTERROR("SKG.exportFile", \
imp1.importFile(), true); }
}
diff --git a/skgbankmodelertest/skgtestimportstockqif.cpp \
b/skgbankmodelertest/skgtestimportstockqif.cpp index f20705b..0a85860 100644
--- a/skgbankmodelertest/skgtestimportstockqif.cpp
+++ b/skgbankmodelertest/skgtestimportstockqif.cpp
@@ -54,11 +54,11 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_STOCK_1", err);
SKGUnitObject unit;
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportstockqif/La Poste GMO.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportstockqif/La Poste GMO.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
- SKGImportExportManager imp2(&document1, getTestPath("IN") + \
"/skgtestimportstockqif/La Poste GMO (Caisse).qif"); + \
SKGImportExportManager imp2(&document1, getTestPath("IN") % \
"/skgtestimportstockqif/La Poste GMO (Caisse).qif"); SKGTESTERROR("QIF.importFile", \
imp2.importFile(), true);
- SKGImportExportManager imp3(&document1, getTestPath("IN") + \
"/skgtestimportstockqif/goog.qif"); + SKGImportExportManager \
imp3(&document1, getTestPath("IN") % "/skgtestimportstockqif/goog.qif"); \
SKGTESTERROR("QIF.importFile", imp3.importFile(), true); }
document1.dump(DUMPOPERATION | DUMPUNIT | DUMPACCOUNT);
@@ -73,10 +73,10 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_2307068", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportstockqif/2307068-BNP CC.qif"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportstockqif/2307068-BNP CC.qif"); \
SKGTESTERROR("QIF.importFile", imp1.importFile(), true);
- SKGImportExportManager imp12(&document1, getTestPath("IN") + \
"/skgtestimportstockqif/2307068-Compte Titre.qif"); + \
SKGImportExportManager imp12(&document1, getTestPath("IN") % \
"/skgtestimportstockqif/2307068-Compte Titre.qif"); SKGTESTERROR("QIF.importFile", \
imp12.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestimportxhb.cpp \
b/skgbankmodelertest/skgtestimportxhb.cpp index 4d8590a..fe1bff0 100644
--- a/skgbankmodelertest/skgtestimportxhb.cpp
+++ b/skgbankmodelertest/skgtestimportxhb.cpp
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_XHB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportxhb/test.xhb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportxhb/test.xhb"); SKGTESTERROR("XHB.importFile", \
imp1.importFile(), true); }
@@ -61,7 +61,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_XHB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportxhb/test.xhb"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportxhb/test.xhb"); SKGTESTERROR("XHB.importFile", \
imp1.importFile(), true); }
}
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_XHB", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportxhb/example_budget.xhb"); + SKGImportExportManager \
imp1(&document1, getTestPath("IN") % "/skgtestimportxhb/example_budget.xhb"); \
SKGTESTERROR("XHB.importFile", imp1.importFile(), true); }
diff --git a/skgbankmodelertest/skgtestmigration.cpp \
b/skgbankmodelertest/skgtestmigration.cpp index c2df1d0..6909cd6 100644
--- a/skgbankmodelertest/skgtestmigration.cpp
+++ b/skgbankmodelertest/skgtestmigration.cpp
@@ -40,11 +40,11 @@ int main(int argc, char** argv)
//Test load old version of files
{
SKGDocumentBank document1;
- SKGTESTERROR("DOC:load", document1.load(getTestPath("IN") + \
"/skgtestmigration/version_0.1.skg"), true); + SKGTESTERROR("DOC:load", \
document1.load(getTestPath("IN") % "/skgtestmigration/version_0.1.skg"), true); }
{
SKGDocumentBank document1;
- SKGTESTERROR("DOC:load", document1.load(getTestPath("IN") + \
"/skgtestmigration/version_0.3.skg"), true); + SKGTESTERROR("DOC:load", \
document1.load(getTestPath("IN") % "/skgtestmigration/version_0.3.skg"), true); }
}
diff --git a/skgbankmodelertest/skgtestoperation.cpp \
b/skgbankmodelertest/skgtestoperation.cpp index c0d265f..63ac6b2 100644
--- a/skgbankmodelertest/skgtestoperation.cpp
+++ b/skgbankmodelertest/skgtestoperation.cpp
@@ -36,7 +36,7 @@ int main(int argc, char** argv)
//Init test
SKGINITTEST(true);
- QString filename = getTestPath("OUT") + "/skgtestoperation.skg";
+ QString filename = getTestPath("OUT") % "/skgtestoperation.skg";
QDate now = QDate::currentDate();
//============================================================================
{
diff --git a/skgbankmodelertest/skgtestrule.cpp b/skgbankmodelertest/skgtestrule.cpp
index e2ac421..1545e9b 100644
--- a/skgbankmodelertest/skgtestrule.cpp
+++ b/skgbankmodelertest/skgtestrule.cpp
@@ -47,7 +47,7 @@ int main(int argc, char** argv)
{
//Scope of the transaction
SKGBEGINTRANSACTION(document1, "IMPORT_OFX", err);
- SKGImportExportManager imp1(&document1, getTestPath("IN") + \
"/skgtestimportofx/385366.ofx"); + SKGImportExportManager imp1(&document1, \
getTestPath("IN") % "/skgtestimportofx/385366.ofx"); SKGTESTERROR("imp1.importFile", \
imp1.importFile(), true); document1.dump(DUMPOPERATION | DUMPACCOUNT);
}
@@ -180,7 +180,7 @@ int main(int argc, char** argv)
{
//Test import OFX skrooge
SKGDocumentBank document1;
- SKGTESTERROR("document1.load()", document1.load(getTestPath("IN") + \
"skgtestrule/file.skg"), true); + SKGTESTERROR("document1.load()", \
document1.load(getTestPath("IN") % "skgtestrule/file.skg"), true);
//Process rules
SKGError err;
diff --git a/skgbasegui/skgcalculatoredit.cpp b/skgbasegui/skgcalculatoredit.cpp
index 06f104b..2a7c5e9 100644
--- a/skgbasegui/skgcalculatoredit.cpp
+++ b/skgbasegui/skgcalculatoredit.cpp
@@ -101,7 +101,7 @@ void SKGCalculatorEdit::addParameterValue(const QString& \
iParameter, double iVal
//Refresh completion
KCompletion *comp = this->completionObject();
- if(comp) comp->addItem('=' + iParameter);
+ if(comp) comp->addItem('=' % iParameter);
}
void SKGCalculatorEdit::keyPressEvent(QKeyEvent * event)
diff --git a/skgbasegui/skgmainpanel.cpp b/skgbasegui/skgmainpanel.cpp
index 90ecbb6..c020a8f 100644
--- a/skgbasegui/skgmainpanel.cpp
+++ b/skgbasegui/skgmainpanel.cpp
@@ -300,7 +300,7 @@ SKGMainPanel::SKGMainPanel(KSplashScreen* iSplashScreen, \
SKGDocument* iDocument,
if(shortCutPrefix == "Ctrl+") shortCutPrefix += \
"Alt+"; else shortCutPrefix = "";
}
- if(!shortCutPrefix.isEmpty()) \
action->setShortcut(QString(shortCutPrefix + \
SKGServices::intToString(shortCutIndex))); + \
if(!shortCutPrefix.isEmpty()) action->setShortcut(QString(shortCutPrefix % \
SKGServices::intToString(shortCutIndex))); }
connect(action, SIGNAL(triggered(Qt::MouseButtons, \
Qt::KeyboardModifiers)), this, SLOT(onOpenContext(Qt::MouseButtons, \
Qt::KeyboardModifiers)));
@@ -1464,7 +1464,7 @@ void SKGMainPanel::notify(int iTransaction)
if(nbMessages < 20) {
//Display a simple notification
- KNotification *notify = new KNotification(KCmdLineArgs::appName() + \
"_info_event" , this); + KNotification *notify = new \
KNotification(KCmdLineArgs::appName() % "_info_event" , this); \
notify->setText(message); notify->sendEvent();
} else {
@@ -1608,11 +1608,11 @@ void SKGMainPanel::fillWithDistinctValue(
//Add operator
if(iAddoperators) {
- list.push_back('=' + i18nc("Key word to modify a string into a field", \
"capitalize"));
- list.push_back('=' + i18nc("Key word to modify a string into a field", \
"capwords"));
- list.push_back('=' + i18nc("Key word to modify a string into a field", \
"lower"));
- list.push_back('=' + i18nc("Key word to modify a string into a field", \
"trim"));
- list.push_back('=' + i18nc("Key word to modify a string into a field", \
"upper")); + list.push_back('=' % i18nc("Key word to modify a string into \
a field", "capitalize")); + list.push_back('=' % i18nc("Key word to modify \
a string into a field", "capwords")); + list.push_back('=' % i18nc("Key \
word to modify a string into a field", "lower")); + list.push_back('=' % \
i18nc("Key word to modify a string into a field", "trim")); + \
list.push_back('=' % i18nc("Key word to modify a string into a field", "upper")); }
if(comp) {
diff --git a/skgbasegui/skgobjectmodelbase.cpp b/skgbasegui/skgobjectmodelbase.cpp
index b142b43..1dcafcb 100644
--- a/skgbasegui/skgobjectmodelbase.cpp
+++ b/skgbasegui/skgobjectmodelbase.cpp
@@ -365,7 +365,7 @@ QVariant SKGObjectModelBase::headerData(int section, \
Qt::Orientation orientation
if(section >= 0 && section < m_listAttibutes.count()) att = \
m_listAttibutes[section]; else att = SKGServices::intToString(section);
- return getDocument()->getDisplay(getTable() + '.' + att);
+ return getDocument()->getDisplay(getTable() % '.' % att);
} else if(role == Qt::UserRole) {
QString att;
if(section >= 0 && section < m_listAttibutes.count()) att = \
m_listAttibutes.at(section); @@ -373,13 +373,13 @@ QVariant \
SKGObjectModelBase::headerData(int section, Qt::Orientation orientation
int indexAtt = m_listSupported.indexOf(att);
- att = getDocument()->getDisplay(getTable() + '.' + att);
+ att = getDocument()->getDisplay(getTable() % '.' % att);
if(indexAtt >= 0 && indexAtt < m_listVisibility.count()) {
bool visible = m_listVisibility.at(indexAtt);
- att += QString("|") + (visible ? "Y" : "N");
- if(indexAtt >= 0 && indexAtt < m_listSize.count()) att += '|' + \
SKGServices::intToString(m_listSize.at(indexAtt)); + att += \
QString("|") % (visible ? "Y" : "N"); + if(indexAtt >= 0 && indexAtt < \
m_listSize.count()) att += '|' % SKGServices::intToString(m_listSize.at(indexAtt)); \
} return att;
} else if(role == Qt::DecorationRole) {
@@ -387,7 +387,7 @@ QVariant SKGObjectModelBase::headerData(int section, \
Qt::Orientation orientation
if(section >= 0 && section < m_listAttibutes.count()) att = \
m_listAttibutes[section]; else att = SKGServices::intToString(section);
- return getDocument()->getIcon(getTable() + '.' + att);
+ return getDocument()->getIcon(getTable() % '.' % att);
}
}
return QVariant();
@@ -546,7 +546,7 @@ QVariant SKGObjectModelBase::data(const QModelIndex &index, int \
role) const
//Add UUID
IFSKGTRACEL(1) {
- toolTipString += '\n' + obj->getUniqueID();
+ toolTipString += '\n' % obj->getUniqueID();
}
}
return toolTipString;
@@ -623,7 +623,7 @@ Qt::DropActions SKGObjectModelBase::supportedDropActions() const
QStringList SKGObjectModelBase::mimeTypes() const
{
QStringList types;
- types << "application/skg." + getRealTable() + ".ids";
+ types << "application/skg." % getRealTable() % ".ids";
types << "application/data";
types << "text/uri-list";
return types;
@@ -646,7 +646,7 @@ QMimeData* SKGObjectModelBase::mimeData(const QModelIndexList \
&indexes) const }
}
- mimeData->setData("application/skg." + t + ".ids", encodedData);
+ mimeData->setData("application/skg." % t % ".ids", encodedData);
return mimeData;
}
@@ -674,7 +674,7 @@ bool SKGObjectModelBase::dropMimeData(const QMimeData *data,
int index = 1;
while(err.isSucceeded() && !obj.getProperty(name).isEmpty()) {
index++;
- name = i18n("File") + " (" + SKGServices::intToString(index) + \
')'; + name = i18n("File") % " (" % \
SKGServices::intToString(index) % ')'; }
err = obj.setProperty(name, urls.at(i).toLocalFile(), \
urls.at(i).toLocalFile());
if(err.isSucceeded()) err = getDocument()->stepForward(i + 1);
diff --git a/skgbasegui/skgshow.cpp b/skgbasegui/skgshow.cpp
index bf61b07..fd7a1bd 100644
--- a/skgbasegui/skgshow.cpp
+++ b/skgbasegui/skgshow.cpp
@@ -75,7 +75,7 @@ QString SKGShow::getWhereClause()
QAction* act = actions.at(i);
if(act && act->isChecked()) {
if(!wc.isEmpty()) wc += " OR ";
- wc += '(' + m_whereclause[act] + ')';
+ wc += '(' % m_whereclause[act] % ')';
noCheck = false;
if(m_whereclause[act].isEmpty()) {
diff --git a/skgbasegui/skgtablewithgraph.cpp b/skgbasegui/skgtablewithgraph.cpp
index 074a902..66331e0 100644
--- a/skgbasegui/skgtablewithgraph.cpp
+++ b/skgbasegui/skgtablewithgraph.cpp
@@ -780,7 +780,7 @@ void SKGTableWithGraph::refresh()
double a = (s2x ? sxy / s2x : 0.0);
double b = sumy / nbVals - a * sumx / nbVals;
- newLine.push_back("y=" + SKGServices::doubleToString(a) + "*x+" + \
SKGServices::doubleToString(b)); + newLine.push_back("y=" % \
SKGServices::doubleToString(a) % "*x+" % SKGServices::doubleToString(b)); } else \
newLine.push_back("y=0");
groupedTable.replace(i, newLine);
@@ -879,7 +879,7 @@ void SKGTableWithGraph::refresh()
}
} else {
//Add a value
- QString tooltip = line.at(0) + '\n' + \
groupedTable.at(0).at(j); + QString tooltip = line.at(0) % \
'\n' % groupedTable.at(0).at(j); if(!val.isEmpty()) {
if(j == m_indexLinearRegression) {
//A linear regression value
@@ -888,12 +888,12 @@ void SKGTableWithGraph::refresh()
//A single value
double vald = SKGServices::stringToDouble(val);
QString vals = locale->formatMoney(vald, \
m_primaryUnit.Symbol, m_primaryUnit.NbDecimal);
- tooltip += '\n' + vals;
+ tooltip += '\n' % vals;
item = new QTableWidgetItem(vals);
item->setToolTip(tooltip);
if(!m_secondaryUnit.Symbol.isEmpty() && \
m_secondaryUnit.Value) {
- item->setToolTip(tooltip + '\n' + \
locale->formatMoney(vald / m_secondaryUnit.Value, m_secondaryUnit.Symbol, \
m_secondaryUnit.NbDecimal)); + \
item->setToolTip(tooltip % '\n' % locale->formatMoney(vald / m_secondaryUnit.Value, \
m_secondaryUnit.Symbol, m_secondaryUnit.NbDecimal)); }
item->setData(DATA_VALUE, vald);
@@ -1078,7 +1078,7 @@ void SKGTableWithGraph::redrawText()
"<head>"
"<meta http-equiv=\"content-type\" \
content=\"text/html;charset=utf-8\" />"
"<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />"
- "<style type=\"text/css\">" + style + "</style>"
+ "<style type=\"text/css\">" % style % "</style>"
"</head>"
"<body>"
"<table class=\"table\"><tr class=\"tabletitle\">";
@@ -1086,22 +1086,22 @@ void SKGTableWithGraph::redrawText()
int nbCols = ui.kTable->columnCount();
for(int i = 0; i < nbCols; ++i) {
QTableWidgetItem* item = ui.kTable->horizontalHeaderItem(i);
- if(item) html += "<td align=\"center\"><b>" + item->text() + "</b></td>";
+ if(item) html += "<td align=\"center\"><b>" % item->text() % "</b></td>";
}
html += "</tr>";
//Dump values
int nbLines = ui.kTable->rowCount();
for(int j = 0; j < nbLines; ++j) {
- html += QString("<tr") + (m_sumRows[j+1] ? " class=\"tabletotal\"" : "") + \
'>'; + html += QString("<tr") % (m_sumRows[j+1] ? " class=\"tabletotal\"" : \
"") % '>'; for(int i = 0; i < nbCols; ++i) {
QTableWidgetItem* item = ui.kTable->item(j, i);
if(item) {
bool red = (item->data(DATA_VALUE).toDouble() < 0);
- html += QString("<td align=\"right\">") + (red ? "<font \
color=\"red\">" : "") + item->text() + (red ? "</font>" : "") + "</td>"; + \
html += QString("<td align=\"right\">") % (red ? "<font color=\"red\">" : "") % \
item->text() % (red ? "</font>" : "") % "</td>"; } else {
SKGColorButton* item = \
qobject_cast<SKGColorButton*>(ui.kTable->cellWidget(j, i));
- if(item) html += "<td>" + item->text() + "</td>";
+ if(item) html += "<td>" % item->text() % "</td>";
}
}
html += "</tr>";
@@ -1874,14 +1874,14 @@ void SKGTableWithGraph::redrawGraph()
f0 = f0.remove("y=");
f0 = f0.replace('x', '1');
f0 = f0.replace(',', '.'); // Replace comma by a point in case of \
typo
- if(inPositive) f0 = "Math.abs(" + f0 + ')';
+ if(inPositive) f0 = "Math.abs(" % f0 % ')';
double y0 = myEngine.evaluate(f0).toNumber();
QString f1 = f;
f1 = f1.remove("y=");
f1 = f1.replace('x', SKGServices::intToString(nbRealColumns - 1));
f1 = f1.replace(',', '.'); // Replace comma by a point in case of \
typo
- if(inPositive) f1 = "Math.abs(" + f1 + ')';
+ if(inPositive) f1 = "Math.abs(" % f1 % ')';
double y1 = myEngine.evaluate(f1).toNumber();
QGraphicsLineItem* item = m_scene->addLine(x0, -y0, x1, -y1);
diff --git a/skgbasegui/skgtreeview.cpp b/skgbasegui/skgtreeview.cpp
index 2459a16..646c426 100644
--- a/skgbasegui/skgtreeview.cpp
+++ b/skgbasegui/skgtreeview.cpp
@@ -200,9 +200,9 @@ void SKGTreeView::setState(const QString& iState)
int nbsizes = sizes.count();
for(int i = 0; i < nb; ++i) {
if(nbvisibilities == nb) {
- listAtt[i] = listAtt[i] + '|' + visibilities[i];
+ listAtt[i] = listAtt[i] % '|' % visibilities[i];
if(nbsizes == nb) {
- listAtt[i] = listAtt[i] + '|' + sizes[i];
+ listAtt[i] = listAtt[i] % '|' % sizes[i];
}
}
diff --git a/skgbasegui/skguniqueapplication.cpp \
b/skgbasegui/skguniqueapplication.cpp index 93008dc..36b69cf 100644
--- a/skgbasegui/skguniqueapplication.cpp
+++ b/skgbasegui/skguniqueapplication.cpp
@@ -71,7 +71,7 @@ int SKGUniqueApplication::newInstance()
//Creation splash screen
KConfigGroup pref = SKGMainPanel::getMainConfigGroup();
if(pref.readEntry("show_splash_screen", true)) {
- QString splashPathRelativePath = KCmdLineArgs::appName() + \
"/images/splash.png"; + QString splashPathRelativePath = \
KCmdLineArgs::appName() % "/images/splash.png";
QString splashPath = KStandardDirs::locate("data", \
splashPathRelativePath.toLatin1()); if(!splashPath.isEmpty()) {
QPixmap pix(splashPath);
diff --git a/skgbasemodeler/skgdefine.h b/skgbasemodeler/skgdefine.h
index 4b1a5ee..56f3ca7 100644
--- a/skgbasemodeler/skgdefine.h
+++ b/skgbasemodeler/skgdefine.h
@@ -151,11 +151,11 @@ static const QString NOUPDATE = "-------";
* Define a standard trigger for cascaded delete
*/
#define DELETECASCADE(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
- << QString()+"DROP TRIGGER IF EXISTS \
fkdc_"+TABLEPARENT+"_"+TABLECHILD+"_"+ATTPARENT+"_"+ATTCHILD \
- << QString()+"CREATE TRIGGER \
fkdc_"+TABLEPARENT+"_"+TABLECHILD+"_"+ATTPARENT+"_"+ATTCHILD+" "\
- "BEFORE DELETE ON "+TABLEPARENT+" "\
+ << QString()%"DROP TRIGGER IF EXISTS \
fkdc_"%TABLEPARENT%"_"%TABLECHILD%"_"%ATTPARENT%"_"%ATTCHILD \ + << \
QString()%"CREATE TRIGGER \
fkdc_"%TABLEPARENT%"_"%TABLECHILD%"_"%ATTPARENT%"_"%ATTCHILD%" "\ + \
"BEFORE DELETE ON "%TABLEPARENT%" "\ "FOR EACH ROW BEGIN "\
- " DELETE FROM "+TABLECHILD+" WHERE "+TABLECHILD+"."+ATTCHILD+" = \
OLD."+ATTPARENT+"; "\ + " DELETE FROM "%TABLECHILD%" WHERE \
"%TABLECHILD%"."%ATTCHILD%" = OLD."%ATTPARENT%"; "\ "END"
/**
@@ -166,19 +166,19 @@ static const QString NOUPDATE = "-------";
// Should these strings be translated ??? They look far too SQLish for that purpose
#define INSERTUPDATECONSTRAINT(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
- << QString()+"DROP TRIGGER IF EXISTS \
fki_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT \
- << QString()+"CREATE TRIGGER \
fki_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT+" "\
- "BEFORE INSERT ON "+TABLECHILD+" "\
+ << QString()%"DROP TRIGGER IF EXISTS \
fki_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT \ + << \
QString()%"CREATE TRIGGER \
fki_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT%" "\ + "BEFORE \
INSERT ON "%TABLECHILD%" "\ "FOR EACH ROW BEGIN "\
- " SELECT RAISE(ABORT, '"+SKGServices::stringToSqlString(i18nc("Error \
message", "Impossible to insert object (%1 is used by %2).\nConstraint name: \
%3",TABLEPARENT, TABLECHILD, \
"fki_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT))+"') "\
- " WHERE NEW."+ATTCHILD+"!=0 AND NEW."+ATTCHILD+"!='' AND (SELECT \
"+ATTPARENT+" FROM "+TABLEPARENT+" WHERE "+ATTPARENT+" = NEW."+ATTCHILD+") IS NULL; \
"\ + " SELECT RAISE(ABORT, '"%SKGServices::stringToSqlString(i18nc("Error \
message", "Impossible to insert object (%1 is used by %2).\nConstraint name: \
%3",TABLEPARENT, TABLECHILD, \
"fki_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT))%"') "\ + " \
WHERE NEW."%ATTCHILD%"!=0 AND NEW."%ATTCHILD%"!='' AND (SELECT "%ATTPARENT%" FROM \
"%TABLEPARENT%" WHERE "%ATTPARENT%" = NEW."%ATTCHILD%") IS NULL; "\ "END"\
- << QString()+"DROP TRIGGER IF EXISTS \
fku_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT \
- << QString()+"CREATE TRIGGER \
fku_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT+" "\
- "BEFORE UPDATE ON "+TABLECHILD+" "\
+ << QString()%"DROP TRIGGER IF EXISTS \
fku_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT \ + << \
QString()%"CREATE TRIGGER \
fku_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT%" "\ + "BEFORE \
UPDATE ON "%TABLECHILD%" "\ "FOR EACH ROW BEGIN "\
- " SELECT RAISE(ABORT, '"+SKGServices::stringToSqlString(i18nc("Error \
message", "Impossible to update object (%1 is used by %2).\nConstraint name: \
%3",TABLEPARENT, TABLECHILD, \
"fku_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT))+"') "\
- " WHERE NEW."+ATTCHILD+"!=0 AND NEW."+ATTCHILD+"!='' AND (SELECT \
"+ATTPARENT+" FROM "+TABLEPARENT+" WHERE "+ATTPARENT+" = NEW."+ATTCHILD+") IS NULL; \
"\ + " SELECT RAISE(ABORT, \
'"%SKGServices::stringToSqlString(i18nc("Error message", "Impossible to update object \
(%1 is used by %2).\nConstraint name: %3",TABLEPARENT, TABLECHILD, \
"fku_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT))%"') "\ + " \
WHERE NEW."%ATTCHILD%"!=0 AND NEW."%ATTCHILD%"!='' AND (SELECT "%ATTPARENT%" FROM \
"%TABLEPARENT%" WHERE "%ATTPARENT%" = NEW."%ATTCHILD%") IS NULL; "\ "END"
/**
@@ -187,12 +187,12 @@ static const QString NOUPDATE = "-------";
*/
#define FOREIGNCONSTRAINT(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
INSERTUPDATECONSTRAINT(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
- << QString()+"DROP TRIGGER IF EXISTS \
fkd_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT \
- << QString()+"CREATE TRIGGER \
fkd_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT+" "\
- "BEFORE DELETE ON "+TABLEPARENT+" "\
+ << QString()%"DROP TRIGGER IF EXISTS \
fkd_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT \ + << \
QString()%"CREATE TRIGGER \
fkd_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT%" "\ + "BEFORE \
DELETE ON "%TABLEPARENT%" "\ "FOR EACH ROW BEGIN "\
- " SELECT RAISE(ABORT, '"+SKGServices::stringToSqlString(i18nc("Error \
message", "Impossible to delete used object (%1 is used by %2).\nConstraint name: \
%3",TABLEPARENT, TABLECHILD, \
"fkd_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT))+"') "\
- " WHERE (SELECT "+ATTCHILD+" FROM "+TABLECHILD+" WHERE "+ATTCHILD+" = \
OLD."+ATTPARENT+") IS NOT NULL; "\ + " SELECT RAISE(ABORT, \
'"%SKGServices::stringToSqlString(i18nc("Error message", "Impossible to delete used \
object (%1 is used by %2).\nConstraint name: %3",TABLEPARENT, TABLECHILD, \
"fkd_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT))%"') "\ + " \
WHERE (SELECT "%ATTCHILD%" FROM "%TABLECHILD%" WHERE "%ATTCHILD%" = \
OLD."%ATTPARENT%") IS NOT NULL; "\ "END"
/**
@@ -201,16 +201,16 @@ static const QString NOUPDATE = "-------";
*/
#define FOREIGNCONSTRAINTUPDATE(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
INSERTUPDATECONSTRAINT(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
- << QString()+"DROP TRIGGER IF EXISTS \
fkd_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT \
- << QString()+"CREATE TRIGGER \
fkd_"+TABLECHILD+"_"+TABLEPARENT+"_"+ATTCHILD+"_"+ATTPARENT+" "\
- "BEFORE DELETE ON "+TABLEPARENT+" "\
+ << QString()%"DROP TRIGGER IF EXISTS \
fkd_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT \ + << \
QString()%"CREATE TRIGGER \
fkd_"%TABLECHILD%"_"%TABLEPARENT%"_"%ATTCHILD%"_"%ATTPARENT%" "\ + "BEFORE \
DELETE ON "%TABLEPARENT%" "\ "FOR EACH ROW BEGIN "\
- " UPDATE "+TABLECHILD+" SET "+ATTCHILD+"=0 WHERE \
"+ATTCHILD+"=OLD."+ATTPARENT+"; "\ + " UPDATE "%TABLECHILD%" SET \
"%ATTCHILD%"=0 WHERE "%ATTCHILD%"=OLD."%ATTPARENT%"; "\ "END"
/**
* @def FOREIGNCONSTRAINTCASCADE
- * Define a standard trigger for foreign constraint +cascade delete
+ * Define a standard trigger for foreign constraint cascade delete
*/
#define FOREIGNCONSTRAINTCASCADE(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
INSERTUPDATECONSTRAINT(TABLEPARENT,ATTPARENT,TABLECHILD,ATTCHILD)\
@@ -221,11 +221,11 @@ static const QString NOUPDATE = "-------";
* Define a cascaded delete to delete parameters associated with an object
*/
#define DELETECASCADEPARAMETER(TABLE) \
- << QString()+"DROP TRIGGER IF EXISTS fkdc_"+TABLE+"_parameters_uuid" \
- << QString()+"CREATE TRIGGER fkdc_"+TABLE+"_parameters_uuid "\
- "BEFORE DELETE ON "+TABLE+" "\
+ << QString()%"DROP TRIGGER IF EXISTS fkdc_"%TABLE%"_parameters_uuid" \
+ << QString()%"CREATE TRIGGER fkdc_"%TABLE%"_parameters_uuid "\
+ "BEFORE DELETE ON "%TABLE%" "\
"FOR EACH ROW BEGIN "\
- " DELETE FROM parameters WHERE \
parameters.t_uuid_parent=OLD.id||'-'||'"+TABLE+"'; "\ + " DELETE FROM \
parameters WHERE parameters.t_uuid_parent=OLD.id||'-'||'"%TABLE%"'; "\ "END"
#endif
diff --git a/skgbasemodeler/skgdocument.cpp b/skgbasemodeler/skgdocument.cpp
index 552ad4a..a74c3ed 100644
--- a/skgbasemodeler/skgdocument.cpp
+++ b/skgbasemodeler/skgdocument.cpp
@@ -67,7 +67,7 @@ SKGDocument::SKGDocument()
//Database unique identifier
++m_databaseUniqueIdentifier;
- m_databaseIdentifier = "SKGDATABASE_" + \
SKGServices::intToString(m_databaseUniqueIdentifier); + m_databaseIdentifier = \
"SKGDATABASE_" % SKGServices::intToString(m_databaseUniqueIdentifier);
//Initialisation of backup file parameters
setBackupParameters("", ".old");
@@ -162,9 +162,9 @@ SKGError SKGDocument::beginTransaction(const QString & iName, int \
iNbStep, const //Create undo redo transaction
err = executeSqliteOrder("insert into doctransaction "
"(d_date, t_name, i_parent) values "
- "('" + SKGServices::timeToString(iDate) +
- "','" + SKGServices::stringToSqlString(iName) +
- "', " + \
SKGServices::intToString(getTransactionToProcess(SKGDocument::UNDO)) + ");"); + \
"('" % SKGServices::timeToString(iDate) % + "','" \
% SKGServices::stringToSqlString(iName) % + "', " \
% SKGServices::intToString(getTransactionToProcess(SKGDocument::UNDO)) \
% ");");
m_currentTransaction = getTransactionToProcess(SKGDocument::UNDO);
}
} else {
@@ -218,13 +218,13 @@ SKGError SKGDocument::endTransaction(bool succeedded)
if(succeedded) {
//Link items on current transaction
if(err.isSucceeded()) {
- err = executeSqliteOrder("UPDATE doctransactionitem set \
rd_doctransaction_id=" + currentTransactionString + " WHERE \
rd_doctransaction_id=0;"); + err = executeSqliteOrder("UPDATE \
doctransactionitem set rd_doctransaction_id=" % currentTransactionString % " WHERE \
rd_doctransaction_id=0;"); }
//Optimization of the current transaction
if(err.isSucceeded()) {
SKGStringListList listTmp;
- err = executeSelectSqliteOrder("SELECT count(1) FROM \
doctransactionitem where rd_doctransaction_id=" + currentTransactionString, listTmp); \
+ err = executeSelectSqliteOrder("SELECT count(1) FROM \
doctransactionitem where rd_doctransaction_id=" % currentTransactionString, listTmp); \
if(err.isSucceeded()) {
int nbItem = SKGServices::stringToInt(listTmp.at(1).at(0));
if(nbItem == 0) {
@@ -234,7 +234,7 @@ SKGError SKGDocument::endTransaction(bool succeedded)
getMessages(getCurrentTransaction(), popupMessages, \
false);
//Delete current transaction
- err = executeSqliteOrder("DELETE FROM doctransaction \
WHERE id=" + currentTransactionString); + err = \
executeSqliteOrder("DELETE FROM doctransaction WHERE id=" % \
currentTransactionString);
foreach(const QString & msg, popupMessages) {
m_unTransactionnalMessages.push_back(msg);
@@ -249,7 +249,7 @@ SKGError SKGDocument::endTransaction(bool succeedded)
err = executeSqliteOrder(
"DELETE FROM doctransactionitem WHERE id IN "
"(SELECT a.id FROM doctransactionitem a, \
doctransactionitem b "
- "WHERE a.rd_doctransaction_id=" + \
currentTransactionString + + "WHERE \
a.rd_doctransaction_id=" % currentTransactionString %
" AND b.rd_doctransaction_id=a.rd_doctransaction_id \
AND a.i_object_id=b.i_object_id "
"AND a.t_object_table=b.t_object_table AND "
"b.t_action=a.t_action AND b.t_sqlorder=a.t_sqlorder \
AND a.id>b.id );"); @@ -259,7 +259,7 @@ SKGError SKGDocument::endTransaction(bool \
succeedded) if(err.isSucceeded()) {
err = this->getDistinctValues("doctransactionitem",
"t_object_table",
- "rd_doctransaction_id=" + \
currentTransactionString, + \
"rd_doctransaction_id=" % currentTransactionString, listModifiedTables);
}
@@ -269,7 +269,7 @@ SKGError SKGDocument::endTransaction(bool succeedded)
if(maxdepthstring.length() == 0) maxdepthstring = "-1";
int maxdepth = SKGServices::stringToInt(maxdepthstring);
if(maxdepth >= 0) {
- err = executeSqliteOrder("delete from doctransaction where \
id in (select id from doctransaction limit max(0,((select count(1) from \
doctransaction)-(" + maxdepthstring + "))))"); + err = \
executeSqliteOrder("delete from doctransaction where id in (select id from \
doctransaction limit max(0,((select count(1) from doctransaction)-(" % maxdepthstring \
% "))))"); }
}
@@ -277,7 +277,7 @@ SKGError SKGDocument::endTransaction(bool succeedded)
if(!m_inundoRedoTransaction) {
int i = 0;
while((i = getTransactionToProcess(SKGDocument::REDO)) && \
err.isSucceeded()) {
- err = executeSqliteOrder("delete from doctransaction where \
id=" + SKGServices::intToString(i)); + err = \
executeSqliteOrder("delete from doctransaction where id=" % \
SKGServices::intToString(i)); }
}
@@ -293,7 +293,7 @@ SKGError SKGDocument::endTransaction(bool succeedded)
SKGError err2 = executeSqliteOrder("ROLLBACK;");
if(err2.isSucceeded()) {
//delete the transaction
- err2 = executeSqliteOrder("delete from doctransaction where id=" \
+ currentTransactionString); + err2 = executeSqliteOrder("delete \
from doctransaction where id=" % currentTransactionString); }
if(err2.isFailed()) err.addError(err2.getReturnCode(), \
err2.getMessage()); @@ -328,7 +328,7 @@ SKGError SKGDocument::endTransaction(bool \
succeedded)
Q_EMIT transactionSuccessfullyEnded(getCurrentTransaction());
//Remove temporary transaction if needed
- err = executeSqliteOrder("delete from doctransaction where id=" \
+ currentTransactionString + " and t_name='#INTERNAL#';"); + err = \
executeSqliteOrder("delete from doctransaction where id=" % currentTransactionString \
% " and t_name='#INTERNAL#';"); }
}
@@ -394,10 +394,10 @@ SKGError SKGDocument::getMessages(int iIdTransaction, \
QStringList& oMessages, bo
SKGStringListList listTmp;
err = executeSelectSqliteOrder(
- QString("SELECT t_message, t_popup FROM doctransactionmsg WHERE ") +
- (iAll ? "t_popup IS NOT NULL" : "t_popup='Y'") +
- " AND rd_doctransaction_id=" +
- SKGServices::intToString(iIdTransaction) +
+ QString("SELECT t_message, t_popup FROM doctransactionmsg WHERE ") %
+ (iAll ? "t_popup IS NOT NULL" : "t_popup='Y'") %
+ " AND rd_doctransaction_id=" %
+ SKGServices::intToString(iIdTransaction) %
" ORDER BY id ASC",
listTmp);
int nb = listTmp.count();
@@ -416,8 +416,8 @@ SKGError SKGDocument::getModifications(int iIdTransaction, \
SKGObjectModification
SKGStringListList listTmp;
err = executeSelectSqliteOrder(
- "SELECT i_object_id,t_object_table,t_action FROM doctransactionitem \
WHERE rd_doctransaction_id=" +
- SKGServices::intToString(iIdTransaction) +
+ "SELECT i_object_id,t_object_table,t_action FROM doctransactionitem \
WHERE rd_doctransaction_id=" % + \
SKGServices::intToString(iIdTransaction) % " ORDER BY id ASC",
listTmp);
int nb = listTmp.count();
@@ -427,7 +427,7 @@ SKGError SKGDocument::getModifications(int iIdTransaction, \
SKGObjectModification mod.table = listTmp.at(i).at(1);
QString type = listTmp.at(i).at(2);
mod.type = (type == "D" ? I : (type == "I" ? D : U)); //Normal because in \
database we have to sql order to go back.
- mod.uuid = listTmp.at(i).at(0) + '-' + mod.table;
+ mod.uuid = listTmp.at(i).at(0) % '-' % mod.table;
oModifications.push_back(mod);
}
@@ -493,9 +493,9 @@ SKGError SKGDocument::groupTransactions(int iFrom, int iTo)
//Get transaction
SKGStringListList transactions;
err = executeSelectSqliteOrder(
- QString("SELECT id, t_name, t_mode, i_parent FROM doctransaction \
WHERE id BETWEEN ") +
- smin + " AND " +
- smax + " ORDER BY id ASC",
+ QString("SELECT id, t_name, t_mode, i_parent FROM doctransaction \
WHERE id BETWEEN ") % + smin % " AND " %
+ smax % " ORDER BY id ASC",
transactions);
//Check and get main parameter for the group
@@ -523,20 +523,20 @@ SKGError SKGDocument::groupTransactions(int iFrom, int iTo)
//Group items
if(err.isSucceeded())
err = executeSqliteOrder(
- QString("UPDATE doctransactionitem set \
rd_doctransaction_id=") +
- smax +
- " where rd_doctransaction_id BETWEEN " +
- smin + " AND " + smax);
+ QString("UPDATE doctransactionitem set \
rd_doctransaction_id=") % + smax %
+ " where rd_doctransaction_id BETWEEN " %
+ smin % " AND " % smax);
if(err.isSucceeded())
err = executeSqliteOrder(
- QString("UPDATE doctransaction set i_parent=") +
- communParent +
- ", t_name='" + SKGServices::stringToSqlString(name) +
- "' where id=" + smax);
+ QString("UPDATE doctransaction set i_parent=") %
+ communParent %
+ ", t_name='" % SKGServices::stringToSqlString(name) %
+ "' where id=" % smax);
if(err.isSucceeded()) err = executeSqliteOrder(
- QString("DELETE FROM \
doctransaction WHERE id BETWEEN ") +
- smin + " AND " + \
SKGServices::intToString(qMax(iFrom, iTo) - 1)); + \
QString("DELETE FROM doctransaction WHERE id BETWEEN ") % + \
smin % " AND " % SKGServices::intToString(qMax(iFrom, iTo) - 1)); }
if(err.isSucceeded()) err = endTransaction(true);
@@ -601,8 +601,8 @@ SKGError SKGDocument::undoRedoTransaction(const UndoRedoMode& \
iMode)
SKGTRACEL(5) << "Undoing transaction [" << id << "]- [" << name << \
"]..." << endl; SKGStringListList listSqlOrder;
err = executeSelectSqliteOrder(
- "SELECT t_sqlorder FROM doctransactionitem WHERE \
rd_doctransaction_id=" +
- SKGServices::intToString(id) +
+ "SELECT t_sqlorder FROM doctransactionitem WHERE \
rd_doctransaction_id=" % + SKGServices::intToString(id) %
" ORDER BY id DESC",
listSqlOrder);
if(err.isSucceeded()) {
@@ -623,19 +623,19 @@ SKGError SKGDocument::undoRedoTransaction(const UndoRedoMode& \
iMode) int newredo = getTransactionToProcess(iMode);
if(err.isSucceeded())
err = executeSqliteOrder(
- QString("UPDATE doctransaction set \
t_mode=") +
- (iMode == SKGDocument::UNDO || iMode == \
SKGDocument::UNDOLASTSAVE ? "'R'" : "'U'") +
- ", i_parent=" +
- SKGServices::intToString(lastredo) +
- " where id=" + \
SKGServices::intToString(newredo)); + \
QString("UPDATE doctransaction set t_mode=") % + \
(iMode == SKGDocument::UNDO || iMode == SKGDocument::UNDOLASTSAVE ? "'R'" : "'U'") % \
+ ", i_parent=" % + \
SKGServices::intToString(lastredo) % + " \
where id=" % SKGServices::intToString(newredo)); if(err.isSucceeded()) err = \
stepForward(nb);
//Move messages from previous transaction to new one
if(err.isSucceeded())
err = executeSqliteOrder(
- "UPDATE doctransactionmsg set \
rd_doctransaction_id=" +
- \
SKGServices::intToString(getCurrentTransaction()) +
- " where rd_doctransaction_id=" +
+ "UPDATE doctransactionmsg set \
rd_doctransaction_id=" % + \
SKGServices::intToString(getCurrentTransaction()) % + \
" where rd_doctransaction_id=" % SKGServices::intToString(id));
if(err.isSucceeded()) err = stepForward(nb + 1);
@@ -643,14 +643,14 @@ SKGError SKGDocument::undoRedoTransaction(const UndoRedoMode& \
iMode) if(err.isSucceeded())
err = executeSqliteOrder(
"DELETE from doctransaction where id="
- + SKGServices::intToString(id));
+ % SKGServices::intToString(id));
if(err.isSucceeded()) err = stepForward(nb + 2);
//Check that new transaction has exactly the same number \
of item /* if (err.isSucceeded()) {
SKGStringListList listSqlOrder;
err=executeSelectSqliteOrder(
- "SELECT count(1) FROM \
doctransactionitem WHERE rd_doctransaction_id=" + + \
"SELECT count(1) FROM doctransactionitem WHERE rd_doctransaction_id=" \
%
\
SKGServices::intToString(getCurrentTransaction()), listSqlOrder);
if (err.isSucceeded() && \
SKGServices::stringToInt(listSqlOrder.at(1).at(0))!=nb-1) { @@ -783,7 +783,7 @@ \
SKGError SKGDocument::load(const QString & name, const QString & password, bool } \
else { //BUG 249955: Check if password protected vvv
//Temporary file will be loaded but first we must check if original \
document is password protected
- QString temporaryFile2 = m_temporaryFile + '2';
+ QString temporaryFile2 = m_temporaryFile % '2';
err = SKGServices::cryptFile(name, temporaryFile2, password, false, \
getDocumentHeader());
//Try an open to check if well descrypted
@@ -820,7 +820,7 @@ SKGError SKGDocument::load(const QString & name, const QString & \
password, bool }
} else {
//Temporary file
- m_temporaryFile = QDir::tempPath() + "/skg_" + \
QUuid::createUuid().toString() + ".skg"; + m_temporaryFile = \
QDir::tempPath() % "/skg_" % QUuid::createUuid().toString() % ".skg";
//Create memory database
m_currentDatabase = new \
QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", m_databaseIdentifier)); @@ -868,7 \
+868,7 @@ SKGError SKGDocument::load(const QString & name, const QString & password, \
bool //Table node
<< "CREATE TABLE node ("
"id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
- "t_name TEXT NOT NULL DEFAULT '' CHECK (t_name NOT LIKE \
'%" + OBJECTSEPARATOR + "%')," + "t_name TEXT NOT NULL \
DEFAULT '' CHECK (t_name NOT LIKE '%" % OBJECTSEPARATOR % "%')," "t_fullname TEXT,"
"t_icon TEXT DEFAULT '',"
"f_sortorder FLOAT,"
@@ -1004,7 +1004,7 @@ SKGError SKGDocument::saveAs(const QString & name, bool \
overwrite) bool backupFileMustBeRemoved = false;
QString backupFileName = getBackupFile(name);
if(backupFileName.isEmpty()) {
- backupFileName = name + ".tmp";
+ backupFileName = name % ".tmp";
backupFileMustBeRemoved = true;
}
@@ -1024,7 +1024,7 @@ SKGError SKGDocument::saveAs(const QString & name, bool \
overwrite) //Copy memory to tmp db
if(!m_directAccessDb && err.isSucceeded()) {
QFile::remove(m_temporaryFile);
- QSqlDatabase* fileDb = new \
QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", m_databaseIdentifier + "_tmp")); + \
QSqlDatabase* fileDb = new QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", \
m_databaseIdentifier % "_tmp")); fileDb->setDatabaseName(m_temporaryFile);
if(!fileDb->open()) {
//Set error message
@@ -1036,7 +1036,7 @@ SKGError SKGDocument::saveAs(const QString & name, bool \
overwrite)
fileDb->close();
delete fileDb;
- QSqlDatabase::removeDatabase(m_databaseIdentifier + \
"_tmp"); + \
QSqlDatabase::removeDatabase(m_databaseIdentifier % "_tmp"); }
if(err.isSucceeded()) err = \
SKGServices::cryptFile(m_temporaryFile, name, getParameter("SKG_PASSWORD"), true, \
getDocumentHeader());
if(!m_directAccessDb) QFile(m_temporaryFile).remove();
@@ -1125,7 +1125,7 @@ SKGError SKGDocument::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER cpt_node_fullname1 "
"AFTER INSERT ON node BEGIN "
"UPDATE node SET t_fullname="
- "CASE WHEN r_node_id IS NULL OR r_node_id=0 THEN new.t_name ELSE (SELECT \
c.t_fullname from node c where c.id=new.r_node_id)||'" + OBJECTSEPARATOR + \
"'||new.t_name END " + "CASE WHEN r_node_id IS NULL OR r_node_id=0 THEN \
new.t_name ELSE (SELECT c.t_fullname from node c where c.id=new.r_node_id)||'" % \
OBJECTSEPARATOR % "'||new.t_name END " "WHERE id=new.id;"
"END"
@@ -1133,7 +1133,7 @@ SKGError SKGDocument::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER cpt_node_fullname2 "
"AFTER UPDATE OF t_name ON node BEGIN "
"UPDATE node SET t_fullname="
- "CASE WHEN r_node_id IS NULL OR r_node_id='' THEN new.t_name ELSE \
(SELECT c.t_fullname from node c where c.id=new.r_node_id)||'" + OBJECTSEPARATOR + \
"'||new.t_name END " + "CASE WHEN r_node_id IS NULL OR r_node_id='' THEN \
new.t_name ELSE (SELECT c.t_fullname from node c where c.id=new.r_node_id)||'" % \
OBJECTSEPARATOR % "'||new.t_name END " "WHERE id=new.id;"
"UPDATE node SET t_name=t_name WHERE r_node_id=new.id;"
"END"
@@ -1143,7 +1143,7 @@ SKGError SKGDocument::refreshViewsIndexesAndTriggers()
<< "CREATE TRIGGER fkdc_node_parent_id_node_id "
"BEFORE DELETE ON node "
"FOR EACH ROW BEGIN "
- " DELETE FROM node WHERE node.t_fullname LIKE OLD.t_fullname||'" + \
OBJECTSEPARATOR + "%'; " + " DELETE FROM node WHERE node.t_fullname \
LIKE OLD.t_fullname||'" % OBJECTSEPARATOR % "%'; " "END"
;
@@ -1207,7 +1207,7 @@ SKGError SKGDocument::refreshViewsIndexesAndTriggers()
for(int i = 0; err.isSucceeded() && i < nb; ++i) {
QString table = tables[i];
SKGStringListList attributes;
- err = executeSelectSqliteOrder("PRAGMA table_info(" + table + ");", \
attributes); + err = executeSelectSqliteOrder("PRAGMA table_info(" % table \
% ");", attributes); int nb2 = attributes.count();
for(int j = 1; err.isSucceeded() && j < nb2; ++j) { //Header is ignored
QString att = attributes.at(j).at(1);
@@ -1232,7 +1232,7 @@ SKGError SKGDocument::refreshViewsIndexesAndTriggers()
QStringList sqlOrders;
sqlOrders FOREIGNCONSTRAINTUPDATE(tab2, att2, table, att);
err = executeSqliteOrders(sqlOrders);
- if(err.isSucceeded()) err = executeSqliteOrder("UPDATE " + table \
+ " SET " + att + "=0 WHERE " + att + "!=0 AND " + att + " NOT IN (SELECT DISTINCT(" \
+ att2 + ") FROM " + tab2 + ')'); + if(err.isSucceeded()) err = \
executeSqliteOrder("UPDATE " % table % " SET " % att % "=0 WHERE " % att % "!=0 AND " \
% att % " NOT IN (SELECT DISTINCT(" % att2 % ") FROM " % tab2 % ')'); }
}
}
@@ -1311,7 +1311,7 @@ SKGError SKGDocument::migrate(bool& oMigrationDone)
SKGTRACEL(10) << "Migration from 0.3 to 0.4" << endl;
err = executeSqliteOrder("ALTER TABLE node ADD COLUMN t_autostart VARCHAR(1) \
DEFAULT 'N' CHECK (t_autostart IN ('Y', 'N'))");
- if(err.isSucceeded()) err = executeSqliteOrder("UPDATE node set \
t_autostart='Y' where t_name='" + i18nc("Verb, automatically load when the \
application is started", "autostart") + '\''); + if(err.isSucceeded()) err = \
executeSqliteOrder("UPDATE node set t_autostart='Y' where t_name='" % i18nc("Verb, \
automatically load when the application is started", "autostart") % '\'');
//Set new version
version = "0.4";
@@ -1402,8 +1402,8 @@ SKGError SKGDocument::migrate(bool& oMigrationDone)
QStringList data = SKGServices::splitCSVLine(line.at(1));
if(data.count() > 2) icon = data.at(2);
data.removeAt(2);
- err = executeSqliteOrder("UPDATE node set t_icon='" + \
SKGServices::stringToSqlString(icon) +
- "', t_data='" + \
SKGServices::stringToSqlString(SKGServices::stringsToCsv(data)) + "' where id=" + \
line.at(0)); + err = executeSqliteOrder("UPDATE node set t_icon='" % \
SKGServices::stringToSqlString(icon) % + "', \
t_data='" % SKGServices::stringToSqlString(SKGServices::stringsToCsv(data)) % "' \
where id=" % line.at(0)); }
}
@@ -1446,7 +1446,7 @@ SKGError SKGDocument::createUndoRedoTemporaryTriggers()
QString table = tables[i];
//Do we have to treat this table
- if(!SKGListNotUndoable.contains("T." + table)) {
+ if(!SKGListNotUndoable.contains("T." % table)) {
//YES
//Get attributes name
QStringList attributes;
@@ -1462,12 +1462,12 @@ SKGError SKGDocument::createUndoRedoTemporaryTriggers()
QString att = attributes[j];
//Do we have to treat this attribute
- if(!SKGListNotUndoable.contains("A." + table + '.' + att)) {
+ if(!SKGListNotUndoable.contains("A." % table % '.' % att)) {
//Build for update
if(sqlorderForUpdate2.length() > 0)
sqlorderForUpdate2 += ',';
- sqlorderForUpdate2 += att + "='||quote(old." + att + ")||'";
+ sqlorderForUpdate2 += att % "='||quote(old." % att % ")||'";
//Build for insert part 1
if(sqlorderForInsert1.length() > 0)
@@ -1477,40 +1477,40 @@ SKGError SKGDocument::createUndoRedoTemporaryTriggers()
//Build for insert part 2
if(sqlorderForInsert2.length() > 0)
sqlorderForInsert2 += ',';
- sqlorderForInsert2 += "'||quote(old." + att + ")||'";
+ sqlorderForInsert2 += "'||quote(old." % att % ")||'";
}
}
//Create specific triggers for the current transaction
QStringList sqlOrders;
//DROP DELETE trigger
- sqlOrders << "DROP TRIGGER IF EXISTS UR_" + table + "_IN"
+ sqlOrders << "DROP TRIGGER IF EXISTS UR_" % table % "_IN"
//Create DELETE trigger
- << "CREATE TEMP TRIGGER UR_" + table + "_IN "
- "AFTER INSERT ON " + table + " BEGIN "
- "INSERT INTO doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'DELETE FROM \
" + table +
- " WHERE id='||new.id,new.id,'" + table + "','D');END"
+ << "CREATE TEMP TRIGGER UR_" % table % "_IN "
+ "AFTER INSERT ON " % table % " BEGIN "
+ "INSERT INTO doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'DELETE FROM " % table % + \
" WHERE id='||new.id,new.id,'" % table % "','D');END"
//DROP UPDATE trigger
- << "DROP TRIGGER IF EXISTS UR_" + table + "_UP"
+ << "DROP TRIGGER IF EXISTS UR_" % table % "_UP"
//Create UPDATE trigger
- << "CREATE TEMP TRIGGER UR_" + table + "_UP "
- "AFTER UPDATE ON " + table + " BEGIN "
- "INSERT INTO doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'UPDATE " + \
table +
- " SET " + sqlorderForUpdate2 +
- " WHERE id='||new.id,new.id,'" + table + "','U');END"
+ << "CREATE TEMP TRIGGER UR_" % table % "_UP "
+ "AFTER UPDATE ON " % table % " BEGIN "
+ "INSERT INTO doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'UPDATE " % table % + \
" SET " % sqlorderForUpdate2 % + " WHERE id='||new.id,new.id,'" \
% table % "','U');END"
//DROP INSERT trigger
- << "DROP TRIGGER IF EXISTS UR_" + table + "_DE"
+ << "DROP TRIGGER IF EXISTS UR_" % table % "_DE"
//Create INSERT trigger
- << "CREATE TEMP TRIGGER UR_" + table + "_DE "
- "AFTER DELETE ON " + table +
+ << "CREATE TEMP TRIGGER UR_" % table % "_DE "
+ "AFTER DELETE ON " % table %
" BEGIN "
- "INSERT INTO doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'INSERT INTO \
" + table +
- '(' + sqlorderForInsert1 + ") VALUES(" + sqlorderForInsert2 + \
")',old.id,'" + table + "','I'); END"; + "INSERT INTO \
doctransactionitem (rd_doctransaction_id, \
t_sqlorder,i_object_id,t_object_table,t_action) VALUES(0,'INSERT INTO " % table % + \
'(' % sqlorderForInsert1 % ") VALUES(" % sqlorderForInsert2 % ")',old.id,'" % table % \
"','I'); END"; err = executeSqliteOrders(sqlOrders);
}
}
@@ -1521,8 +1521,8 @@ QStringList SKGDocument::getParameters(const QString& \
iParentUUID, const QString {
SKGTRACEIN(10, "SKGDocument::getParameters");
QStringList output;
- QString wc = "t_uuid_parent='" + SKGServices::stringToSqlString(iParentUUID) + \
'\'';
- if(!iWhereClause.isEmpty()) wc += " AND (" + iWhereClause + ')';
+ QString wc = "t_uuid_parent='" % SKGServices::stringToSqlString(iParentUUID) % \
'\''; + if(!iWhereClause.isEmpty()) wc += " AND (" % iWhereClause % ')';
this->getDistinctValues("parameters", "t_name", wc, output);
return output;
}
@@ -1535,8 +1535,8 @@ QString SKGDocument::getParameter(const QString& iName, const \
QString& iParentUU
//Get parameter
SKGObjectBase param;
- SKGError err = getObject("parameters", "t_name='" + \
SKGServices::stringToSqlString(iName) +
- "' AND t_uuid_parent='" + \
SKGServices::stringToSqlString(iParentUUID) + '\'', param); + SKGError err = \
getObject("parameters", "t_name='" % SKGServices::stringToSqlString(iName) % + \
"' AND t_uuid_parent='" % SKGServices::stringToSqlString(iParentUUID) % '\'', param); \
if(err.isSucceeded()) { output = param.getAttribute("t_value");
}
@@ -1578,7 +1578,7 @@ SKGError SKGDocument::setParameter(const QString& iName, const \
QString& iValue, if(file.exists()) {
QFileInfo fileInfo(iFileName);
if(fileInfo.isDir()) {
- value = "file://" + iFileName;
+ value = "file://" % iFileName;
} else {
//Open file
if(!file.open(QIODevice::ReadOnly)) {
@@ -1626,7 +1626,7 @@ SKGError SKGDocument::setParameter(const QString& iName, const \
QString& iValue, query.addBindValue(param.getID());
if(!query.exec()) {
QSqlError sqlError = query.lastError();
- QString msg = sqlQuery + ':' + sqlError.text();
+ QString msg = sqlQuery % ':' % sqlError.text();
err = SKGError(SQLLITEERROR + sqlError.number(), msg);
}
}
@@ -1709,7 +1709,7 @@ SKGError SKGDocument::getConsolidatedView(const QString& \
iTable, QStringList* titles = (QStringList*) & (oTable.at(0));
if(mode == 3) {
- titles->push_back(iAsRow + '/' + iAsColumn);
+ titles->push_back(iAsRow % '/' % iAsColumn);
} else {
if(mode == 1) {
titles->push_back(iAsColumn);
@@ -1729,12 +1729,12 @@ SKGError SKGDocument::getConsolidatedView(const QString& \
iTable, QString asColumn = iAsColumn;
if(asColumn.startsWith(QLatin1String("p_"))) {
QString propertyName = asColumn.right(asColumn.length() - 2);
- asColumn = "(SELECT t_value FROM parameters WHERE t_uuid_parent=" + iTable + \
".id||'-" + SKGServices::getRealTable(iTable) + "' AND t_name='" + propertyName + \
"')"; + asColumn = "(SELECT t_value FROM parameters WHERE t_uuid_parent=" % \
iTable % ".id||'-" % SKGServices::getRealTable(iTable) % "' AND t_name='" % \
propertyName % "')"; }
QString asRow = iAsRow;
if(asRow.startsWith(QLatin1String("p_"))) {
QString propertyName = asRow.right(asRow.length() - 2);
- asRow = "(SELECT t_value FROM parameters WHERE t_uuid_parent=" + iTable + \
".id||'-" + SKGServices::getRealTable(iTable) + "' AND t_name='" + propertyName + \
"')"; + asRow = "(SELECT t_value FROM parameters WHERE t_uuid_parent=" % \
iTable % ".id||'-" % SKGServices::getRealTable(iTable) % "' AND t_name='" % \
propertyName % "')"; }
QString att = asColumn;
@@ -1746,10 +1746,10 @@ SKGError SKGDocument::getConsolidatedView(const QString& \
iTable, sort += asColumn;
if(!att.isEmpty()) {
- QString sql = "SELECT " + att + ',' + iOpAtt + '(' + iAttribute + ") FROM " \
+ iTable;
- if(!iWhereClause.isEmpty()) sql += " WHERE " + iWhereClause;
- if(!iOpAtt.isEmpty()) sql += " GROUP BY " + att;
- sql += " ORDER BY " + sort;
+ QString sql = "SELECT " % att % ',' % iOpAtt % '(' % iAttribute % ") FROM " \
% iTable; + if(!iWhereClause.isEmpty()) sql += " WHERE " % iWhereClause;
+ if(!iOpAtt.isEmpty()) sql += " GROUP BY " % att;
+ sql += " ORDER BY " % sort;
QHash<QString, int> cols;
QHash<QString, int> rows;
@@ -1869,11 +1869,11 @@ SKGError SKGDocument::getConsolidatedView(const QString& \
iTable, } else if(asColumn == "d_DATEQUARTER") {
nextExpected = nextExpected.addMonths(nextExpected.month() * 3 - \
nextExpected.month()); //convert quater in month nextExpected = \
nextExpected.addMonths(3);
- nextExpectedString = nextExpected.toString("yyyy-Q") + \
(nextExpected.month() <= 3 ? '1' : (nextExpected.month() <= 6 ? '2' : \
(nextExpected.month() <= 9 ? '3' : '4'))); + nextExpectedString = \
nextExpected.toString("yyyy-Q") % (nextExpected.month() <= 3 ? '1' : \
(nextExpected.month() <= 6 ? '2' : (nextExpected.month() <= 9 ? '3' : '4'))); } else \
if(asColumn == "d_DATESEMESTER") {
nextExpected = nextExpected.addMonths(nextExpected.month() * 6 - \
nextExpected.month()); //convert semester in month nextExpected = \
nextExpected.addMonths(6);
- nextExpectedString = nextExpected.toString("yyyy-S") + \
(nextExpected.month() <= 6 ? '1' : '2'); + nextExpectedString = \
nextExpected.toString("yyyy-S") % (nextExpected.month() <= 6 ? '1' : '2'); } else \
if(asColumn == "d_DATEYEAR") { nextExpected = nextExpected.addYears(1);
nextExpectedString = nextExpected.toString(dateFormat);
@@ -2019,7 +2019,7 @@ QString SKGDocument::getTemporaryFile(const QString iFileName)
QFileInfo fi(iFileName);
if(!KUrl(iFileName).isLocalFile()) output = QDir::tempPath();
else output = fi.absolutePath();
- return output += "/." + fi.fileName() + ".wrk";
+ return output += "/." % fi.fileName() % ".wrk";
}
QString SKGDocument::getBackupFile(const QString iFileName)
@@ -2027,7 +2027,7 @@ QString SKGDocument::getBackupFile(const QString iFileName)
QString output;
if(!m_backupPrefix.isEmpty() || !m_backupSuffix.isEmpty()) {
QFileInfo fi(iFileName);
- output = fi.absolutePath() + '/' + m_backupPrefix + fi.fileName() + \
m_backupSuffix; + output = fi.absolutePath() % '/' % m_backupPrefix % \
fi.fileName() % m_backupSuffix;
output = output.replace("<DATE>", \
SKGServices::timeToString(QDateTime::currentDateTime())); }
@@ -2047,8 +2047,8 @@ SKGError SKGDocument::getObjects(const QString& iTable, const \
QString& iWhereCla //Execute sqlorder
SKGStringListList result;
err = executeSelectSqliteOrder(
- QString("SELECT * FROM " + iTable +
- (!iWhereClause.isEmpty() ? QString(" WHERE " + iWhereClause) : "")),
+ QString("SELECT * FROM " % iTable %
+ (!iWhereClause.isEmpty() ? QString(" WHERE " % iWhereClause) : \
"")), result);
//Create output
@@ -2079,8 +2079,8 @@ SKGError SKGDocument::existObjects(const QString& iTable, const \
QString& iWhereC //Execute sqlorder
SKGStringListList result;
err = executeSelectSqliteOrder(
- "SELECT EXISTS(SELECT 1 FROM " + iTable + " WHERE " +
- (!iWhereClause.isEmpty() ? iWhereClause : "1=1") + ')',
+ "SELECT EXISTS(SELECT 1 FROM " % iTable % " WHERE " %
+ (!iWhereClause.isEmpty() ? iWhereClause : "1=1") % ')',
result);
//Create output
@@ -2101,8 +2101,8 @@ SKGError SKGDocument::getNbObjects(const QString& iTable, const \
QString& iWhereC //Execute sqlorder
SKGStringListList result;
err = executeSelectSqliteOrder(
- QString("SELECT count(1) FROM " + iTable +
- (!iWhereClause.isEmpty() ? QString(" WHERE " + iWhereClause) : "")),
+ QString("SELECT count(1) FROM " % iTable %
+ (!iWhereClause.isEmpty() ? QString(" WHERE " % iWhereClause) : \
"")), result);
//Create output
@@ -2128,7 +2128,7 @@ SKGError SKGDocument::getObject(const QString& iTable, const \
QString& iWhereClau
SKGError SKGDocument::getObject(const QString& iTable, int iId, SKGObjectBase& \
oObject) const {
- return getObject(iTable, "id=" + SKGServices::intToString(iId), oObject);
+ return getObject(iTable, "id=" % SKGServices::intToString(iId), oObject);
}
SKGError SKGDocument::getTablesList(QStringList& oResult) const
@@ -2148,12 +2148,12 @@ SKGError SKGDocument::getDistinctValues(const QString& \
iTable, const QString& iA //Search
SKGStringListList temporaryResult;
err = executeSelectSqliteOrder(
- "SELECT DISTINCT " + iAttribute +
- " FROM " + iTable + " WHERE (" +
- (iWhereClause.length() ? iWhereClause : "1=1") +
- ") ORDER BY " + iAttribute
+ "SELECT DISTINCT " % iAttribute %
+ " FROM " % iTable % " WHERE (" %
+ (iWhereClause.length() ? iWhereClause : "1=1") %
+ ") ORDER BY " % iAttribute
//Correction bug 202167 vvv
- + " COLLATE NOCASE"
+ % " COLLATE NOCASE"
//Correction bug 202167 ^^^
, temporaryResult);
if(err.isSucceeded()) {
@@ -2170,7 +2170,7 @@ SKGError SKGDocument::getDistinctValues(const QString& iTable, \
const QString& iA SKGError SKGDocument::getDistinctValues(const QString& iTable, \
const QString& iAttribute, QStringList& oResult) const {
return getDistinctValues(iTable, iAttribute,
- iAttribute + " IS NOT NULL AND " + iAttribute + "!=''",
+ iAttribute % " IS NOT NULL AND " % iAttribute % "!=''",
oResult);
}
@@ -2232,7 +2232,7 @@ SKGError SKGDocument::getAttributesDescription(const QString& \
iTable, SKGService
//Search
SKGStringListList temporaryResult;
- err = this->executeSelectSqliteOrder("PRAGMA table_info( " + iTable + " );", \
temporaryResult); + err = this->executeSelectSqliteOrder("PRAGMA table_info( " % \
iTable % " );", temporaryResult); if(err.isSucceeded()) {
int nblines = temporaryResult.count();
QString realTable = SKGServices::getRealTable(iTable);
@@ -2243,7 +2243,7 @@ SKGError SKGDocument::getAttributesDescription(const QString& \
iTable, SKGService SKGServices::SKGAttributeInfo attribute;
attribute.name = line[1];
- QString attname = realTable + '.' + attribute.name;
+ QString attname = realTable % '.' % attribute.name;
attribute.display = getDisplay(attname);
if(attribute.display == attname) {
attribute.display = "";
diff --git a/skgbasemodeler/skgerror.cpp b/skgbasemodeler/skgerror.cpp
index af12883..c25223d 100644
--- a/skgbasemodeler/skgerror.cpp
+++ b/skgbasemodeler/skgerror.cpp
@@ -132,14 +132,14 @@ QString SKGError::getFullMessage() const
tmp.setNum(m_rc);
output += tmp;
output += ']';
- if(m_message.length()) output += ": " + m_message;
+ if(m_message.length()) output += ": " % m_message;
return output;
}
QString SKGError::getFullMessageWithHistorical() const
{
QString output = getFullMessage();
- if(m_previousError) output += '\n' + \
m_previousError->getFullMessageWithHistorical(); + if(m_previousError) output += \
'\n' % m_previousError->getFullMessageWithHistorical(); return output;
}
diff --git a/skgbasemodeler/skgnamedobject.cpp b/skgbasemodeler/skgnamedobject.cpp
index bff5da9..a0b3b26 100644
--- a/skgbasemodeler/skgnamedobject.cpp
+++ b/skgbasemodeler/skgnamedobject.cpp
@@ -65,7 +65,7 @@ QString SKGNamedObject::getWhereclauseId() const
//No, so we use the name
QString name = SKGServices::stringToSqlString(getName());
if(!name.isEmpty() || getID() == 0) {
- output = "t_name='" + name + '\'';
+ output = "t_name='" % name % '\'';
}
}
return output;
@@ -73,7 +73,7 @@ QString SKGNamedObject::getWhereclauseId() const
SKGError SKGNamedObject::getObjectByName(SKGDocument* iDocument, const QString& \
iTable, const QString& iName, SKGObjectBase& oObject) {
- return iDocument ? iDocument->getObject(iTable, "t_name='" + \
SKGServices::stringToSqlString(iName) + '\'', oObject) : SKGError(); + return \
iDocument ? iDocument->getObject(iTable, "t_name='" % \
SKGServices::stringToSqlString(iName) % '\'', oObject) : SKGError(); }
#include "skgnamedobject.moc"
diff --git a/skgbasemodeler/skgnodeobject.cpp b/skgbasemodeler/skgnodeobject.cpp
index 0112a51..a340775 100644
--- a/skgbasemodeler/skgnodeobject.cpp
+++ b/skgbasemodeler/skgnodeobject.cpp
@@ -64,12 +64,12 @@ QString SKGNodeObject::getWhereclauseId() const
QString output = SKGObjectBase::getWhereclauseId();
if(output.isEmpty()) {
if(!(getAttribute("t_name").isEmpty())) {
- output = "t_name='" + \
SKGServices::stringToSqlString(getAttribute("t_name")) + '\''; + output = \
"t_name='" % SKGServices::stringToSqlString(getAttribute("t_name")) % '\''; }
QString r_node_id = getAttribute("r_node_id");
if(!output.isEmpty()) output += " AND ";
if(r_node_id.isEmpty()) output += "(r_node_id=0 OR r_node_id IS NULL OR \
r_node_id='')";
- else output += "r_node_id=" + r_node_id;
+ else output += "r_node_id=" % r_node_id;
}
return output;
}
@@ -145,7 +145,7 @@ SKGError SKGNodeObject::createPathNode(SKGDocument* iDocument,
SKGTRACEINRC(10, "SKGNodeObject::createPathNode", err);
SKGTRACEL(10) << "Input parameter [iFullPath]=" << iFullPath << endl;
//Check if node is already existing
- if(!iRenameIfAlreadyExist && iDocument) iDocument->getObject("v_node", \
"t_fullname='" + SKGServices::stringToSqlString(iFullPath) + '\'', oNode); + \
if(!iRenameIfAlreadyExist && iDocument) iDocument->getObject("v_node", "t_fullname='" \
% SKGServices::stringToSqlString(iFullPath) % '\'', oNode); if(oNode.getID() == 0) {
//No, we have to create it
//Search node separator
@@ -159,7 +159,7 @@ SKGError SKGNodeObject::createPathNode(SKGDocument* iDocument,
int index = 1;
while(err.isSucceeded() && oNode.exist()) {
index++;
- err = oNode.setName(iFullPath + " (" + \
SKGServices::intToString(index) + ')'); + err = \
oNode.setName(iFullPath % " (" % SKGServices::intToString(index) % ')'); }
}
@@ -186,7 +186,7 @@ SKGError SKGNodeObject::createPathNode(SKGDocument* iDocument,
if(err.isSucceeded() && iRenameIfAlreadyExist) {
int index = 2;
while(err.isSucceeded() && oNode.exist()) {
- err = oNode.setName(second + " (" + \
SKGServices::intToString(index) + ')'); + err = \
oNode.setName(second % " (" % SKGServices::intToString(index) % ')'); ++index;
}
}
@@ -246,13 +246,13 @@ SKGError SKGNodeObject::getParentNode(SKGNodeObject& oNode) \
const {
SKGError err;
QString parent_id = getAttribute("r_node_id");
- if(!parent_id.isEmpty()) err = getDocument()->getObject("v_node", "id=" + \
parent_id , oNode); + if(!parent_id.isEmpty()) err = \
getDocument()->getObject("v_node", "id=" % parent_id , oNode); return err;
}
SKGError SKGNodeObject::getNodes(SKGListSKGObjectBase& oNodeList) const
{
- return getDocument()->getObjects("v_node", "r_node_id=" + \
SKGServices::intToString(getID()) + " ORDER BY f_sortorder, t_name", oNodeList); + \
return getDocument()->getObjects("v_node", "r_node_id=" % \
SKGServices::intToString(getID()) % " ORDER BY f_sortorder, t_name", oNodeList); }
#include "skgnodeobject.moc"
diff --git a/skgbasemodeler/skgobjectbase.cpp b/skgbasemodeler/skgobjectbase.cpp
index 97596a7..6a8b3d2 100644
--- a/skgbasemodeler/skgobjectbase.cpp
+++ b/skgbasemodeler/skgobjectbase.cpp
@@ -112,7 +112,7 @@ bool SKGObjectBase::operator>(const SKGObjectBase& iObject) const
QString SKGObjectBase::getUniqueID() const
{
- return SKGServices::intToString(d->id) + '-' + getRealTable();
+ return SKGServices::intToString(d->id) % '-' % getRealTable();
}
int SKGObjectBase::getID() const
@@ -126,8 +126,8 @@ QString SKGObjectBase::getDisplayName() const
SKGStringListList result;
QString wc = getWhereclauseId();
- if(wc.isEmpty()) wc = "id=" + SKGServices::intToString(d->id);
- QString sql = "SELECT t_displayname FROM v_" + getRealTable() + "_displayname \
WHERE " + wc; + if(wc.isEmpty()) wc = "id=" % SKGServices::intToString(d->id);
+ QString sql = "SELECT t_displayname FROM v_" % getRealTable() % "_displayname \
WHERE " % wc;
if(getDocument()) getDocument()->executeSelectSqliteOrder(sql, result);
if(result.count() == 2) output = result.at(1).at(0);
@@ -216,7 +216,7 @@ SKGError SKGObjectBase::setAttribute(const QString& iName, const \
QString& iValue SKGObjectBase obj;
QString refId = getAttribute(l.at(1));
if(!refId.isEmpty()) {
- err = getDocument()->getObject("v_" + l.at(0), "id=" + \
refId, obj); + err = getDocument()->getObject("v_" % l.at(0), \
"id=" % refId, obj); if(err.isSucceeded()) {
err = obj.setAttribute(l.at(2), iValue);
d->objects.push_back(obj);
@@ -232,7 +232,7 @@ SKGError SKGObjectBase::setAttribute(const QString& iName, const \
QString& iValue
if(op == i18nc("Key word to modify a string into a field", "lower")) val \
= val.toLower();
else if(op == i18nc("Key word to modify a string into a field", \
"upper")) val = val.toUpper();
else if(op == i18nc("Key word to modify a string into a field", \
"capwords")) val = KStringHandler::capwords(val);
- else if(op == i18nc("Key word to modify a string into a field", \
"capitalize")) val = val.left(1).toUpper() + val.right(val.length() - 1).toLower(); + \
else if(op == i18nc("Key word to modify a string into a field", "capitalize")) val = \
val.left(1).toUpper() % val.right(val.length() - 1).toLower();
else if(op == i18nc("Key word to modify a string into a field", "trim")) \
val = val.trimmed(); else val = iValue;
}
@@ -266,10 +266,10 @@ bool SKGObjectBase::exist() const
SKGStringListList result;
QString wc = getWhereclauseId();
- if(wc.isEmpty() && d->id) wc = "id=" + SKGServices::intToString(d->id);
+ if(wc.isEmpty() && d->id) wc = "id=" % SKGServices::intToString(d->id);
if(wc.isEmpty()) return false;
- QString sql = "SELECT count(1) FROM " + d->table + " WHERE " + wc;
+ QString sql = "SELECT count(1) FROM " % d->table % " WHERE " % wc;
if(getDocument()) getDocument()->executeSelectSqliteOrder(sql, result);
return (result.size() >= 2 && result.at(1).at(0) != "0");
}
@@ -282,11 +282,11 @@ SKGError SKGObjectBase::load()
if(getDocument()) {
//Prepare where clause
QString wc = getWhereclauseId();
- if(wc.isEmpty()) wc = "id=" + SKGServices::intToString(d->id);
+ if(wc.isEmpty()) wc = "id=" % SKGServices::intToString(d->id);
//Execute sql order
SKGStringListList result;
- err = getDocument()->executeSelectSqliteOrder("SELECT * FROM " + d->table + \
" WHERE " + wc, result); + err = \
getDocument()->executeSelectSqliteOrder("SELECT * FROM " % d->table % " WHERE " % wc, \
result); if(err.isSucceeded()) {
int size = result.size();
if(size == 1) err = SKGError(ERR_INVALIDARG, i18nc("Error message: \
Could not load something because it is not in the database", "Load of '%1' with '%2' \
failed because it was not found in the database", d->table, wc)); @@ -309,7 +309,7 @@ \
SKGError SKGObjectBase::load() QString SKGObjectBase::getWhereclauseId() const
{
int id = getID();
- if(id != 0) return "id=" + SKGServices::intToString(id);
+ if(id != 0) return "id=" % SKGServices::intToString(id);
return "";
}
@@ -343,7 +343,7 @@ SKGError SKGObjectBase::save(bool iInsertOrUpdate, bool \
iReloadAfterSave) QString att = SKGServices::stringToSqlString(it.key());
QString attlower = att.toLower();
if(att.length() > 2 && att == attlower) { //We must ignore \
attributes coming from views
- QString value = '\'' + \
SKGServices::stringToSqlString(it.value()) + '\''; + QString value \
= '\'' % SKGServices::stringToSqlString(it.value()) % '\'';
if(!part1Insert.isEmpty()) {
part1Insert.append(',');
@@ -351,20 +351,20 @@ SKGError SKGObjectBase::save(bool iInsertOrUpdate, bool \
iReloadAfterSave) partUpdate.append(',');
}
//Attribute
- part1Insert.append('\'' + att + '\'');
+ part1Insert.append('\'' % att % '\'');
//Value
part2Insert.append(value);
//Attribute=Value for update
- partUpdate.append(att + '=' + value);
+ partUpdate.append(att % '=' % value);
}
}
//We try an Insert
if(d->id == 0) {
//We have to try un insert
- err = getDocument()->executeSqliteOrder("INSERT INTO " + tablename + \
" (" + part1Insert + ") VALUES (" + part2Insert + ')', &(d->id)); + \
err = getDocument()->executeSqliteOrder("INSERT INTO " % tablename % " (" % \
part1Insert % ") VALUES (" % part2Insert % ')', &(d->id)); } else {
//We must try an update
err = SKGError(ERR_ABORT, ""); //Just to go in UPDATE code
@@ -375,7 +375,7 @@ SKGError SKGObjectBase::save(bool iInsertOrUpdate, bool \
iReloadAfterSave) QString wc = this->getWhereclauseId();
if(!wc.isEmpty()) {
//Yes ==> Update
- err = getDocument()->executeSqliteOrder("UPDATE " + tablename + \
" SET " + partUpdate + " WHERE " + wc); + err = \
getDocument()->executeSqliteOrder("UPDATE " % tablename % " SET " % partUpdate % " \
WHERE " % wc); }
}
}
@@ -400,14 +400,14 @@ SKGError SKGObjectBase::remove(bool iSendMessage, bool iForce) \
const err = d->document->checkExistingTransaction();
//delete order
- QString viewForDelete = QString("v_") + getRealTable() + "_delete";
+ QString viewForDelete = QString("v_") % getRealTable() % "_delete";
//Check if the delete view exist
SKGStringListList temporaryResult;
- d->document->executeSelectSqliteOrder("PRAGMA table_info( " + viewForDelete \
+ " );", temporaryResult); + d->document->executeSelectSqliteOrder("PRAGMA \
table_info( " % viewForDelete % " );", temporaryResult);
if(!iForce && temporaryResult.count() > 1) { //At least one attribute
//Delete view exists, check if the delete is authorized
- err = d->document->executeSelectSqliteOrder("SELECT t_delete_message \
FROM " + viewForDelete + " WHERE id=" + SKGServices::intToString(d->id), \
temporaryResult); + err = d->document->executeSelectSqliteOrder("SELECT \
t_delete_message FROM " % viewForDelete % " WHERE id=" % \
SKGServices::intToString(d->id), temporaryResult); if(err.isSucceeded()) {
QString msg;
if(temporaryResult.count() > 1) msg = temporaryResult.at(1).at(0);
@@ -417,7 +417,7 @@ SKGError SKGObjectBase::remove(bool iSendMessage, bool iForce) \
const }
QString displayname = getDisplayName(); //Must be done before the delete \
order
- if(err.isSucceeded()) err = d->document->executeSqliteOrder("DELETE FROM " + \
getRealTable() + " WHERE id=" + SKGServices::intToString(d->id)); + \
if(err.isSucceeded()) err = d->document->executeSqliteOrder("DELETE FROM " % \
getRealTable() % " WHERE id=" % SKGServices::intToString(d->id)); if(iSendMessage && \
err.isSucceeded() && !displayname.isEmpty())
err = d->document->sendMessage(i18nc("An information to the user that \
something was deleted", "'%1' has been deleted", displayname), false); }
diff --git a/skgbasemodeler/skgpropertyobject.cpp \
b/skgbasemodeler/skgpropertyobject.cpp index 3580c04..173f20c 100644
--- a/skgbasemodeler/skgpropertyobject.cpp
+++ b/skgbasemodeler/skgpropertyobject.cpp
@@ -72,11 +72,11 @@ QString SKGPropertyObject::getWhereclauseId() const
QString output = SKGObjectBase::getWhereclauseId();
if(output.isEmpty()) {
if(!(getAttribute("t_name").isEmpty())) {
- output = "t_name='" + \
SKGServices::stringToSqlString(getAttribute("t_name")) + '\''; + output = \
"t_name='" % SKGServices::stringToSqlString(getAttribute("t_name")) % '\''; }
if(!(getAttribute("t_uuid_parent").isEmpty())) {
if(!output.isEmpty()) output += " AND ";
- output += "t_uuid_parent='" + getAttribute("t_uuid_parent") + '\'';
+ output += "t_uuid_parent='" % getAttribute("t_uuid_parent") % '\'';
}
}
return output;
diff --git a/skgbasemodeler/skgservices.cpp b/skgbasemodeler/skgservices.cpp
index cb8736b..7c8eb12 100644
--- a/skgbasemodeler/skgservices.cpp
+++ b/skgbasemodeler/skgservices.cpp
@@ -116,7 +116,7 @@ QString SKGServices::stringToCsv(const QString& iNumber)
QString output = iNumber;
output.replace('"', "#SKGDOUBLECOTE#");
output.replace("#SKGDOUBLECOTE#", "\"\"");
- output = '"' + output + '"';
+ output = '"' % output % '"';
return output;
}
@@ -422,15 +422,15 @@ QString SKGServices::dateToSqlString(const QString& iDate, \
const QString& iForma }
}
- if(MM.length() == 1) MM = '0' + MM;
- if(DD.length() == 1) DD = '0' + DD;
- if(YYYY.length() == 1) YYYY = '0' + YYYY;
+ if(MM.length() == 1) MM = '0' % MM;
+ if(DD.length() == 1) DD = '0' % DD;
+ if(YYYY.length() == 1) YYYY = '0' % YYYY;
if(YYYY.length() == 2) {
- if(stringToInt(YYYY) > 70) YYYY = "19" + YYYY;
- else YYYY = "20" + YYYY;
+ if(stringToInt(YYYY) > 70) YYYY = "19" % YYYY;
+ else YYYY = "20" % YYYY;
}
- QString date = YYYY + '-' + MM + '-' + DD;
+ QString date = YYYY % '-' % MM % '-' % DD;
date.replace(' ', '0');
return dateToSqlString(stringToTime(date));
}
@@ -485,7 +485,7 @@ QStringList SKGServices::tableToDump(const SKGStringListList& \
iTable, SKGService lineFormated += stringToCsv(s);
} else {
s = s.leftJustified(maxSizes[j], ' ');
- lineFormated += s + " | ";
+ lineFormated += s % " | ";
}
}
oResult.push_back(lineFormated);
@@ -553,9 +553,9 @@ SKGError SKGServices::cryptFile(const QString& iFileSource, const \
QString& iFile else {
//Read document
QByteArray input = fileInput.readAll();
- QByteArray h = (iHeaderFile + (!cipher ? "_DECRYPTED-" : \
"_ENCRYPTED-")).toLatin1(); + QByteArray h = (iHeaderFile % (!cipher ? \
"_DECRYPTED-" : "_ENCRYPTED-")).toLatin1(); //BUG 249955 vvv
- if(!cipher && input.startsWith(QByteArray((iHeaderFile + \
"_ENCRYPTED-").toLatin1()))) err = SKGError(ERR_UNEXPECTED, i18nc("Error message \
about encrypting a file", "Encryption failed")); + if(!cipher && \
input.startsWith(QByteArray((iHeaderFile % "_ENCRYPTED-").toLatin1()))) err = \
SKGError(ERR_UNEXPECTED, i18nc("Error message about encrypting a file", "Encryption \
failed")); //BUG 249955 ^^^
if(!iEncrypt && h.count() && input.startsWith(h)) input = \
input.right(input.length() - h.length());
@@ -634,7 +634,7 @@ SKGError SKGServices::copySqliteDatabaseToXml(QSqlDatabase* iDb, \
QDomDocument& o table.setAttribute("name", tableName);
SKGStringListList listRows;
- err = SKGServices::executeSelectSqliteOrder(iDb, "SELECT * FROM " + \
tableName, listRows); + err = SKGServices::executeSelectSqliteOrder(iDb, \
"SELECT * FROM " % tableName, listRows); int nbRows = listRows.count();
if(nbRows) {
QStringList titles = listRows.at(0);
@@ -683,7 +683,7 @@ SKGError SKGServices::copySqliteDatabase(QSqlDatabase* iFileDb, \
QSqlDatabase* iM //Attach db
if(err.isSucceeded()) {
SKGTRACEINRC(10, "SKGServices::copySqliteDatabase-ATTACH", err);
- err = SKGServices::executeSqliteOrder(iMemoryDb, "ATTACH DATABASE '" + \
dbFileName + "' as source"); + err = \
SKGServices::executeSqliteOrder(iMemoryDb, "ATTACH DATABASE '" % dbFileName % "' as \
source"); }
//Copy records
@@ -693,8 +693,8 @@ SKGError SKGServices::copySqliteDatabase(QSqlDatabase* iFileDb, \
QSqlDatabase* iM if(err.isSucceeded()) {
for(int i = 1; err.isSucceeded() && i < nb; ++i) { //Forget header
QString val = listTables.at(i).at(1);
- if(iFromFileToMemory) err = \
SKGServices::executeSqliteOrder(iMemoryDb, "insert into main." + val + " select * \
from source." + val);
- else err = SKGServices::executeSqliteOrder(iMemoryDb, "insert \
into source." + val + " select * from main." + val); + \
if(iFromFileToMemory) err = SKGServices::executeSqliteOrder(iMemoryDb, "insert into \
main." % val % " select * from source." % val); + else err = \
SKGServices::executeSqliteOrder(iMemoryDb, "insert into source." % val % " select * \
from main." % val); }
}
@@ -857,7 +857,7 @@ SKGError SKGServices::dumpSelectSqliteOrder(QSqlDatabase* iDb, \
const QString& iS //dump
int nb = oResultTmp.size();
for(int i = 0; i < nb; ++i) {
- oResult += oResultTmp.at(i) + '\n';
+ oResult += oResultTmp.at(i) % '\n';
}
}
return err;
diff --git a/skgbasemodeler/skgtraces.cpp b/skgbasemodeler/skgtraces.cpp
index 0c609e9..516e6ac 100644
--- a/skgbasemodeler/skgtraces.cpp
+++ b/skgbasemodeler/skgtraces.cpp
@@ -32,12 +32,12 @@
* To generate a colorized string
*/
#define COLORED(TEXT) \
- "\x1b[3"+QString::number(1+(((SKGTraces::SKGIndentTrace.count()-2)/2)%7))+'m'+TEXT+"\x1b[39m"
+ "\x1b[3"%QString::number(1+(((SKGTraces::SKGIndentTrace.count()-2)/2)%7))%'m'%TEXT%"\x1b[39m"
/**
* To generate a red string
*/
#define COLOREDRED(TEXT) \
- QString("\x1b[31m")+TEXT+"\x1b[39m"
+ QString("\x1b[31m")%TEXT%"\x1b[39m"
//===================================================================
int SKGTraces::SKGLevelTrace = \
SKGServices::stringToInt(SKGServices::getenv("SKGTRACE")); @@ -55,7 +55,7 @@ \
SKGTraces::SKGTraces(int iLevel, const QString& iName, SKGError* iRC) m_rc = iRC;
SKGIndentTrace += " ";
- SKGTRACE << COLORED('>' + m_mame) << endl;
+ SKGTRACE << COLORED('>' % m_mame) << endl;
}
else m_output = false;
@@ -114,9 +114,9 @@ SKGTraces::~SKGTraces()
}
if(m_output) {
- SKGTRACESUITE << SKGTraces::SKGIndentTrace << COLORED('<' + m_mame);
+ SKGTRACESUITE << SKGTraces::SKGIndentTrace << COLORED('<' % m_mame);
if(m_rc) {
- SKGTRACESUITE << (m_rc->isSucceeded() ? QString(COLORED(QString(" RC=" + \
m_rc->getFullMessage()))) : QString(COLOREDRED(QString(" RC=" + \
m_rc->getFullMessage())))); + SKGTRACESUITE << (m_rc->isSucceeded() ? \
QString(COLORED(" RC=" % m_rc->getFullMessage())) : QString(COLOREDRED(" RC=" % \
m_rc->getFullMessage()))); }
if(m_profiling) {
SKGTRACESUITE << " TIME=" << m_elapse << " ms";
@@ -192,13 +192,13 @@ QStringList SKGTraces::getProfilingStatistics()
//dump max
if(maxtime != -1) {
output.push_back(max.key()
- + " , " + \
SKGServices::intToString(max.value().NbCall)
- + " , " + \
SKGServices::doubleToString(max.value().Time)
- + " , " + \
SKGServices::doubleToString((max.value().Time) / \
(static_cast<double>(max.value().NbCall)))
- + " , " + \
SKGServices::doubleToString(max.value().TimeMin)
- + " , " + \
SKGServices::doubleToString(max.value().TimeMax)
- + " , " + \
SKGServices::doubleToString(max.value().TimePropre)
- + " , " + \
SKGServices::doubleToString((max.value().TimePropre) / \
(static_cast<double>(max.value().NbCall)))); + % " , \
" % SKGServices::intToString(max.value().NbCall) + % \
" , " % SKGServices::doubleToString(max.value().Time) + \
% " , " % SKGServices::doubleToString((max.value().Time) / \
(static_cast<double>(max.value().NbCall))) + % " , " \
% SKGServices::doubleToString(max.value().TimeMin) + \
% " , " % SKGServices::doubleToString(max.value().TimeMax) + \
% " , " % SKGServices::doubleToString(max.value().TimePropre) + \
% " , " % SKGServices::doubleToString((max.value().TimePropre) / \
(static_cast<double>(max.value().NbCall))));
//Remove it
SKGPerfoMethodeCopy.erase(max);
diff --git a/skgbasemodelertest/skgtestbase.cpp b/skgbasemodelertest/skgtestbase.cpp
index 30fb193..2f8a1b8 100644
--- a/skgbasemodelertest/skgtestbase.cpp
+++ b/skgbasemodelertest/skgtestbase.cpp
@@ -215,7 +215,7 @@ int main(int argc, char** argv)
SKGTEST("STR:stringToHtml", SKGServices::stringToHtml("<hello>&<world>"), \
"<hello>&<world>");
SKGTEST("STR:htmlToString", \
SKGServices::htmlToString("<hello>&<world>"), "<hello>&<world>");
- parameters = SKGServices::splitCSVLine(SKGServices::stringToCsv("Y") + ';' + \
SKGServices::stringToCsv("A;B")); + parameters = \
SKGServices::splitCSVLine(SKGServices::stringToCsv("Y") % ';' % \
SKGServices::stringToCsv("A;B")); SKGTEST("STR:splitCSVLine count", \
parameters.count(), 2); SKGTEST("STR:splitCSVLine", parameters[0], "Y");
SKGTEST("STR:splitCSVLine", parameters[1], "A;B");
diff --git a/skgbasemodelertest/skgtestfile.cpp b/skgbasemodelertest/skgtestfile.cpp
index df41df9..de2e4d5 100644
--- a/skgbasemodelertest/skgtestfile.cpp
+++ b/skgbasemodelertest/skgtestfile.cpp
@@ -36,7 +36,7 @@ int main(int argc, char** argv)
SKGINITTEST(true);
{
//test class SKGDocument / LOAD / SAVE
- QString filename1 = getTestPath("IN") + \
QString::fromUtf8("/filename1_e.skg"); + QString filename1 = getTestPath("IN") \
% QString::fromUtf8("/filename1_e.skg"); qDebug("filename1=%s", \
filename1.toUtf8().constData()); {
SKGDocument document1;
diff --git a/skgbasemodelertest/skgtestmacro.h b/skgbasemodelertest/skgtestmacro.h
index 13ae195..b687aab 100644
--- a/skgbasemodelertest/skgtestmacro.h
+++ b/skgbasemodelertest/skgtestmacro.h
@@ -43,7 +43,7 @@ QString getTestPath(const QString& iPath)
{
QString pPath = SKGServices::getenv(iPath);
if(pPath.isEmpty()) {
- return QString("./tests/") + (iPath == "IN" ? "input" : (iPath == "OUT" ? \
"output" : "ref")); + return QString("./tests/") % (iPath == "IN" ? "input" : \
(iPath == "OUT" ? "output" : "ref")); }
return pPath;
}
@@ -55,11 +55,11 @@ QString getTestPath(const QString& iPath)
#ifndef Q_OS_WIN
#define SKGINITTEST(SHOWERRONLY) \
setenv("LC_ALL", "C", 1); \
- setenv("KDEHOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test") ), 1); \
- setenv("XDG_DATA_HOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test/xdg/local") ), 1); \
- setenv("XDG_CONFIG_HOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test/xdg/config") ), 1); \ + setenv("KDEHOME", \
QFile::encodeName( QDir::homePath() % QLatin1String("/.kde-unit-test") ), 1); \ + \
setenv("XDG_DATA_HOME", QFile::encodeName( QDir::homePath() % \
QLatin1String("/.kde-unit-test/xdg/local") ), 1); \ + setenv("XDG_CONFIG_HOME", \
QFile::encodeName( QDir::homePath() % QLatin1String("/.kde-unit-test/xdg/config") ), \
1); \ unsetenv("KDE_COLOR_DEBUG"); \
- QFile::remove(QDir::homePath() + \
QLatin1String("/.kde-unit-test/share/config/qttestrc")); \ + \
QFile::remove(QDir::homePath() % \
QLatin1String("/.kde-unit-test/share/config/qttestrc")); \ QCoreApplication app( \
argc, argv); \ app.setApplicationName( QLatin1String("qttest") ); \
SKGTRACESEPARATOR; \
@@ -71,11 +71,11 @@ QString getTestPath(const QString& iPath)
#else
#define SKGINITTEST(SHOWERRONLY) \
qputenv("LC_ALL", "C"); \
- qputenv("KDEHOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test") )); \
- qputenv("XDG_DATA_HOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test/xdg/local") )); \
- qputenv("XDG_CONFIG_HOME", QFile::encodeName( QDir::homePath() + \
QLatin1String("/.kde-unit-test/xdg/config") )); \ + qputenv("KDEHOME", \
QFile::encodeName( QDir::homePath() % QLatin1String("/.kde-unit-test") )); \ + \
qputenv("XDG_DATA_HOME", QFile::encodeName( QDir::homePath() % \
QLatin1String("/.kde-unit-test/xdg/local") )); \ + qputenv("XDG_CONFIG_HOME", \
QFile::encodeName( QDir::homePath() % QLatin1String("/.kde-unit-test/xdg/config") )); \
\ qputenv("KDE_COLOR_DEBUG", ""); \
- QFile::remove(QDir::homePath() + \
QLatin1String("/.kde-unit-test/share/config/qttestrc")); \ + \
QFile::remove(QDir::homePath() % \
QLatin1String("/.kde-unit-test/share/config/qttestrc")); \ QCoreApplication app( \
argc, argv); \ app.setApplicationName( QLatin1String("qttest") ); \
SKGTRACESEPARATOR; \
diff --git a/skgbasemodelertest/skgtestnodes.cpp \
b/skgbasemodelertest/skgtestnodes.cpp index 5006e94..fa97786 100644
--- a/skgbasemodelertest/skgtestnodes.cpp
+++ b/skgbasemodelertest/skgtestnodes.cpp
@@ -49,7 +49,7 @@ int main(int argc, char** argv)
//Create node 0
SKGNodeObject nod0(&document1);
- SKGTESTERROR("NOD:setName+invalid name", nod0.setName('a' + \
OBJECTSEPARATOR + 'b'), false); + SKGTESTERROR("NOD:setName+invalid name", \
nod0.setName('a' % OBJECTSEPARATOR % 'b'), false); SKGTESTERROR("NOD:save", \
nod0.save(), false);
//Create node 1
@@ -69,7 +69,7 @@ int main(int argc, char** argv)
nod1.getIcon();
//Update with bad name
- SKGTESTERROR("NOD:setName", nod1.setName("root1" + OBJECTSEPARATOR + \
'A'), false); + SKGTESTERROR("NOD:setName", nod1.setName("root1" % \
OBJECTSEPARATOR % 'A'), false); SKGTESTERROR("NOD:load", nod1.load(), true);
SKGTEST("NOD:getFullName", nod1.getFullName(), "root1");
@@ -79,12 +79,12 @@ int main(int argc, char** argv)
SKGTESTERROR("NOD:setName", nod1_1.setName("nod1"), true);
SKGTESTERROR("NOD:setOrder", nod1_1.setOrder(1), true);
SKGTESTERROR("NOD:save", nod1_1.save(), true);
- SKGTEST("NOD:getFullName", nod1_1.getFullName(), "root1" + \
OBJECTSEPARATOR + "nod1"); + SKGTEST("NOD:getFullName", \
nod1_1.getFullName(), "root1" % OBJECTSEPARATOR % "nod1");
//Update nod1_1
SKGTESTERROR("NOD:setName", nod1_1.setName("NODE1"), true);
SKGTESTERROR("NOD:save", nod1_1.save(), true);
- SKGTEST("NOD:getFullName", nod1_1.getFullName(), "root1" + \
OBJECTSEPARATOR + "NODE1"); + SKGTEST("NOD:getFullName", \
nod1_1.getFullName(), "root1" % OBJECTSEPARATOR % "NODE1");
//Update nod1
SKGTESTERROR("NOD:setName", nod1.setName("ROOT1"), true);
@@ -92,7 +92,7 @@ int main(int argc, char** argv)
SKGTEST("NOD:getFullName", nod1.getFullName(), "ROOT1");
SKGTESTERROR("NOD:load", nod1_1.load(), true);
- SKGTEST("NOD:getFullName", nod1_1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "NODE1"); + SKGTEST("NOD:getFullName", \
nod1_1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE1");
//Create node 1.2
SKGNodeObject nod1_2;
@@ -100,7 +100,7 @@ int main(int argc, char** argv)
SKGTESTERROR("NOD:setName", nod1_2.setName("NODE2"), true);
SKGTESTERROR("NOD:setOrder", nod1_2.setOrder(2), true);
SKGTESTERROR("NOD:save", nod1_2.save(), true);
- SKGTEST("NOD:getFullName", nod1_2.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "NODE2"); + SKGTEST("NOD:getFullName", \
nod1_2.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE2"); SKGTEST("NOD:<", (nod1_1 \
< nod1_2), true); SKGTEST("NOD:>", (nod1_1 > nod1_2), false);
SKGTEST("NOD:<", (nod1_1 < nod1_1), false);
@@ -111,25 +111,25 @@ int main(int argc, char** argv)
SKGTESTERROR("NOD:addNode", nod1_1.addNode(end1), true);
SKGTESTERROR("NOD:setName", end1.setName("END"), true);
SKGTESTERROR("NOD:save", end1.save(), true);
- SKGTEST("NOD:getFullName", end1.getFullName(), "ROOT1" + OBJECTSEPARATOR \
+ "NODE1" + OBJECTSEPARATOR + "END"); + SKGTEST("NOD:getFullName", \
end1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE1" % OBJECTSEPARATOR % "END");
//Create node end
SKGNodeObject end2;
SKGTESTERROR("NOD:addNode", nod1_2.addNode(end2), true);
SKGTESTERROR("NOD:setName", end2.setName("END"), true);
SKGTESTERROR("NOD:save", end2.save(), true);
- SKGTEST("NOD:getFullName", end2.getFullName(), "ROOT1" + OBJECTSEPARATOR \
+ "NODE2" + OBJECTSEPARATOR + "END"); + SKGTEST("NOD:getFullName", \
end2.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE2" % OBJECTSEPARATOR % "END");
SKGNodeObject end2_1;
SKGTESTERROR("NOD:addNode", end2.addNode(end2_1), true);
SKGTESTERROR("NOD:setName", end2_1.setName("REALEND"), true);
SKGTESTERROR("NOD:save", end2_1.save(), true);
- SKGTEST("NOD:getFullName", end2_1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "NODE2" + OBJECTSEPARATOR + "END" + OBJECTSEPARATOR + "REALEND"); + \
SKGTEST("NOD:getFullName", end2_1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE2" \
% OBJECTSEPARATOR % "END" % OBJECTSEPARATOR % "REALEND");
//Get parent
SKGNodeObject parent1;
SKGTESTERROR("NOD:addNode", end2.getParentNode(parent1), true);
- SKGTEST("NOD:getFullName", parent1.getFullName(), "ROOT1" + \
OBJECTSEPARATOR + "NODE2"); + SKGTEST("NOD:getFullName", \
parent1.getFullName(), "ROOT1" % OBJECTSEPARATOR % "NODE2");
//Get parent
SKGTESTERROR("NOD:addNode", parent1.getParentNode(parent2), true);
@@ -147,10 +147,10 @@ int main(int argc, char** argv)
SKGTEST("NOD:oResult.size", oResult.size(), 5);
SKGNodeObject nodeROOT1BC;
- SKGTESTERROR("NOD:addNode", SKGNodeObject::createPathNode(&document1, \
"ROOT1" + OBJECTSEPARATOR + 'B' + OBJECTSEPARATOR + 'C', nodeROOT1BC), true); + \
SKGTESTERROR("NOD:addNode", SKGNodeObject::createPathNode(&document1, "ROOT1" % \
OBJECTSEPARATOR % 'B' % OBJECTSEPARATOR % 'C', nodeROOT1BC), true);
SKGNodeObject nodeROOT1DE;
- SKGTESTERROR("NOD:addNode", SKGNodeObject::createPathNode(&document1, \
"ROOT1" + OBJECTSEPARATOR + 'D' + OBJECTSEPARATOR + 'E', nodeROOT1DE), true); + \
SKGTESTERROR("NOD:addNode", SKGNodeObject::createPathNode(&document1, "ROOT1" % \
OBJECTSEPARATOR % 'D' % OBJECTSEPARATOR % 'E', nodeROOT1DE), true); }
{
//Scope of the transaction
@@ -192,9 +192,9 @@ int main(int argc, char** argv)
SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGNodeObject node;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + "B1" + \
OBJECTSEPARATOR + 'C', node), true);
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + "B1" + \
OBJECTSEPARATOR + 'D', node), true);
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + "B2" + \
OBJECTSEPARATOR + 'E', node), true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % "B1" % \
OBJECTSEPARATOR % 'C', node), true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % "B1" % \
OBJECTSEPARATOR % 'D', node), true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % "B2" % \
OBJECTSEPARATOR % 'E', node), true); QStringList oResult;
SKGTESTERROR("NOD:getDistinctValues", \
document1.getDistinctValues("node", "id", oResult), true); \
SKGTEST("NOD:oResult.size", oResult.size(), 6); @@ -210,8 +210,8 @@ int main(int \
argc, char** argv) SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGNodeObject node;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + "B1" + \
OBJECTSEPARATOR + 'C', node), true);
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + "B2" + \
OBJECTSEPARATOR + 'C', node), true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % "B1" % \
OBJECTSEPARATOR % 'C', node), true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % "B2" % \
OBJECTSEPARATOR % 'C', node), true); QStringList oResult;
SKGTESTERROR("NOD:getDistinctValues", \
document1.getDistinctValues("node", "id", oResult), true); \
SKGTEST("NOD:oResult.size", oResult.size(), 5); @@ -227,7 +227,7 @@ int main(int \
argc, char** argv) SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGNodeObject node;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + 'A', node), true); \
+ SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % 'A', node), true); \
QStringList oResult;
SKGTESTERROR("NOD:getDistinctValues", \
document1.getDistinctValues("node", "id", oResult), true); \
SKGTEST("NOD:oResult.size", oResult.size(), 2); @@ -243,7 +243,7 @@ int main(int \
argc, char** argv) SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGNodeObject nodeB;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + 'B', nodeB), true); \
+ SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % 'B', nodeB), true); \
SKGNodeObject nodeC;
SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, "C", nodeC), true); SKGNodeObject nodeA;
@@ -269,9 +269,9 @@ int main(int argc, char** argv)
SKGBEGINTRANSACTION(document1, "NODE_T1", err);
SKGNodeObject nodeB1;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + 'B', nodeB1, true), \
true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % 'B', nodeB1, true), \
true); SKGNodeObject nodeB2;
- SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' + OBJECTSEPARATOR + 'B', nodeB2, true), \
true); + SKGTESTERROR("NOD:createPathNode", \
SKGNodeObject::createPathNode(&document1, 'A' % OBJECTSEPARATOR % 'B', nodeB2, true), \
true); document1.dump(DUMPALL);
QStringList oResult;
diff --git a/skgbasemodelertest/skgtestpassword.cpp \
b/skgbasemodelertest/skgtestpassword.cpp index 257dd54..c8cb78e 100644
--- a/skgbasemodelertest/skgtestpassword.cpp
+++ b/skgbasemodelertest/skgtestpassword.cpp
@@ -33,9 +33,9 @@ int main(int argc, char** argv)
//Init test
SKGINITTEST(true);
- QString filenameInput1 = getTestPath("IN") + "/all_plugins.skg";
- QString filenameOutput1 = getTestPath("OUT") + "/all_plugins_encrypted.skg";
- QString filenameOutput2 = getTestPath("OUT") + "/all_plugins_decrypted.skg";
+ QString filenameInput1 = getTestPath("IN") % "/all_plugins.skg";
+ QString filenameOutput1 = getTestPath("OUT") % "/all_plugins_encrypted.skg";
+ QString filenameOutput2 = getTestPath("OUT") % "/all_plugins_decrypted.skg";
SKGTESTERROR("DOC:cryptFile", SKGServices::cryptFile("notfound", \
filenameOutput1, "password"), false);
SKGTESTERROR("DOC:cryptFile", SKGServices::cryptFile(filenameInput1, \
filenameOutput1, "password"), true);
diff --git a/skgbasemodelertest/skgtesttransaction.cpp \
b/skgbasemodelertest/skgtesttransaction.cpp index 7d24af1..2840ee9 100644
--- a/skgbasemodelertest/skgtesttransaction.cpp
+++ b/skgbasemodelertest/skgtesttransaction.cpp
@@ -501,7 +501,7 @@ int main(int argc, char** argv)
SKGTESTERROR("GROUP.setParameter", document1.setParameter("ATT", "VAL2"), \
true);
SKGTESTERROR("GROUP.endTransaction", document1.endTransaction(true), true);
- QString filename1 = getTestPath("OUT") + "/filename1.skg";
+ QString filename1 = getTestPath("OUT") % "/filename1.skg";
SKGTESTERROR("GROUP.saveAs", document1.saveAs(filename1, true), true);
SKGTESTERROR("GROUP.beginTransaction", document1.beginTransaction("T3"), \
true); @@ -533,7 +533,7 @@ int main(int argc, char** argv)
SKGTESTERROR("ERROR.groupTransactions", document1.groupTransactions(1, 1), \
false); //Not authorized into a transaction
SKGTESTERROR("ERROR.undoRedoTransaction", \
document1.undoRedoTransaction(SKGDocument::UNDO), false); //Not authorized into a \
transaction
- SKGTESTERROR("ERROR.saveAs", document1.saveAs(getTestPath("OUT") + \
"/filename1.skg", true), false); //Not authorized into a transaction + \
SKGTESTERROR("ERROR.saveAs", document1.saveAs(getTestPath("OUT") % "/filename1.skg", \
true), false); //Not authorized into a transaction
SKGTESTERROR("ERROR.endTransaction", document1.endTransaction(true), true);
}
@@ -574,7 +574,7 @@ int main(int argc, char** argv)
SKGTEST("CLEAN.getNbTransaction", \
document1.getNbTransaction(SKGDocument::UNDO), 2);
- QString filename1 = getTestPath("OUT") + "/filename1.skg";
+ QString filename1 = getTestPath("OUT") % "/filename1.skg";
SKGTESTERROR("CLEAN.saveAs", document1.saveAs(filename1, true), true);
SKGTEST("CLEAN.getNbTransaction", \
document1.getNbTransaction(SKGDocument::UNDO), 0); }
diff --git a/skrooge_bank/skgaccountboardwidget.cpp \
b/skrooge_bank/skgaccountboardwidget.cpp index 78260c7..fd4f2b7 100644
--- a/skrooge_bank/skgaccountboardwidget.cpp
+++ b/skrooge_bank/skgaccountboardwidget.cpp
@@ -163,7 +163,7 @@ void SKGAccountBoardWidget::dataModified(const QString& \
iTableName, int iIdTrans if(err.isSucceeded()) {
QString html;
if(!exist) {
- html = "<html><body>" + i18nc("Message", "First, you have to \
create at least one account<br>from <a href=\"___\">\"Bank and Account\"</a> page or \
<a href=\"__I\">import</a> operations.") + "</body></html>"; + \
html = "<html><body>" % i18nc("Message", "First, you have to create at least one \
account<br>from <a href=\"___\">\"Bank and Account\"</a> page or <a \
href=\"__I\">import</a> operations.") % "</body></html>"; } else {
//Build where clause
QString wc;
@@ -193,13 +193,13 @@ void SKGAccountBoardWidget::dataModified(const QString& \
iTableName, int iIdTrans
if(wc.isEmpty()) wc = "1=0";
else if(m_menuFavorite && m_menuFavorite->isChecked()) {
- wc = "t_bookmarked='Y' AND (" + wc + ')';
+ wc = "t_bookmarked='Y' AND (" % wc % ')';
}
//Build display
SKGStringListList listTmp;
err = doc->executeSelectSqliteOrder(
- QString("SELECT t_name, t_TYPENLS, ") + \
(m_menuPastOperations && m_menuPastOperations->isChecked() ? "f_TODAYAMOUNT" : \
"f_CURRENTAMOUNT") + ", t_close from v_account_display WHERE (" + wc + ") ORDER BY \
t_TYPENLS, t_name", + QString("SELECT t_name, t_TYPENLS, \
") % (m_menuPastOperations && m_menuPastOperations->isChecked() ? "f_TODAYAMOUNT" : \
"f_CURRENTAMOUNT") % ", t_close from v_account_display WHERE (" % wc % ") ORDER BY \
t_TYPENLS, t_name", listTmp);
if(err.isSucceeded()) {
html += "<html><body><table>";
@@ -216,8 +216,8 @@ void SKGAccountBoardWidget::dataModified(const QString& \
iTableName, int iIdTrans
if(type != currentType) {
if(!currentType.isEmpty()) {
- html += "<tr><td><b>" + \
SKGServices::stringToHtml(i18nc("the numerical total of a sum of values", "Total of \
%1", currentType)) + "</b></td>"
- "<td align=\"right\"><b>" + \
doc->formatMoney(sumTypeV1, primary) + "</b></td></tr>"; + \
html += "<tr><td><b>" % SKGServices::stringToHtml(i18nc("the numerical total of a sum \
of values", "Total of %1", currentType)) % "</b></td>" + \
"<td align=\"right\"><b>" % doc->formatMoney(sumTypeV1, primary) % "</b></td></tr>"; \
sumTypeV1 = 0; }
currentType = type;
@@ -231,8 +231,8 @@ void SKGAccountBoardWidget::dataModified(const QString& \
iTableName, int iIdTrans account.getUnit(unitAccount);
QString unitAccountSymbol = unitAccount.getSymbol();
- html += QString("<tr><td><a href=\"" + \
SKGServices::stringToHtml(name) + "\">") + (closed ? "<i>" : "") + \
SKGServices::stringToHtml(name) + (closed ? "</i>" : "") + \
"</a></td>"
- "<td align=\"right\"><font color=\"" + (v1 < \
0 ? "red" : "black") + "\">"; + html += \
QString("<tr><td><a href=\"" % SKGServices::stringToHtml(name) % "\">") % (closed ? \
"<i>" : "") % SKGServices::stringToHtml(name) % (closed ? "</i>" : "") % "</a></td>" \
+ "<td align=\"right\"><font color=\"" % (v1 < \
0 ? "red" : "black") % "\">";
if(!unitAccountSymbol.isEmpty() && primary.Symbol != \
unitAccountSymbol) {
double unitAccountValue = \
SKGServices::stringToDouble(unitAccount.getAttribute("f_CURRENTAMOUNT")); @@ -247,13 \
+247,13 @@ void SKGAccountBoardWidget::dataModified(const QString& iTableName, int \
iIdTrans }
if(!currentType.isEmpty()) {
- html += "<tr><td><b>" + \
SKGServices::stringToHtml(i18nc("the numerical total of a sum of values", "Total of \
%1", currentType)) + "</b></td>"
- "<td align=\"right\"><b>" + \
doc->formatMoney(sumTypeV1, primary) + "</b></td>" + html \
+= "<tr><td><b>" % SKGServices::stringToHtml(i18nc("the numerical total of a sum of \
values", "Total of %1", currentType)) % "</b></td>" + \
"<td align=\"right\"><b>" % doc->formatMoney(sumTypeV1, primary) % "</b></td>" \
"</tr>"; }
- html += "<tr><td><b><a href=\"" + \
SKGServices::stringToHtml(i18nc("Noun, all items in a list", "All")) \
+
- "\">" + SKGServices::stringToHtml(i18nc("Noun, the \
numerical total of a sum of values", "Total")) + "</a></b></td>"
- "<td align=\"right\"><b>" + doc->formatMoney(sumV1, \
primary) + "</b></td>" + html += "<tr><td><b><a href=\"" % \
SKGServices::stringToHtml(i18nc("Noun, all items in a list", "All")) % + \
"\">" % SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of \
values", "Total")) % "</a></b></td>" + "<td \
align=\"right\"><b>" % doc->formatMoney(sumV1, primary) % "</b></td>" "</tr>";
html += "</table></body></html>";
}
diff --git a/skrooge_bank/skgbankboardwidget.cpp \
b/skrooge_bank/skgbankboardwidget.cpp index 0a46a94..d042b9b 100644
--- a/skrooge_bank/skgbankboardwidget.cpp
+++ b/skrooge_bank/skgbankboardwidget.cpp
@@ -64,7 +64,7 @@ void SKGBankBoardWidget::dataModified(const QString& iTableName, \
int iIdTransact if(err.isSucceeded()) {
QString html;
if(!exist) {
- html = "<html><body>" + i18nc("Message", "First, you have to \
create at least one account<br>from <a href=\"___\">\"Bank and Account\"</a> page or \
<a href=\"__I\">import</a> operations.") + "</body></html>"; + \
html = "<html><body>" % i18nc("Message", "First, you have to create at least one \
account<br>from <a href=\"___\">\"Bank and Account\"</a> page or <a \
href=\"__I\">import</a> operations.") % "</body></html>"; } else {
//Build display
SKGStringListList listTmp;
@@ -79,16 +79,16 @@ void SKGBankBoardWidget::dataModified(const QString& iTableName, \
int iIdTransact QString name = listTmp.at(i).at(0);
double v1 = \
SKGServices::stringToDouble(listTmp.at(i).at(1)); if(abs(v1) > 0.1) {
- html += QString("<tr><td>") + \
SKGServices::stringToHtml(name) + "</td>"
- "<td align=\"right\"><font color=\"" + (v1 < \
0 ? "red" : "black") + "\">"; + html += \
QString("<tr><td>") % SKGServices::stringToHtml(name) % "</td>" + \
"<td align=\"right\"><font color=\"" % (v1 < 0 ? "red" : "black") % \
"\">";
html += \
SKGServices::stringToHtml(locale->formatMoney(v1, primary.Symbol, \
primary.NbDecimal)); html += "</font></td></tr>";
sumV1 += v1;
}
}
- html += "<tr><td><b>" + \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) + "</b></td>"
- "<td align=\"right\"><b>" + doc->formatMoney(sumV1, \
primary) + "</b></td>" + html += "<tr><td><b>" % \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) % "</b></td>" + "<td align=\"right\"><b>" % \
doc->formatMoney(sumV1, primary) % "</b></td>" "</tr>";
html += "</table></html>";
}
diff --git a/skrooge_bank/skgbankplugin.cpp b/skrooge_bank/skgbankplugin.cpp
index 2ceccef..60e6021 100644
--- a/skrooge_bank/skgbankplugin.cpp
+++ b/skrooge_bank/skgbankplugin.cpp
@@ -210,7 +210,7 @@ QList< SKGInterfacePlugin::SKGAdvice > SKGBankPlugin::advices() \
const QString bank = line.at(0);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgbankplugin_withoutaccount|" + bank;
+ ad.uuid = "skgbankplugin_withoutaccount|" % bank;
ad.priority = 3;
ad.shortMessage = i18nc("A bank is in the list of used banks, but it doesn't \
have any account attached", "Bank '%1' has no account", bank);
ad.longMessage = i18nc("User can delete banks with no accounts", "Don't \
forget to remove useless banks");
diff --git a/skrooge_bank/skgbankpluginwidget.cpp \
b/skrooge_bank/skgbankpluginwidget.cpp index 3b2c498..5efaa9d 100644
--- a/skrooge_bank/skgbankpluginwidget.cpp
+++ b/skrooge_bank/skgbankpluginwidget.cpp
@@ -100,7 +100,7 @@ SKGBankPluginWidget::SKGBankPluginWidget(SKGDocumentBank* \
iDocument)
connect(ui.kView->getView(), SIGNAL(selectionChangedDelayed()), this, \
SLOT(onSelectionChanged()));
//Search file list
- QString listIconFile = KStandardDirs::locate("data", "skrooge/images/logo/l10n/" \
+ KGlobal::locale()->country() + "/list_bank.txt"); + QString listIconFile = \
KStandardDirs::locate("data", "skrooge/images/logo/l10n/" % \
KGlobal::locale()->country() % "/list_bank.txt");
if(listIconFile.isEmpty()) listIconFile = KStandardDirs::locate("data", \
"skrooge/images/logo/list_bank.txt");
//Logo for banks
@@ -298,7 +298,7 @@ void SKGBankPluginWidget::onAddAccountClicked()
QString bankName = ui.kAccountCreatorBank->text();
QString accountName = ui.kAccountCreatorAccount->text();
- QString name = bankName + '-' + accountName;
+ QString name = bankName % '-' % accountName;
SKGAccountObject::AccountType accountType = \
(SKGAccountObject::AccountType)(ui.kAccountCreatorType->itemData(ui.kAccountCreatorType->currentIndex()).toInt());
if(accountType == SKGAccountObject::WALLET) bankName = "";
{
@@ -312,7 +312,7 @@ void SKGBankPluginWidget::onAddAccountClicked()
QString icon = ui.kAccountCreatorIcon->currentText();
if(!QFile(icon).exists() && !icon.isEmpty()) {
QString code = \
ui.kAccountCreatorIcon->itemData(ui.kAccountCreatorIcon->currentIndex()).toString();
- if(!code.isEmpty()) icon += " " + code;
+ if(!code.isEmpty()) icon += " " % code;
icon.replace(' ', '_');
icon += ".png";
@@ -435,7 +435,7 @@ void SKGBankPluginWidget::onModifyAccountClicked()
QString icon = ui.kAccountCreatorIcon->currentText();
if(!QFile(icon).exists() && !icon.isEmpty()) {
QString code = \
ui.kAccountCreatorIcon->itemData(ui.kAccountCreatorIcon->currentIndex()).toString();
- if(!code.isEmpty()) icon += " " + code;
+ if(!code.isEmpty()) icon += " " % code;
icon.replace(' ', '_');
icon += ".png";
}
diff --git a/skrooge_budget/skgbudgetplugin.cpp b/skrooge_budget/skgbudgetplugin.cpp
index 6795a89..88229ab 100644
--- a/skrooge_budget/skgbudgetplugin.cpp
+++ b/skrooge_budget/skgbudgetplugin.cpp
@@ -121,7 +121,7 @@ QList< SKGInterfacePlugin::SKGAdvice > SKGBudgetPlugin::advices() \
const
//Alarms
SKGObjectBase::SKGListSKGObjectBase budgets;
- SKGError err = m_currentBankDocument->getObjects("v_budget", \
"f_CURRENTAMOUNT/f_budgeted_modified>0.8 AND f_CURRENTAMOUNT!=f_budgeted_modified AND \
f_budgeted_modified<0 AND (t_PERIOD='" + month + "' OR t_PERIOD='" + year + "');", \
budgets); + SKGError err = m_currentBankDocument->getObjects("v_budget", \
"f_CURRENTAMOUNT/f_budgeted_modified>0.8 AND f_CURRENTAMOUNT!=f_budgeted_modified AND \
f_budgeted_modified<0 AND (t_PERIOD='" % month % "' OR t_PERIOD='" % year % "');", \
budgets); int nb = budgets.count();
if(nb) {
SKGServices::SKGUnitInfo primary = m_currentBankDocument->getPrimaryUnit();
@@ -132,7 +132,7 @@ QList< SKGInterfacePlugin::SKGAdvice > SKGBudgetPlugin::advices() \
const
double f_budgeted_modified = \
SKGServices::stringToDouble(budget.getAttribute("f_budgeted_modified"));
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgbudgetplugin_alarm|" + \
SKGServices::intToString(budget.getID()); + ad.uuid = \
"skgbudgetplugin_alarm|" % SKGServices::intToString(budget.getID());
ad.priority = (f_CURRENTAMOUNT < f_budgeted_modified ? 9 : 6);
ad.shortMessage = i18nc("Advice on making the best (short)", "Budget \
alarm for '%1'", budget.getAttribute("t_CATEGORY"));
ad.longMessage = i18nc("Advice on making the best (long)", "Take care to \
your budget.<br> %1.<br>%2 / %3",
diff --git a/skrooge_budget/skgbudgetpluginwidget.cpp \
b/skrooge_budget/skgbudgetpluginwidget.cpp index ddf57b5..562fbad 100644
--- a/skrooge_budget/skgbudgetpluginwidget.cpp
+++ b/skrooge_budget/skgbudgetpluginwidget.cpp
@@ -495,11 +495,11 @@ void SKGBudgetPluginWidget::open(const SKGBudgetObject& \
iBudget) //Build where clause and title
QString y = SKGServices::intToString(iBudget.getYear());
QString m = SKGServices::intToString(iBudget.getMonth());
- if(m.length() == 1) m = '0' + m;
+ if(m.length() == 1) m = '0' % m;
- QString wc = "i_IDCATEGORY IN (SELECT bc.id_category FROM budgetcategory bc \
WHERE bc.id=" + SKGServices::intToString(iBudget.getID()) + ") AND "
- "STRFTIME('%Y', d_date)='" + y + '\'';
- if(m != "00") wc += " AND STRFTIME('%m', d_date)='" + m + '\'';
+ QString wc = "i_IDCATEGORY IN (SELECT bc.id_category FROM budgetcategory bc \
WHERE bc.id=" % SKGServices::intToString(iBudget.getID()) % ") AND " + \
"STRFTIME('%Y', d_date)='" % y % '\''; + if(m != "00") wc += " AND STRFTIME('%m', \
d_date)='" % m % '\'';
QString title = i18nc("Noun, a list of items", "Operations assigned to budget");
//Open
@@ -508,7 +508,7 @@ void SKGBudgetPluginWidget::open(const SKGBudgetObject& iBudget)
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_consolidated WHERE \
" + wc); + root.setAttribute("sqlOrder", "SELECT * from \
v_operation_consolidated WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
@@ -634,13 +634,13 @@ void SKGBudgetPluginWidget::refreshInfoZone()
QString budgetedS = doc->formatMoney(budgeted, primary);
QString modifiedS = doc->formatMoney(modified, primary);
- QString v = (budgetedS == modifiedS ? budgetedS : modifiedS + " <s><small>" \
+ budgetedS + "</small></s>"); + QString v = (budgetedS == modifiedS ? \
budgetedS : modifiedS % " <s><small>" % budgetedS % "</small></s>"); if(nb) {
ui.kInfo->setText(i18np("Selection: %1 budget for %2", "Selection: %1 \
budgets for %2", nb, v)); if(!secondary.Symbol.isEmpty() && secondary.Value) {
QString budgetedS = doc->formatMoney(budgeted, secondary);
QString modifiedS = doc->formatMoney(modified, secondary);
- v = (budgetedS == modifiedS ? budgetedS : modifiedS + " <s><small>" \
+ budgetedS + "</small></s>"); + v = (budgetedS == modifiedS ? \
budgetedS : modifiedS % " <s><small>" % budgetedS % "</small></s>"); }
ui.kInfo->setToolTip(i18np("Selection: %1 budget for %2", "Selection: %1 \
budgets for %2", nb, v)); } else {
diff --git a/skrooge_calculator/skgcalculatorplugin.cpp \
b/skrooge_calculator/skgcalculatorplugin.cpp index 7093f01..dae3a79 100644
--- a/skrooge_calculator/skgcalculatorplugin.cpp
+++ b/skrooge_calculator/skgcalculatorplugin.cpp
@@ -163,7 +163,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGCalculatorPlugin::advices() const for(int i = 0; i < nb; ++i) {
SKGAccountObject account = accounts.at(i);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgcalculatorplugin_nointerest|" + account.getName();
+ ad.uuid = "skgcalculatorplugin_nointerest|" % account.getName();
ad.priority = 3;
ad.shortMessage = i18nc("User did not define an interest rate on an \
investment account", "No interest rate defined for account '%1'", account.getName()); \
ad.longMessage = i18nc("User did not define an interest rate on an investment \
account", "Your investment account '%1' doesn't have interest rate defined", \
account.getName());
diff --git a/skrooge_calculator/skgcalculatorpluginwidget.cpp \
b/skrooge_calculator/skgcalculatorpluginwidget.cpp index a5d043e..830df1a 100644
--- a/skrooge_calculator/skgcalculatorpluginwidget.cpp
+++ b/skrooge_calculator/skgcalculatorpluginwidget.cpp
@@ -349,7 +349,7 @@ void SKGCalculatorPluginWidget::onFilterChanged()
//Compute where clause
QString account = ui.kDisplayAccountCombo->currentText();
- QString filter2 = "t_ACCOUNT='" + SKGServices::stringToSqlString(account) + "' \
ORDER BY d_date"; + QString filter2 = "t_ACCOUNT='" % \
SKGServices::stringToSqlString(account) % "' ORDER BY d_date";
//Update model
if(m_objectModel) {
diff --git a/skrooge_calculator/skginterestboardwidget.cpp \
b/skrooge_calculator/skginterestboardwidget.cpp index c785bb1..87932ae 100644
--- a/skrooge_calculator/skginterestboardwidget.cpp
+++ b/skrooge_calculator/skginterestboardwidget.cpp
@@ -82,7 +82,7 @@ void SKGInterestBoardWidget::dataModified(const QString& \
iTableName, int iIdTran double sum = 0;
for(int i = 0; i < nb; ++i) {
SKGAccountObject obj = objs.at(i);
- html += QString("<tr><td><a href=\"" + \
SKGServices::stringToHtml(obj.getName()) + "\">") + \
SKGServices::stringToHtml(obj.getName()) + "</a></td><td align=\"right\">"; + \
html += QString("<tr><td><a href=\"" % SKGServices::stringToHtml(obj.getName()) % \
"\">") % SKGServices::stringToHtml(obj.getName()) % "</a></td><td align=\"right\">"; \
QList<SKGAccountObject::SKGInterestItem> oInterestList;
double oInterests = 0;
@@ -92,8 +92,8 @@ void SKGInterestBoardWidget::dataModified(const QString& \
iTableName, int iIdTran html += doc->formatMoney(oInterests, primary);
html += "</td></tr>";
}
- html += "<tr><td><b>" + SKGServices::stringToHtml(i18nc("Noun, \
the numerical total of a sum of values", "Total")) + "</b></td>"
- "<td align=\"right\"><b>" + doc->formatMoney(sum, \
primary) + "</b></td>" + html += "<tr><td><b>" % \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) % "</b></td>" + "<td align=\"right\"><b>" % \
doc->formatMoney(sum, primary) % "</b></td>" "</tr>";
html += "</table>";
} else {
diff --git a/skrooge_categories/skgcategoriespluginwidget.cpp \
b/skrooge_categories/skgcategoriespluginwidget.cpp index 2b6dc8c..79aafe0 100644
--- a/skrooge_categories/skgcategoriespluginwidget.cpp
+++ b/skrooge_categories/skgcategoriespluginwidget.cpp
@@ -172,7 +172,7 @@ void SKGCategoriesPluginWidget::changeSelection()
{
QString fullname = sender()->property("FULLNAME").toString();
SKGObjectBase::SKGListSKGObjectBase list;
- getDocument()->getObjects("v_category", "t_fullname='" + \
SKGServices::stringToSqlString(fullname) + '\'', list); + \
getDocument()->getObjects("v_category", "t_fullname='" % \
SKGServices::stringToSqlString(fullname) % '\'', list);
if(list.count()) {
ui.kCategoriesView->getView()->selectObject(list.at(0).getUniqueID());
@@ -237,7 +237,7 @@ void SKGCategoriesPluginWidget::onAddCategory()
if(nb == 1) {
SKGCategoryObject parent = selection[0];
- name = parent.getFullName() + OBJECTSEPARATOR + name;
+ name = parent.getFullName() % OBJECTSEPARATOR % name;
}
if(err.isSucceeded()) err = \
SKGCategoryObject::createPathCategory(static_cast<SKGDocumentBank*>(getDocument()), \
name, cat, false, true);
@@ -318,11 +318,11 @@ void SKGCategoriesPluginWidget::onDoubleClick()
QString title;
if(name.isEmpty()) {
wc += " IS NULL OR t_REALCATEGORY=''";
- wc = '(' + wc + ')';
+ wc = '(' % wc % ')';
title = i18nc("Noun, a list of items", "Sub operations with empty \
category"); } else {
- wc += " = '" + SKGServices::stringToSqlString(name) + "' OR \
t_REALCATEGORY like '" + SKGServices::stringToSqlString(name) + OBJECTSEPARATOR + \
"%'";
- wc = '(' + wc + ')';
+ wc += " = '" % SKGServices::stringToSqlString(name) % "' OR \
t_REALCATEGORY like '" % SKGServices::stringToSqlString(name) % OBJECTSEPARATOR % \
"%'"; + wc = '(' % wc % ')';
title = i18nc("Noun, a list of items", "Sub operations with category \
containing '%1'", name); }
@@ -332,7 +332,7 @@ void SKGCategoriesPluginWidget::onDoubleClick()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_consolidated \
WHERE " + wc); + root.setAttribute("sqlOrder", "SELECT * from \
v_operation_consolidated WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
diff --git a/skrooge_importexport/skgimportexportplugin.cpp \
b/skrooge_importexport/skgimportexportplugin.cpp index a45759f..eefa34a 100644
--- a/skrooge_importexport/skgimportexportplugin.cpp
+++ b/skrooge_importexport/skgimportexportplugin.cpp
@@ -304,19 +304,19 @@ void SKGImportExportPlugin::import(const QString& iFile)
if(iFile.isEmpty()) {
//Panel to ask files
KEncodingFileDialog::Result result = \
KEncodingFileDialog::getOpenFileNamesAndEncoding(lastCodecUsed, \
"kfiledialog:///IMPEXP",
- sender() == m_importCsvUnitAction ? \
"*.csv|" + i18nc("A file format", "CSV Files") :
- \
QString(SKGImportExportManager::isOFXSupported() ? "*.ofx *.qfx " : "") + "*.qif \
*.csv *.mt940 *.uncompressed *.gnucash *.gnc *.kmy *.xhb *.skg *.mmb *.gsb|" + \
i18nc("A file format", "All supported formats") + '\n' +
- \
(SKGImportExportManager::isOFXSupported() ? "*.ofx *.qfx|" + i18nc("A file format", \
"OFX file") + '\n' : "") +
- "*.qif|" + i18nc("A file format", \
"QIF file") + '\n' +
- "*.csv|" + i18nc("A file format", \
"CSV file") + '\n' +
- "*.mt940|" + i18nc("A file format", \
"MT940 file") + '\n' +
- "*.skg|" + i18nc("A file format", \
"Skrooge document") + '\n' +
- "*.sqlite|" + i18nc("A file \
format", "Sqlite document") + '\n' +
- "*.kmy|" + i18nc("A file format", \
"KMyMoney document") + '\n' +
- "*.uncompressed *.gnucash *.gnc|" + \
i18nc("A file format", "GnuCash document") + '\n' +
- "*.xhb|" + i18nc("A file format", \
"Homebank document") + '\n' +
- "*.mmb|" + i18nc("A file format", \
"Money Manager Ex document") + '\n' +
- "*.gsb|" + i18nc("A file format", \
"Grisbi document") , + sender() == \
m_importCsvUnitAction ? QString("*.csv|" % i18nc("A file format", "CSV Files")) : + \
QString(SKGImportExportManager::isOFXSupported() ? "*.ofx *.qfx " : "") % "*.qif \
*.csv *.mt940 *.uncompressed *.gnucash *.gnc *.kmy *.xhb *.skg *.mmb *.gsb|" % \
i18nc("A file format", "All supported formats") % '\n' % + \
(SKGImportExportManager::isOFXSupported() ? QString("*.ofx *.qfx|" % i18nc("A file \
format", "OFX file") % '\n') : "") % + \
QString("*.qif|" % i18nc("A file format", "QIF file") % '\n' % + \
"*.csv|" % i18nc("A file format", "CSV file") % '\n' % + \
"*.mt940|" % i18nc("A file format", "MT940 file") % '\n' % + \
"*.skg|" % i18nc("A file format", "Skrooge document") % '\n' % + \
"*.sqlite|" % i18nc("A file format", "Sqlite document") % '\n' % + \
"*.kmy|" % i18nc("A file format", "KMyMoney document") % '\n' % + \
"*.uncompressed *.gnucash *.gnc|" % i18nc("A file format", "GnuCash document") % '\n' \
% + "*.xhb|" % i18nc("A file \
format", "Homebank document") % '\n' % + \
"*.mmb|" % i18nc("A file format", "Money Manager Ex document") % '\n' % + \
"*.gsb|" % i18nc("A file format", "Grisbi document")) ,
SKGMainPanel::getMainPanel());
fileNames = result.fileNames.toSet();
codec = result.encoding;
@@ -421,12 +421,12 @@ void SKGImportExportPlugin::exportFile()
QString lastCodecUsed = \
m_currentBankDocument->getParameter("SKG_LAST_CODEC_USED_FOR_IMPORT");
if(lastCodecUsed.length() == 0) lastCodecUsed = \
QTextCodec::codecForLocale()->name();
QString fileName = SKGMainPanel::getSaveFileName("kfiledialog:///IMPEXP",
- "*.qif|" + i18nc("A file format", "QIF file") + '\n' +
- "*.csv|" + i18nc("A file format", "CSV file") + '\n' +
- "*.xml|" + i18nc("A file format", "XML file") + '\n' +
- "*.skg|" + i18nc("A file format", "Skrooge document") + \
'\n' +
- "*.sqlite|" + i18nc("A file format", "Sqlite document") + \
'\n' +
- "*.kmy|" + i18nc("A file format", "KMyMoney document") ,
+ "*.qif|" % i18nc("A file format", "QIF file") % '\n' %
+ "*.csv|" % i18nc("A file format", "CSV file") % '\n' %
+ "*.xml|" % i18nc("A file format", "XML file") % '\n' %
+ "*.skg|" % i18nc("A file format", "Skrooge document") % \
'\n' % + "*.sqlite|" % i18nc("A file format", "Sqlite \
document") % '\n' % + "*.kmy|" % i18nc("A file format", \
"KMyMoney document") ,
SKGMainPanel::getMainPanel(), QString(), &lastCodecUsed);
if(fileName.isEmpty() || !m_currentBankDocument) return;
diff --git a/skrooge_monthly/skgmonthlyplugin.cpp \
b/skrooge_monthly/skgmonthlyplugin.cpp index b9a2474..ef0e985 100644
--- a/skrooge_monthly/skgmonthlyplugin.cpp
+++ b/skrooge_monthly/skgmonthlyplugin.cpp
@@ -174,7 +174,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGMonthlyPlugin::advices() const int nb = listVariations.count();
for(int i = 0; i < nb; ++i) {
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgmonthlyplugin_maincategoriesvariation|" + \
listCategories.at(i); + ad.uuid = "skgmonthlyplugin_maincategoriesvariation|" \
% listCategories.at(i); ad.priority = 7;
ad.shortMessage = i18nc("Advice on making the best (short)", "Important \
variation for '%1'", listCategories.at(i)); ad.longMessage = listVariations.at(i);
@@ -203,7 +203,7 @@ SKGError SKGMonthlyPlugin::executeAdviceCorrection(const QString& \
iAdviceIdentif }
root.setAttribute("operationTable", "v_operation_consolidated");
- root.setAttribute("operationWhereClause", "d_DATEMONTH='" + month + "' AND \
t_REALCATEGORY='" + SKGServices::stringToSqlString(category) + '\''); + \
root.setAttribute("operationWhereClause", "d_DATEMONTH='" % month % "' AND \
t_REALCATEGORY='" % SKGServices::stringToSqlString(category) % '\'');
root.setAttribute("title", i18nc("Noun, a list of items", "Sub operations \
with category containing '%1'", category)); root.setAttribute("title_icon", \
"skrooge_category"); root.setAttribute("currentPage", "-1");
diff --git a/skrooge_monthly/skgmonthlypluginwidget.cpp \
b/skrooge_monthly/skgmonthlypluginwidget.cpp index a316fa4..c620ba7 100644
--- a/skrooge_monthly/skgmonthlypluginwidget.cpp
+++ b/skrooge_monthly/skgmonthlypluginwidget.cpp
@@ -146,12 +146,12 @@ void SKGMonthlyPluginWidget::onMonthChanged()
QString month = getMonth();
if(!month.isEmpty()) {
//Display report
- QString htmlReport = getDocument()->getParameter("SKG_MONTHLY_REPORT_" + \
month); + QString htmlReport = \
getDocument()->getParameter("SKG_MONTHLY_REPORT_" % month); if(htmlReport.isEmpty() \
|| sender() == ui.kRefresh) { SKGError err;
SKGBEGINTRANSACTION(*getDocument(), i18nc("Noun, name of the user \
action", "Compute monthly report for '%1'", month), err); htmlReport = getReport();
- err = getDocument()->setParameter("SKG_MONTHLY_REPORT_" + month, \
htmlReport); + err = getDocument()->setParameter("SKG_MONTHLY_REPORT_" % \
month, htmlReport); }
//Report generated
@@ -206,19 +206,19 @@ QString SKGMonthlyPluginWidget::getReport()
"<body>\n";
//Main title
- html += "<h1>" + i18nc("Report header", "Report for %1", month) + \
"</h1>"; + html += "<h1>" % i18nc("Report header", "Report for %1", \
month) % "</h1>";
//Income & Expenditure
if(err.isSucceeded()) {
SKGStringListList listTmp;
err = doc->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from \
v_operation_display WHERE d_DATEMONTH IN ('" + month + "', '" + previousmonth + "') \
AND i_group_id=0 group by d_DATEMONTH, t_TYPEEXPENSE", + \
"SELECT TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from v_operation_display WHERE \
d_DATEMONTH IN ('" % month % "', '" % previousmonth % "') AND i_group_id=0 group by \
d_DATEMONTH, t_TYPEEXPENSE", listTmp);
if(err.isSucceeded()) {
- html += "<h2>" + i18nc("Report header", "Income & Expenditure") \
+ "</h2><table class=\"table\">"; + html += "<h2>" % i18nc("Report \
header", "Income & Expenditure") % "</h2><table class=\"table\">";
html += "<tr class=\"tabletitle\"><td align=\"center\"></td>"
- "<td align=\"center\">" + previousmonth + "</td>"
- "<td align=\"center\">" + month + "</td>"
+ "<td align=\"center\">" % previousmonth % "</td>"
+ "<td align=\"center\">" % month % "</td>"
"</tr>";
double income_previous_month = 0;
double expense_previous_month = 0;
@@ -237,49 +237,49 @@ QString SKGMonthlyPluginWidget::getReport()
double saving_previous_month = income_previous_month + \
expense_previous_month; double saving_month = income_month + expense_month;
- html += QString("<tr><td>") + \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_INCOME")) \
+ "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(income_previous_month, primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(income_month, \
primary) + "</td>" + html += QString("<tr><td>") % \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_INCOME")) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(income_previous_month, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(income_month, primary) % "</td>" "</tr>";
- html += QString("<tr><td>") + \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_EXPENSE")) \
+ "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(abs(expense_previous_month), primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(abs(expense_month), primary) + "</td>" + html += \
QString("<tr><td>") % \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_EXPENSE")) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(abs(expense_previous_month), primary) % \
"</td>" + "<td align=\"right\">" % \
doc->formatMoney(abs(expense_month), primary) % "</td>" "</tr>";
- html += "<tr class=\"tabletotal\"><td>" + i18nc("Noun", \
"Savings possible") + "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(saving_previous_month, primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(saving_month, \
primary) + "</td>" + html += "<tr class=\"tabletotal\"><td>" % \
i18nc("Noun", "Savings possible") % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(saving_previous_month, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(saving_month, primary) % "</td>" "</tr>";
html += "</table>";
- QString range = "0," + \
SKGServices::doubleToString(qMax(abs(income_month), \
abs(expense_month)));
- QString img = \
"http://chart.apis.google.com/chart?cht=bvs&chbh=100&chxt=x,y&chxr=1," + range + \
"&chco=FF0000|00FF00&chd=t:" +
- SKGServices::doubleToString(abs(expense_month)) + \
',' +
- SKGServices::doubleToString(abs(income_month)) +
- "&chds=" + range +
- "&chs=300x200&chl=" + \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_EXPENSE")) + '|' + \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_INCOME")) + "&chtt=" + \
i18nc("Noun", "Expenditure vs Income") + '|' + month; + QString \
range = "0," % SKGServices::doubleToString(qMax(abs(income_month), \
abs(expense_month))); + QString img = \
"http://chart.apis.google.com/chart?cht=bvs&chbh=100&chxt=x,y&chxr=1," % range % \
"&chco=FF0000|00FF00&chd=t:" % + \
SKGServices::doubleToString(abs(expense_month)) % ',' % + \
SKGServices::doubleToString(abs(income_month)) % + \
"&chds=" % range % + "&chs=300x200&chl=" % \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_EXPENSE")) % '|' % \
SKGServices::stringToHtml(doc->getDisplay("f_CURRENTAMOUNT_INCOME")) % "&chtt=" % \
i18nc("Noun", "Expenditure vs Income") % '|' % month; // SKGTRACE << img << endl;
- html += "<img src=\"" + img + "\" />";
+ html += "<img src=\"" % img % "\" />";
}
}
//Budget
QString budget = doc->getBudget(month);
if(err.isSucceeded() && !budget.isEmpty()) {
- html += "<h2>" + i18nc("Report header", "Budget") + "</h2>";
+ html += "<h2>" % i18nc("Report header", "Budget") % "</h2>";
html += budget;
}
//5 main categories of expenditure
if(err.isSucceeded()) {
- html += "<h2>" + i18nc("Report header", "5 main categories of \
expenditure") + "</h2>"; + html += "<h2>" % i18nc("Report header", "5 \
main categories of expenditure") % "</h2>"; html += "<table>";
- html += "<tr><td align=\"center\">" + \
doc->get5MainCategories(previousmonth) + "</td>"
- "<td align=\"center\">" + doc->get5MainCategories(month) + \
"</td>" + html += "<tr><td align=\"center\">" % \
doc->get5MainCategories(previousmonth) % "</td>" + "<td \
align=\"center\">" % doc->get5MainCategories(month) % "</td>" "</tr></table>";
}
//5 main categories variations
if(err.isSucceeded()) {
- html += "<h2>" + i18nc("Report header", "5 main variations") + \
"</h2>"; + html += "<h2>" % i18nc("Report header", "5 main \
variations") % "</h2>";
html += doc->get5MainCategoriesVariation(month, previousmonth);
}
@@ -288,13 +288,13 @@ QString SKGMonthlyPluginWidget::getReport()
SKGObjectBase::SKGListSKGObjectBase accounts;
SKGError err = doc->getObjects("v_account_display", "1=1 ORDER BY \
t_TYPENLS", accounts); if(err.isSucceeded()) {
- html += "<h2>" + i18nc("Report header", "Amounts in accounts") \
+ "</h2><table class=\"table\">";
- html += "<tr class=\"tabletitle\"><td align=\"center\">" + \
SKGServices::stringToHtml(doc->getDisplay("t_ACCOUNT")) + "</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date1, \
KLocale::ShortDate)) + "</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date2, KLocale::ShortDate)) + "</td>" + \
html += "<h2>" % i18nc("Report header", "Amounts in accounts") % "</h2><table \
class=\"table\">"; + html += "<tr class=\"tabletitle\"><td \
align=\"center\">" % SKGServices::stringToHtml(doc->getDisplay("t_ACCOUNT")) % \
"</td>" + "<td align=\"center\">" % \
SKGServices::stringToHtml(locale->formatDate(date1, KLocale::ShortDate)) % "</td>" + \
"<td align=\"center\">" % SKGServices::stringToHtml(locale->formatDate(date2, \
KLocale::ShortDate)) % "</td>" "<td align=\"center\">%</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date3, \
KLocale::ShortDate)) + "</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date2, KLocale::ShortDate)) + "</td>" + \
"<td align=\"center\">" % SKGServices::stringToHtml(locale->formatDate(date3, \
KLocale::ShortDate)) % "</td>" + "<td align=\"center\">" % \
SKGServices::stringToHtml(locale->formatDate(date2, KLocale::ShortDate)) % "</td>" \
"<td align=\"center\">%</td>" "</tr>";
double sumTypeV1 = 0;
@@ -314,13 +314,13 @@ QString SKGMonthlyPluginWidget::getReport()
bool closed = account.isClosed();
if(type != currentType) {
if(!currentType.isEmpty()) {
- html += "<tr class=\"tabletotal\"><td>" + \
SKGServices::stringToHtml(i18nc("Noun", "Total of %1", currentType)) \
+ "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(sumTypeV1, primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(sumTypeV2, primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV1) / \
fabs(sumTypeV1)) + "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(sumTypeV3, primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatMoney(sumTypeV2, primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV3) / fabs(sumTypeV3)) + "</td>" + \
html += "<tr class=\"tabletotal\"><td>" % SKGServices::stringToHtml(i18nc("Noun", \
"Total of %1", currentType)) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumTypeV1, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(sumTypeV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV1) / \
fabs(sumTypeV1)) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumTypeV3, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(sumTypeV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV3) / \
fabs(sumTypeV3)) % "</td>" "</tr>";
sumTypeV1 = 0;
sumTypeV2 = 0;
@@ -329,13 +329,13 @@ QString SKGMonthlyPluginWidget::getReport()
currentType = type;
}
if(!closed || abs(v1) > 0.01 || abs(v2) > 0.01 || abs(v3) > \
0.01) {
- html += QString("<tr><td>") + (closed ? "<i>" : "") + \
SKGServices::stringToHtml(account.getName()) + (closed ? "</i>" : "") \
+ "</td>"
- "<td align=\"right\">" + doc->formatMoney(v1, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(v2, \
primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatPercentage(100.0 * (v2 - v1) / fabs(v1)) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(v3, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(v2, \
primary) + "</td>"
- "<td align=\"right\">" + \
doc->formatPercentage(100.0 * (v2 - v3) / fabs(v3)) + "</td>" + \
html += QString("<tr><td>") % (closed ? "<i>" : "") % \
SKGServices::stringToHtml(account.getName()) % (closed ? "</i>" : "") % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(v1, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(v2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (v2 - v1) / fabs(v1)) % \
"</td>" + "<td align=\"right\">" % \
doc->formatMoney(v3, primary) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(v2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (v2 - v3) / fabs(v3)) % \
"</td>" ;
}
sumTypeV1 += v1;
@@ -346,21 +346,21 @@ QString SKGMonthlyPluginWidget::getReport()
sumV3 += v3;
}
- html += "<tr class=\"tabletotal\"><td>" + \
SKGServices::stringToHtml(i18nc("Noun", "Total of %1", currentType)) \
+ "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumTypeV1, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumTypeV2, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatPercentage(100.0 * \
(sumTypeV2 - sumTypeV1) / fabs(sumTypeV1)) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumTypeV3, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumTypeV2, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatPercentage(100.0 * \
(sumTypeV2 - sumTypeV3) / fabs(sumTypeV3)) + "</td>" + html += \
"<tr class=\"tabletotal\"><td>" % SKGServices::stringToHtml(i18nc("Noun", "Total of \
%1", currentType)) % "</td>" + "<td align=\"right\">" % \
doc->formatMoney(sumTypeV1, primary) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumTypeV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV1) / \
fabs(sumTypeV1)) % "</td>" + "<td align=\"right\">" % \
doc->formatMoney(sumTypeV3, primary) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumTypeV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumTypeV2 - sumTypeV3) / \
fabs(sumTypeV3)) % "</td>" "</tr>";
- html += "<tr class=\"tabletotal\"><td>" + \
SKGServices::stringToHtml(i18nc("Noun, the numerical total of a sum of values", \
"Total")) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumV1, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumV2, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatPercentage(100.0 * \
(sumV2 - sumV1) / fabs(sumV1)) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumV3, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(sumV2, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatPercentage(100.0 * \
(sumV2 - sumV3) / fabs(sumV3)) + "</td>" + html += "<tr \
class=\"tabletotal\"><td>" % SKGServices::stringToHtml(i18nc("Noun, the numerical \
total of a sum of values", "Total")) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumV1, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(sumV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumV2 - sumV1) / fabs(sumV1)) \
% "</td>" + "<td align=\"right\">" % \
doc->formatMoney(sumV3, primary) % "</td>" + "<td \
align=\"right\">" % doc->formatMoney(sumV2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (sumV2 - sumV3) / fabs(sumV3)) \
% "</td>" "</tr>";
html += "</table>";
}
@@ -371,18 +371,18 @@ QString SKGMonthlyPluginWidget::getReport()
SKGObjectBase::SKGListSKGObjectBase units;
SKGError err = doc->getObjects("v_unit_display", "1=1 ORDER BY \
t_TYPENLS", units); if(err.isSucceeded()) {
- html += "<h2>" + i18nc("Report header", "Amounts of units") + \
"</h2><table class=\"table\">";
- html += "<tr class=\"tabletitle\"><td align=\"center\">" + \
SKGServices::stringToHtml(doc->getDisplay("t_UNIT")) + "</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date1, \
KLocale::ShortDate)) + "</td>"
- "<td align=\"center\">" + \
SKGServices::stringToHtml(locale->formatDate(date2, KLocale::ShortDate)) + "</td>" + \
html += "<h2>" % i18nc("Report header", "Amounts of units") % "</h2><table \
class=\"table\">"; + html += "<tr class=\"tabletitle\"><td \
align=\"center\">" % SKGServices::stringToHtml(doc->getDisplay("t_UNIT")) % "</td>" + \
"<td align=\"center\">" % SKGServices::stringToHtml(locale->formatDate(date1, \
KLocale::ShortDate)) % "</td>" + "<td align=\"center\">" % \
SKGServices::stringToHtml(locale->formatDate(date2, KLocale::ShortDate)) % "</td>" \
"<td align=\"center\">%</td></tr>"; foreach(const SKGUnitObject & unit, units) {
double v1 = unit.getAmount(date1);
double v2 = unit.getAmount(date2);
- html += "<tr><td>" + \
SKGServices::stringToHtml(unit.getName()) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(v1, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatMoney(v2, \
primary) + "</td>"
- "<td align=\"right\">" + doc->formatPercentage(100.0 \
* (v2 - v1) / fabs(v1)) + "</td>" + html += "<tr><td>" % \
SKGServices::stringToHtml(unit.getName()) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(v1, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatMoney(v2, primary) % "</td>" + \
"<td align=\"right\">" % doc->formatPercentage(100.0 * (v2 - v1) / fabs(v1)) % \
"</td>" "</tr>";
}
html += "</table>";
diff --git a/skrooge_operation/skgbookmarkboardwidget.cpp \
b/skrooge_operation/skgbookmarkboardwidget.cpp index 6dd4a36..4f02c04 100644
--- a/skrooge_operation/skgbookmarkboardwidget.cpp
+++ b/skrooge_operation/skgbookmarkboardwidget.cpp
@@ -72,7 +72,7 @@ void SKGBookmarkBoardWidget::dataModified(const QString& \
iTableName, int iIdTran if(nb) {
for(int i = 0; i < nb; ++i) {
SKGOperationObject obj = objs.at(i);
- html += "<a href=\"" + SKGServices::intToString(obj.getID()) + \
"\">" + SKGServices::stringToHtml(obj.getDisplayName()) + "</a><br>"; + \
html += "<a href=\"" % SKGServices::intToString(obj.getID()) % "\">" % \
SKGServices::stringToHtml(obj.getDisplayName()) % "</a><br>"; }
} else {
html += i18nc("Message", "No operation highlighted<br>on the <a \
href=\"___\">\"Operations\"</a> page."); @@ -107,7 +107,7 @@ void \
SKGBookmarkBoardWidget::onOpen(const QString& iLink) }
root.setAttribute("operationTable", "v_operation_display");
- root.setAttribute("operationWhereClause", "id=" + iLink);
+ root.setAttribute("operationWhereClause", "id=" % iLink);
root.setAttribute("title", i18nc("Noun, a list of items", "Highlighted \
operations")); root.setAttribute("title_icon", "rating");
}
diff --git a/skrooge_operation/skgoperationboardwidget.cpp \
b/skrooge_operation/skgoperationboardwidget.cpp index 43bcbb9..1d8fedd 100644
--- a/skrooge_operation/skgoperationboardwidget.cpp
+++ b/skrooge_operation/skgoperationboardwidget.cpp
@@ -95,7 +95,7 @@ void SKGOperationBoardWidget::dataModified(const QString& \
iTableName, int iIdTra
SKGStringListList listTmp;
SKGError err = getDocument()->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from \
v_operation_display WHERE d_DATEMONTH IN ('" + month + "', '" + previousmonth + "') " \
+ (m_menuTransfert && m_menuTransfert->isChecked() ? "" : "AND i_group_id=0") + " \
group by d_DATEMONTH, t_TYPEEXPENSE", + "SELECT \
TOTAL(f_CURRENTAMOUNT), d_DATEMONTH from v_operation_display WHERE d_DATEMONTH IN \
('" % month % "', '" % previousmonth % "') " % (m_menuTransfert && \
m_menuTransfert->isChecked() ? "" : "AND i_group_id=0") % " group by d_DATEMONTH, \
t_TYPEEXPENSE", listTmp);
if(err.isSucceeded()) {
double income_previous_month = 0;
@@ -130,25 +130,25 @@ void SKGOperationBoardWidget::dataModified(const QString& \
iTableName, int iIdTra //Set tool tips
QString tmp = doc->formatMoney(income_month, primary);
if(!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(income_month, secondary);
+ tmp += "<br>" % doc->formatMoney(income_month, secondary);
}
ui.kIncome->setToolTip(tmp);
tmp = doc->formatMoney(income_previous_month, primary);
if(!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(income_previous_month, \
secondary); + tmp += "<br>" % \
doc->formatMoney(income_previous_month, secondary); }
ui.kIncome_previous->setToolTip(tmp);
tmp = doc->formatMoney(expense_month, primary);
if(!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(expense_month, secondary);
+ tmp += "<br>" % doc->formatMoney(expense_month, secondary);
}
ui.kExpense->setToolTip(tmp);
tmp = doc->formatMoney(expense_previous_month, primary);
if(!secondary.Symbol.isEmpty() && secondary.Value) {
- tmp += "<br>" + doc->formatMoney(expense_previous_month, \
secondary); + tmp += "<br>" % \
doc->formatMoney(expense_previous_month, secondary); }
ui.kExpense_previous->setToolTip(tmp);
}
diff --git a/skrooge_operation/skgoperationplugin.cpp \
b/skrooge_operation/skgoperationplugin.cpp index 0b691d5..4739050 100644
--- a/skrooge_operation/skgoperationplugin.cpp
+++ b/skrooge_operation/skgoperationplugin.cpp
@@ -616,7 +616,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGOperationPlugin::advices() const QString number = line.at(2);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgoperationplugin_duplicate|" + number + ';' + account;
+ ad.uuid = "skgoperationplugin_duplicate|" % number % ';' % account;
ad.priority = 7;
ad.shortMessage = i18nc("Advice on making the best (short)", "Duplicate \
number %1 in account '%2'", number, account); ad.longMessage = i18nc("Advice on \
making the best (long)", "Your account '%1' contains more than one operation with \
number %2.The operation number should be unique (check number, transaction \
reference...)", account, number); @@ -633,7 +633,7 @@ QList< \
SKGInterfacePlugin::SKGAdvice > SKGOperationPlugin::advices() const QString account \
= line.at(1);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgoperationplugin_notreconciliated|" + account;
+ ad.uuid = "skgoperationplugin_notreconciliated|" % account;
ad.priority = 9;
ad.shortMessage = i18nc("Advice on making the best (short)", "Many \
operations of '%1' not reconciliated", account); ad.longMessage = i18nc("Advice on \
making the best (long)", "Don't forget to reconciliate your accounts. By doing so, \
you acknowledge that your bank has indeed processed these operations on your account. \
This is how you enforce compliance with your bank's statements. See online help for \
more details"); @@ -675,14 +675,14 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGOperationPlugin::advices() const QString rate = result.at(1).at(1);
//Get accounts with too much money
- m_currentBankDocument->executeSelectSqliteOrder("SELECT t_name FROM \
v_account_display WHERE f_RATE<" + rate + " AND t_type='C' AND t_close='N' AND \
f_CURRENTAMOUNT>-2*(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation_display s WHERE \
s.rd_account_id=v_account_display.id AND s.t_TYPEEXPENSE='-' AND s.d_DATEMONTH = \
strftime('%Y-%m',date('now','start of month', '-1 MONTH')))", result); + \
m_currentBankDocument->executeSelectSqliteOrder("SELECT t_name FROM v_account_display \
WHERE f_RATE<" % rate % " AND t_type='C' AND t_close='N' AND \
f_CURRENTAMOUNT>-2*(SELECT TOTAL(s.f_CURRENTAMOUNT) FROM v_operation_display s WHERE \
s.rd_account_id=v_account_display.id AND s.t_TYPEEXPENSE='-' AND s.d_DATEMONTH = \
strftime('%Y-%m',date('now','start of month', '-1 MONTH')))", result); nb = \
result.count(); for(int i = 1; i < nb; ++i) { //Ignore header
//Get parameters
QString account = result.at(i).at(0);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgoperationplugin_too_much_money|" + account;
+ ad.uuid = "skgoperationplugin_too_much_money|" % account;
ad.priority = 6;
ad.shortMessage = i18nc("Advice on making the best (short)", "Too much \
money in your account '%1'", account);
ad.longMessage = i18nc("Advice on making the best (long)", "You could \
save money on an account with a better rate. Example: '%1' (%2%)", target, rate); @@ \
-711,7 +711,7 @@ SKGError SKGOperationPlugin::executeAdviceCorrection(const QString& \
iAdviceIdent }
root.setAttribute("operationTable", "v_operation_display");
- root.setAttribute("operationWhereClause", "i_number=" + \
SKGServices::stringToSqlString(num) + " AND t_ACCOUNT='" + \
SKGServices::stringToSqlString(account) + '\''); + \
root.setAttribute("operationWhereClause", "i_number=" % \
SKGServices::stringToSqlString(num) % " AND t_ACCOUNT='" % \
SKGServices::stringToSqlString(account) % '\'');
root.setAttribute("title", i18nc("Noun, a list of items", "Operations of \
'%1' with duplicate number %2", account, num)); root.setAttribute("title_icon", \
"security-low");
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Skrooge \
operation plugin"), -1, doc.toString());
diff --git a/skrooge_operation/skgoperationpluginwidget.cpp \
b/skrooge_operation/skgoperationpluginwidget.cpp index de03d80..f0e5c65 100644
--- a/skrooge_operation/skgoperationpluginwidget.cpp
+++ b/skrooge_operation/skgoperationpluginwidget.cpp
@@ -269,12 +269,12 @@ void SKGOperationPluginWidget::setWidgetEditionEnabled(QWidget* \
iWidget, bool iE line->setClearButtonShown(false);
}
}
- iWidget->setStyleSheet("background-image:url(" + m_frozenLogo + \
");background-repeat:no-repeat;background-clip: padding; background-position: top " + \
align + "; background-origin: content;"); + \
iWidget->setStyleSheet("background-image:url(" % m_frozenLogo % \
");background-repeat:no-repeat;background-clip: padding; background-position: top " % \
align % "; background-origin: content;"); iWidget->setProperty("frozen", true);
}
QString addOn = i18nc("A tool tip", "This field is frozen (it will not be \
affected by Fast Edition). Double click to unfreeze it");
- QString t = iWidget->toolTip().remove('\n' + addOn).remove(addOn);
+ QString t = iWidget->toolTip().remove('\n' % addOn).remove(addOn);
if(!iEnabled) {
t = iWidget->toolTip();
if(!t.isEmpty()) t += '\n';
@@ -396,8 +396,8 @@ void SKGOperationPluginWidget::onSelectionChanged()
double quantityVal = SKGServices::stringToDouble(quantity);
quantity = KGlobal::locale()->formatMoney(qAbs(quantityVal), "", 2);
if(quantity.startsWith(KGlobal::locale()->positiveSign())) quantity = \
quantity.right(quantity.length() - \
KGlobal::locale()->positiveSign().length());
- if(quantityVal > 0) quantity = '+' + quantity;
- else quantity = '-' + quantity;
+ if(quantityVal > 0) quantity = '+' % quantity;
+ else quantity = '-' % quantity;
ui.kAmountEdit->setText(quantity);
if(nbSelect > 1) {
@@ -1050,7 +1050,7 @@ void SKGOperationPluginWidget::setState(const QString& iState)
ui.kHideUselessOperation->blockSignals(previous);
ui.kFilterEdit->setText(filter);
if(!title.isEmpty()) {
- ui.kTitle->setComment("<html><body><b>" + SKGServices::stringToHtml(title) + \
"</b></body></html>"); + ui.kTitle->setComment("<html><body><b>" % \
SKGServices::stringToHtml(title) % "</b></body></html>"); ui.kTitle->show();
} else {
ui.kTitle->hide();
@@ -1150,7 +1150,7 @@ void SKGOperationPluginWidget::fillComboBoxes()
ui.kDisplayAccountCombo->addItem(i18nc("Noun", "All"));
SKGStringListList listAccount;
- getDocument()->executeSelectSqliteOrder(QString("SELECT t_ICON, t_name from \
v_account_display ") + (m_showClosedAccounts ? "" : "where t_close='N' order by \
t_name"), listAccount); + \
getDocument()->executeSelectSqliteOrder(QString("SELECT t_ICON, t_name from \
v_account_display ") % (m_showClosedAccounts ? "" : "where t_close='N' order by \
t_name"), listAccount);
int nbAccounts = listAccount.count();
if(nbAccounts == 0) {
@@ -1211,11 +1211,11 @@ void SKGOperationPluginWidget::openOperation(const \
SKGOperationObject& iOperatio
//Build where clause and title
int opid = iOperation.getID();
- QString wc = "id=" + SKGServices::intToString(opid);
+ QString wc = "id=" % SKGServices::intToString(opid);
opid = SKGServices::stringToInt(iOperation.getAttribute("i_group_id"));
- if(opid != 0) wc += " or i_group_id=" + SKGServices::intToString(opid);
- wc = '(' + wc + ')';
+ if(opid != 0) wc += " or i_group_id=" % SKGServices::intToString(opid);
+ wc = '(' % wc % ')';
QString title;
QString targetTable;
QString parametersTable;
@@ -1235,7 +1235,7 @@ void SKGOperationPluginWidget::openOperation(const \
SKGOperationObject& iOperatio QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from " + targetTable + " WHERE " + \
wc); + root.setAttribute("sqlOrder", "SELECT * from " % targetTable % " WHERE \
" % wc);
if(SKGMainPanel::getMainPanel()) \
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
@@ -1319,11 +1319,11 @@ void SKGOperationPluginWidget::onRefreshInformationZone()
//Compute where clause
QString filter = "1=1";
if(ui.kDisplayAccountCombo->currentIndex() > 0) {
- filter = "t_name='" + \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) + '\''; + \
filter = "t_name='" % \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) % '\''; }
SKGStringListList listTmp;
getDocument()->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CURRENTAMOUNT), TOTAL(f_CHECKED), \
TOTAL(f_COMING_SOON) from v_account_display WHERE " + filter, + \
"SELECT TOTAL(f_CURRENTAMOUNT), TOTAL(f_CHECKED), TOTAL(f_COMING_SOON) from \
v_account_display WHERE " % filter, listTmp);
if(listTmp.count() == 2) {
if(ui.kDisplayAccountCombo->currentIndex() > 0) {
@@ -1362,10 +1362,10 @@ void SKGOperationPluginWidget::onRefreshInformationZone()
} else if(m_modeInfoZone == 1) {
//Refresh reconciliation area
//Compute where clause
- QString filter = '\'' + \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) + '\''; + \
QString filter = '\'' % \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) % '\''; \
SKGStringListList listTmp; getDocument()->executeSelectSqliteOrder(
- "SELECT \
ABS(TOTAL(f_CURRENTAMOUNT_EXPENSE)),TOTAL(f_CURRENTAMOUNT_INCOME) FROM \
v_operation_display WHERE t_status='P' AND t_ACCOUNT=" + filter, + \
"SELECT ABS(TOTAL(f_CURRENTAMOUNT_EXPENSE)),TOTAL(f_CURRENTAMOUNT_INCOME) FROM \
v_operation_display WHERE t_status='P' AND t_ACCOUNT=" % filter, listTmp);
if(listTmp.count() == 2) {
bool wallet = false;
@@ -1395,7 +1395,7 @@ void SKGOperationPluginWidget::onRefreshInformationZone()
SKGStringListList listTmp2;
double diff = 0;
getDocument()->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CHECKED) from v_account_display WHERE t_name=" + \
filter, + "SELECT TOTAL(f_CHECKED) from v_account_display WHERE \
t_name=" % filter, listTmp2);
if(listTmp2.count() == 2) {
diff = SKGServices::stringToDouble(listTmp2.at(1).at(0)) - \
ui.kReconcilitorAmountEdit->value() * unit1.Value; @@ -1468,13 +1468,13 @@ void \
SKGOperationPluginWidget::onRefreshInformationZone()
double amo = i.value();
if(!addition.isEmpty() && amo > 0) addition += '+';
- addition += QString("<font color=\"") + (amo < 0 ? "red" : "black") \
+ "\">" +
- locale->formatMoney(amo, i.key(), \
decimalPerUnit[i.key()]) + + addition += QString("<font color=\"") % \
(amo < 0 ? "red" : "black") % "\">" % + \
locale->formatMoney(amo, i.key(), decimalPerUnit[i.key()]) % "</font>";
}
- QString v2 = QString("<font color=\"") + (amount < 0 ? "red" : "black") \
+ "\">" +
- locale->formatMoney(amount / unit1.Value, unit1.Symbol, \
unit1.NbDecimal) + + QString v2 = QString("<font color=\"") % (amount < 0 \
? "red" : "black") % "\">" % + locale->formatMoney(amount / \
unit1.Value, unit1.Symbol, unit1.NbDecimal) % "</font>";
if(nb == 0 || v2 == addition) {
addition = "";
@@ -1485,7 +1485,7 @@ void SKGOperationPluginWidget::onRefreshInformationZone()
if(nb) {
ui.kInfo->setText(i18np("Selection: %1 operation for %2", \
"Selection: %1 operations for %2", nb, v2)); if(!unit2.Symbol.isEmpty() && \
unit2.Value) {
- v2 = addition + "<font color=\"" + (amount < 0 ? "red" : \
"black") + "\">" + locale->formatMoney(amount / unit2.Value, unit2.Symbol, \
unit2.NbDecimal) + "</font>"; + v2 = addition % "<font color=\"" \
% (amount < 0 ? "red" : "black") % "\">" % locale->formatMoney(amount / unit2.Value, \
unit2.Symbol, unit2.NbDecimal) % "</font>"; }
ui.kInfo->setToolTip(i18np("Selection: %1 operation for %2", \
"Selection: %1 operations for %2", nb, v2)); } else {
@@ -1540,7 +1540,7 @@ void SKGOperationPluginWidget::onFilterChanged()
QString filter2 = m_operationWhereClause;
if(onOneAccount) {
QString account = ui.kDisplayAccountCombo->currentText();
- if(m_operationWhereClause.isEmpty()) filter2 = "t_ACCOUNT='" + \
SKGServices::stringToSqlString(account) + '\''; + \
if(m_operationWhereClause.isEmpty()) filter2 = "t_ACCOUNT='" % \
SKGServices::stringToSqlString(account) % '\'';
ui.kAccountEdit->setText(account);
}
@@ -1604,12 +1604,12 @@ void SKGOperationPluginWidget::onFastEdition()
//Build the where clause
QString wc;
- if(ui.kTypeEdit->hasFocus()) wc = "t_mode LIKE '" + \
SKGServices::stringToSqlString(ui.kTypeEdit->text()) + "%'";
- else if(ui.kUnitEdit->hasFocus()) wc = "t_UNIT LIKE '" + \
SKGServices::stringToSqlString(ui.kUnitEdit->text()) + "%'";
- else if(ui.kCategoryEdit->hasFocus()) wc = "t_CATEGORY LIKE '" + \
SKGServices::stringToSqlString(ui.kCategoryEdit->text()) + "%'";
- else if(ui.kTrackerEdit->hasFocus()) wc = "t_REFUND LIKE '" + \
SKGServices::stringToSqlString(ui.kTrackerEdit->text()) + "%'";
- else if(ui.kCommentEdit->hasFocus()) wc = "t_comment LIKE '" + \
SKGServices::stringToSqlString(ui.kCommentEdit->text()) + "%'";
- else if(ui.kPayeeEdit->hasFocus()) wc = "t_PAYEE LIKE '" + \
SKGServices::stringToSqlString(ui.kPayeeEdit->text()) + "%'"; + \
if(ui.kTypeEdit->hasFocus()) wc = "t_mode LIKE '" % \
SKGServices::stringToSqlString(ui.kTypeEdit->text()) % "%'"; + else \
if(ui.kUnitEdit->hasFocus()) wc = "t_UNIT LIKE '" % \
SKGServices::stringToSqlString(ui.kUnitEdit->text()) % "%'"; + else \
if(ui.kCategoryEdit->hasFocus()) wc = "t_CATEGORY LIKE '" % \
SKGServices::stringToSqlString(ui.kCategoryEdit->text()) % "%'"; + else \
if(ui.kTrackerEdit->hasFocus()) wc = "t_REFUND LIKE '" % \
SKGServices::stringToSqlString(ui.kTrackerEdit->text()) % "%'"; + else \
if(ui.kCommentEdit->hasFocus()) wc = "t_comment LIKE '" % \
SKGServices::stringToSqlString(ui.kCommentEdit->text()) % "%'"; + else \
if(ui.kPayeeEdit->hasFocus()) wc = "t_PAYEE LIKE '" % \
SKGServices::stringToSqlString(ui.kPayeeEdit->text()) % "%'";
if(!wc.isEmpty()) {
//Read Setting
@@ -1631,7 +1631,7 @@ void SKGOperationPluginWidget::onFastEdition()
//Look for last operation
if(m_lastFastEditionOperationFound != 0) {
- wc += " AND id<" + \
SKGServices::intToString(m_lastFastEditionOperationFound); + wc += " AND \
id<" % SKGServices::intToString(m_lastFastEditionOperationFound); }
//Add order by
@@ -2022,7 +2022,7 @@ void SKGOperationPluginWidget::onAddFakeOperation()
SKGStringListList listTmp2;
double diff = 0;
getDocument()->executeSelectSqliteOrder(
- "SELECT TOTAL(f_CHECKED) from v_account_display WHERE t_name='" + \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) + '\'', + \
"SELECT TOTAL(f_CHECKED) from v_account_display WHERE t_name='" % \
SKGServices::stringToSqlString(ui.kDisplayAccountCombo->currentText()) % '\'', \
listTmp2); if(listTmp2.count() == 2) {
diff = SKGServices::stringToDouble(listTmp2.at(1).at(0)) - \
ui.kReconcilitorAmountEdit->value() * unit.getAmount(); @@ -2048,7 +2048,7 @@ void \
SKGOperationPluginWidget::onValidatePointedOperations()
QString account = ui.kDisplayAccountCombo->currentText();
SKGObjectBase::SKGListSKGObjectBase list;
- err = getDocument()->getObjects("v_operation_display", "t_status='P' AND \
t_ACCOUNT='" + SKGServices::stringToSqlString(account) + '\'', list); + err = \
getDocument()->getObjects("v_operation_display", "t_status='P' AND t_ACCOUNT='" % \
SKGServices::stringToSqlString(account) % '\'', list); int nb = list.count();
if(err.isSucceeded()) {
SKGBEGINPROGRESSTRANSACTION(*getDocument(), i18nc("Noun, name of the user \
action", "Switch to checked"), err, nb);
diff --git a/skrooge_payee/skgpayeepluginwidget.cpp \
b/skrooge_payee/skgpayeepluginwidget.cpp index cc26a6a..f48e04d 100644
--- a/skrooge_payee/skgpayeepluginwidget.cpp
+++ b/skrooge_payee/skgpayeepluginwidget.cpp
@@ -238,7 +238,7 @@ void SKGPayeePluginWidget::onDoubleClick()
QString name = payee.getName();
//Build where clause and title
- QString wc = "t_PAYEE = '" + SKGServices::stringToSqlString(name) + '\'';
+ QString wc = "t_PAYEE = '" % SKGServices::stringToSqlString(name) % '\'';
QString title = i18nc("Noun, a list of items", "Operations assigned to payee \
'%1'", name);
//Open
@@ -247,7 +247,7 @@ void SKGPayeePluginWidget::onDoubleClick()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_display WHERE " \
+ wc); + root.setAttribute("sqlOrder", "SELECT * from v_operation_display \
WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
diff --git a/skrooge_report/skgreportplugin.cpp b/skrooge_report/skgreportplugin.cpp
index dfca51f..94a93be 100644
--- a/skrooge_report/skgreportplugin.cpp
+++ b/skrooge_report/skgreportplugin.cpp
@@ -229,11 +229,11 @@ void SKGReportPlugin::actionOpenReport()
wc2 += " OR ";
title += ',';
}
- wc += '\'' + SKGServices::stringToSqlString(tmp.getFullName()) + \
'\'';
- wc2 += "t_REALCATEGORY like '" + \
SKGServices::stringToSqlString(tmp.getFullName()) + "%'"; + wc += \
'\'' % SKGServices::stringToSqlString(tmp.getFullName()) % '\''; + \
wc2 += "t_REALCATEGORY like '" % SKGServices::stringToSqlString(tmp.getFullName()) % \
"%'"; title += i18n("'%1'", tmp.getFullName());
}
- wc += ") OR " + wc2;
+ wc += ") OR " % wc2;
} else if(table == "refund") {
wc = "r_refund_id in (";
title = i18nc("Noun, a list of items", "Operations followed by ");
@@ -284,7 +284,7 @@ void SKGReportPlugin::actionOpenReport()
wc += " OR ";
title += ',';
}
- wc += '(' + ruleWc + ')';
+ wc += '(' % ruleWc % ')';
title += i18n("'%1'", tmp.getSearchDescription());
}
}
diff --git a/skrooge_report/skgreportpluginwidget.cpp \
b/skrooge_report/skgreportpluginwidget.cpp index 68756d3..f764384 100644
--- a/skrooge_report/skgreportpluginwidget.cpp
+++ b/skrooge_report/skgreportpluginwidget.cpp
@@ -118,7 +118,7 @@ SKGReportPluginWidget::SKGReportPluginWidget(SKGDocumentBank* \
iDocument, bool iM
iDocument->getDistinctValues("parameters", "t_name", "t_uuid_parent like \
'%-operation'", properties); int nb = properties.count();
for(int i = 0; i < nb; ++i)
- m_attsForLines.push_back("p_" + properties.at(i));
+ m_attsForLines.push_back("p_" % properties.at(i));
m_attsForColumns += m_attsForLines;
@@ -300,7 +300,7 @@ void SKGReportPluginWidget::setState(const QString& iState)
ui.kTableWithGraph->setState(tableAndGraphState);
if(!title.isEmpty()) {
- ui.kTitle->setComment("<html><body><b>" + SKGServices::stringToHtml(title) + \
"</b></body></html>"); + ui.kTitle->setComment("<html><body><b>" % \
SKGServices::stringToHtml(title) % "</b></body></html>"); ui.kTitle->show();
ui.kResetInternalFilter->show();
} else {
@@ -332,7 +332,7 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, int colu \
if(!currentComment.isEmpty()) { currentComment.remove("<html><body><b>");
currentComment.remove("</b></body></html>");
- oTitle = SKGServices::htmlToString(currentComment) + ". ";
+ oTitle = SKGServices::htmlToString(currentComment) % ". ";
}
SKGTableWithGraph::DisplayAdditionalFlag mode = \
ui.kTableWithGraph->getAdditionalDisplayMode(); @@ -350,11 +350,11 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, int colu if(att \
== "#NOTHING#") att = ""; if(att.startsWith(QLatin1String("p_"))) {
QString propertyName = att.right(att.length() - 2);
- att = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" + propertyName \
+ "'), '#NULL#')"; + att = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" % propertyName \
% "'), '#NULL#')"; }
- if(att.isEmpty()) att = '\'' + i18nc("Noun", "All") + '\'';
+ if(att.isEmpty()) att = '\'' % i18nc("Noun", "All") % '\'';
- if(!attLine.isEmpty()) attLine += "||'" + OBJECTSEPARATOR + "'||";
+ if(!attLine.isEmpty()) attLine += "||'" % OBJECTSEPARATOR % "'||";
attLine += att;
}
@@ -364,13 +364,13 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, \
int colu
if(lineVal.isEmpty() && row == ui.kTableWithGraph->table()->rowCount() - 1) {
//This is the last sum
oWc = "";
- if(!attLine.isEmpty()) oWc = attLine + " NOT LIKE '%#NULL#%'";
+ if(!attLine.isEmpty()) oWc = attLine % " NOT LIKE '%#NULL#%'";
} else {
//This is not the last sum
- if(lineVal.isEmpty()) oWc += " IS NULL OR " + attLine;
- oWc += " = '" + SKGServices::stringToSqlString(lineVal) + "' OR " +
- attLine + " like '" + SKGServices::stringToSqlString(lineVal) + \
OBJECTSEPARATOR + "%'";
- oWc = '(' + oWc + ')';
+ if(lineVal.isEmpty()) oWc += " IS NULL OR " % attLine;
+ oWc += " = '" % SKGServices::stringToSqlString(lineVal) % "' OR " %
+ attLine % " like '" % SKGServices::stringToSqlString(lineVal) % \
OBJECTSEPARATOR % "%'"; + oWc = '(' % oWc % ')';
oTitle += i18nc("Noun", "'%1' with '%2'", title, lineVal);
}
@@ -380,7 +380,7 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, int colu if(att \
== "#NOTHING#") att = ""; if(att.startsWith(QLatin1String("p_"))) {
QString propertyName = att.right(att.length() - 2);
- att = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" + propertyName \
+ "'), '#NULL#')"; + att = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" % propertyName \
% "'), '#NULL#')"; }
if(!att.isEmpty()) {
if(column != 0 && column < nbCol) {
@@ -389,19 +389,19 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, int colu oTitle \
+= i18nc("Noun", " and "); }
- oWc += '(' + att;
+ oWc += '(' % att;
QString val = \
ui.kTableWithGraph->table()->horizontalHeaderItem(column)->text(); if(val.isEmpty()) \
{
- oWc += " IS NULL OR " + att + "=''";
+ oWc += " IS NULL OR " % att % "=''";
oTitle += i18nc("Noun", "'%1' are empty", \
ui.kColumns->currentText()); } else {
- oWc += " = '" + SKGServices::stringToSqlString(val) + "' OR " +
- att + " like '" + SKGServices::stringToSqlString(val) + \
OBJECTSEPARATOR + "%'"; + oWc += " = '" % \
SKGServices::stringToSqlString(val) % "' OR " % + att % " like \
'" % SKGServices::stringToSqlString(val) % OBJECTSEPARATOR % "%'";
oTitle += i18nc("Noun", "'%1' with '%2'", \
ui.kColumns->currentText(), val); }
oWc += ')';
} else {
- oWc = '(' + oWc + ") AND " + att + " NOT LIKE '%#NULL#%'";
+ oWc = '(' % oWc % ") AND " % att % " NOT LIKE '%#NULL#%'";
}
}
@@ -414,9 +414,9 @@ void \
SKGReportPluginWidget::getWhereClauseAndTitleForSelection(int row, int colu
QString during = ui.kPeriod->text();
if(ui.kPeriod->currentIndex() == 4) {
- during += SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) + ' \
' + SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())); + during += \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) % ' ' % \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())); } else \
if(ui.kPeriod->currentIndex() > 0) {
- if(ui.kNbIntervals->isVisible()) during += ' ' + \
SKGServices::intToString(ui.kNbIntervals->value()) + ' ' ; + \
if(ui.kNbIntervals->isVisible()) during += ' ' % \
SKGServices::intToString(ui.kNbIntervals->value()) % ' ' ; during += \
ui.kInterval->text(); }
@@ -442,7 +442,7 @@ void SKGReportPluginWidget::onDoubleClick(int row, int column)
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_consolidated WHERE \
" + wc); + root.setAttribute("sqlOrder", "SELECT * from \
v_operation_consolidated WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
@@ -484,7 +484,7 @@ void SKGReportPluginWidget::onOpenReport()
QString title2;
getWhereClauseAndTitleForSelection(selection.at(i)->row(), \
selection.at(i)->column(), wc2, title2); if(!wc2.isEmpty()) {
- if(!wc.isEmpty()) wc = '(' + wc + ") OR (" + wc2 + ')';
+ if(!wc.isEmpty()) wc = '(' % wc % ") OR (" % wc2 % ')';
else wc = wc2;
}
if(!title2.isEmpty()) {
@@ -599,8 +599,8 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo }
ui.kDateBegin->setDate(a);
ui.kDateEnd->setDate(b);
- wc = "strftime(" + strfFormat + ",d_date) = strftime(" + strfFormat + \
",'now')";
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "strftime(" + \
strfFormat + ",d_date) < strftime(" + strfFormat + ",'now')"; + wc = \
"strftime(" % strfFormat % ",d_date) = strftime(" % strfFormat % ",'now')"; + \
if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "strftime(" % strfFormat \
% ",d_date) < strftime(" % strfFormat % ",'now')";
if(oWhereClausForForecastData) *oWhereClausForForecastData = "d_date > \
date('now')"; break;
case 2:
@@ -629,10 +629,10 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo }
ui.kDateBegin->setDate(a);
ui.kDateEnd->setDate(b);
- wc = "strftime(" + strfFormat + ",d_date)>=strftime(" + strfFormat + \
",date('now','start of month', '-" + SKGServices::intToString(val) + ' ' + \
sqlInterval + "'))";
- if(forecastmode != 1) wc += " AND strftime(" + strfFormat + \
",d_date)<=strftime(" + strfFormat + ",date('now','start of month', '-" + \
SKGServices::intToString(one) + ' ' + sqlInterval + "'))"; //For forecast based on \
scheduled operations
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "strftime(" + \
strfFormat + ",d_date) < strftime(" + strfFormat + ",date('now','start of month', '-" \
+ SKGServices::intToString(val) + ' ' + sqlInterval + "'))";
- if(oWhereClausForForecastData) *oWhereClausForForecastData = "strftime(" + \
strfFormat + ",d_date) > strftime(" + strfFormat + ",date('now','start of month', '-" \
+ SKGServices::intToString(one) + ' ' + sqlInterval + "'))"; + wc = \
"strftime(" % strfFormat % ",d_date)>=strftime(" % strfFormat % ",date('now','start \
of month', '-" % SKGServices::intToString(val) % ' ' % sqlInterval % "'))"; + \
if(forecastmode != 1) wc += " AND strftime(" % strfFormat % ",d_date)<=strftime(" % \
strfFormat % ",date('now','start of month', '-" % SKGServices::intToString(one) % ' ' \
% sqlInterval % "'))"; //For forecast based on scheduled operations + \
if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "strftime(" % strfFormat \
% ",d_date) < strftime(" % strfFormat % ",date('now','start of month', '-" % \
SKGServices::intToString(val) % ' ' % sqlInterval % "'))"; + \
if(oWhereClausForForecastData) *oWhereClausForForecastData = "strftime(" % strfFormat \
% ",d_date) > strftime(" % strfFormat % ",date('now','start of month', '-" % \
SKGServices::intToString(one) % ' ' % sqlInterval % "'))"; break;
case 3:
//Last Interval
@@ -657,16 +657,16 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo a = \
a.addDays(1); ui.kDateBegin->setDate(a);
ui.kDateEnd->setDate(b);
- wc = "d_date > date('now','-" + SKGServices::intToString(val) + ' ' + \
sqlInterval + "')"; + wc = "d_date > date('now','-" % \
SKGServices::intToString(val) % ' ' % sqlInterval % "')";
if(forecastmode != 1) wc += " AND d_date<=date('now')"; //For forecast \
based on scheduled operations
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "d_date <= \
date('now','-" + SKGServices::intToString(val) + ' ' + sqlInterval + "')"; + \
if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "d_date <= \
date('now','-" % SKGServices::intToString(val) % ' ' % sqlInterval % \
"')";
if(oWhereClausForForecastData) *oWhereClausForForecastData = "d_date > \
date('now')"; break;
case 4:
// Custom Date
- wc = "d_date>='" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) + \
'\'';
- if(forecastmode != 1) wc += "AND d_date<='" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) + '\''; //For forecast \
based on scheduled operations
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "d_date<'" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) + '\''; + wc = \
"d_date>='" % SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) % '\''; \
+ if(forecastmode != 1) wc += "AND d_date<='" % \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) % '\''; //For forecast \
based on scheduled operations + if(oWhereClausForPreviousData) \
*oWhereClausForPreviousData = "d_date<'" % \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) % \
'\'';
if(oWhereClausForForecastData) *oWhereClausForForecastData = "d_date > \
date('now')"; break;
case 5:
@@ -696,10 +696,10 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo }
ui.kDateBegin->setDate(a);
ui.kDateEnd->setDate(b);
- wc = "d_date>='" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) + \
'\'';
- if(forecastmode != 1) wc += "AND d_date<='" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) + '\''; //For forecast \
based on scheduled operations
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "d_date<'" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) + \
'\'';
- if(oWhereClausForForecastData) *oWhereClausForForecastData = "d_date>'" + \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) + '\''; + wc = \
"d_date>='" % SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) % '\''; \
+ if(forecastmode != 1) wc += "AND d_date<='" % \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) % '\''; //For forecast \
based on scheduled operations + if(oWhereClausForPreviousData) \
*oWhereClausForPreviousData = "d_date<'" % \
SKGServices::dateToSqlString(QDateTime(ui.kDateBegin->date())) % '\''; + \
if(oWhereClausForForecastData) *oWhereClausForForecastData = "d_date>'" % \
SKGServices::dateToSqlString(QDateTime(ui.kDateEnd->date())) % '\''; break;
default:
// Take all dates
@@ -712,8 +712,8 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo break;
}
- wc = "((" + wc + ") OR d_date='0000') AND d_date!='0000-00-00'";
- if(oWhereClausForPreviousData) *oWhereClausForPreviousData = "((" + \
*oWhereClausForPreviousData + ") OR d_date='0000-00-00')"; + wc = "((" % wc % ") \
OR d_date='0000') AND d_date!='0000-00-00'"; + if(oWhereClausForPreviousData) \
*oWhereClausForPreviousData = "((" % *oWhereClausForPreviousData % ") OR \
d_date='0000-00-00')";
QString operationTypes;
if(ui.kIncomes->isChecked() && !ui.kExpenses->isChecked()) {
@@ -722,7 +722,7 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo \
operationTypes = "t_TYPEEXPENSE='-'"; }
if(operationTypes.length() > 0) {
- QString condition = " AND " + operationTypes;
+ QString condition = " AND " % operationTypes;
wc += condition;
if(oWhereClausForPreviousData) *oWhereClausForPreviousData += condition;
}
@@ -734,7 +734,7 @@ QString \
SKGReportPluginWidget::getConsolidatedWhereClause(QString* oWhereClausFo }
if(m_operationWhereClause.length()) {
- QString condition = " AND (" + m_operationWhereClause + ')';
+ QString condition = " AND (" % m_operationWhereClause % ')';
wc += condition;
if(oWhereClausForPreviousData) *oWhereClausForPreviousData += condition;
}
@@ -806,7 +806,7 @@ void SKGReportPluginWidget::dataModified(const QString& \
iTableName, int iIdTrans
SKGDocumentBank* doc = static_cast<SKGDocumentBank*>(getDocument());
if(doc) {
//Check if update is needed
- QString ParametersUsed = getState() + ';' + \
SKGServices::intToString(doc->getTransactionToProcess()); + QString \
ParametersUsed = getState() % ';' % \
SKGServices::intToString(doc->getTransactionToProcess()); if(ParametersUsed == \
m_previousParametersUsed) {
SKGTRACEL(10) << "Same parameters. Refresh ignored" << endl;
return;
@@ -863,7 +863,7 @@ void SKGReportPluginWidget::dataModified(const QString& \
iTableName, int iIdTrans SKGObjectBase::SKGListSKGObjectBase budgets;
if(err.isSucceeded()) err = doc->getObjects("v_budget",
\
"t_PERIOD>STRFTIME('%Y-%m', date('now')) AND "
- \
"t_PERIOD<=STRFTIME('%Y-%m', '" + SKGServices::dateToSqlString(QDateTime(lastDate)) + \
"')", budgets); + \
"t_PERIOD<=STRFTIME('%Y-%m', '" % SKGServices::dateToSqlString(QDateTime(lastDate)) % \
"')", budgets); int nb = budgets.count();
if(nb) {
//Get most active account
@@ -917,7 +917,7 @@ void SKGReportPluginWidget::dataModified(const QString& \
iTableName, int iIdTrans if(attCol == "#NOTHING#") attCol = "";
if(attCol.startsWith(QLatin1String("p_"))) {
QString propertyName = attCol.right(attCol.length() - 2);
- attCol = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" + propertyName \
+ "'), '#NULL#')"; + attCol = "IFNULL((SELECT t_value FROM \
parameters WHERE t_uuid_parent=v_operation_consolidated.id||'-operation' AND \
t_name='" % propertyName % "'), '#NULL#')"; }
QStringList listAtt = m_attsForLinesAdded;
@@ -929,23 +929,23 @@ void SKGReportPluginWidget::dataModified(const QString& \
iTableName, int iIdTrans if(att == "#NOTHING#") att = "";
if(att.startsWith(QLatin1String("p_"))) {
QString propertyName = att.right(att.length() - 2);
- att = "IFNULL((SELECT t_value FROM parameters WHERE \
t_uuid_parent=v_operation_consolidated.id||'-operation' AND t_name='" + propertyName \
+ "'), '#NULL#')"; + att = "IFNULL((SELECT t_value FROM \
parameters WHERE t_uuid_parent=v_operation_consolidated.id||'-operation' AND \
t_name='" % propertyName % "'), '#NULL#')"; }
- if(att.isEmpty()) att = '\'' + i18nc("Noun", "All") + '\'';
+ if(att.isEmpty()) att = '\'' % i18nc("Noun", "All") % '\'';
- if(!attLine.isEmpty()) attLine += "||'" + OBJECTSEPARATOR + \
"'||"; + if(!attLine.isEmpty()) attLine += "||'" % \
OBJECTSEPARATOR % "'||"; attLine += att;
}
if(modeHistory && !attCol.isEmpty()) {
tableName = "(SELECT ";
- if(attCol != "d_date") tableName += "(CASE WHEN " + \
conditionPrevious + " THEN '0000' ELSE d_date END) AS d_date, ";
- tableName += "(CASE WHEN " + conditionPrevious + " THEN \
'0000' ELSE " + attCol + "||(CASE WHEN " + conditionForecast + " THEN '999' ELSE '' \
END) END) AS " + m_attsForColumns[col ] + ",* FROM v_operation_consolidated) as \
v_operation_consolidated"; + if(attCol != "d_date") tableName \
+= "(CASE WHEN " % conditionPrevious % " THEN '0000' ELSE d_date END) AS d_date, "; + \
tableName += "(CASE WHEN " % conditionPrevious % " THEN '0000' ELSE " % attCol % \
"||(CASE WHEN " % conditionForecast % " THEN '999' ELSE '' END) END) AS " % \
m_attsForColumns[col ] % ",* FROM v_operation_consolidated) as \
v_operation_consolidated"; }
//Remove #NULL# columns and lines
- if(!attLine.isEmpty()) condition = '(' + condition + ") AND " + \
attLine + " NOT LIKE '%#NULL#%'";
- if(!attCol.isEmpty()) condition = '(' + condition + ") AND " + \
attCol + " NOT LIKE '%#NULL#%'"; + if(!attLine.isEmpty()) \
condition = '(' % condition % ") AND " % attLine % " NOT LIKE '%#NULL#%'"; + \
if(!attCol.isEmpty()) condition = '(' % condition % ") AND " % attCol % " NOT LIKE \
'%#NULL#%'";
if(err.isSucceeded()) err = doc->getConsolidatedView(tableName, \
attCol, attLine, "f_REALCURRENTAMOUNT", "TOTAL", condition, table); IFSKGTRACEL(10) \
{
diff --git a/skrooge_scheduled/skgscheduledplugin.cpp \
b/skrooge_scheduled/skgscheduledplugin.cpp index 7790f7d..4389be3 100644
--- a/skrooge_scheduled/skgscheduledplugin.cpp
+++ b/skrooge_scheduled/skgscheduledplugin.cpp
@@ -302,7 +302,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGScheduledPlugin::advices() const QString name = recu.getDisplayName();
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgscheduledplugin_notuptodate|" + idOper + ';' + \
amountLastOperation; + ad.uuid = "skgscheduledplugin_notuptodate|" % idOper % \
';' % amountLastOperation; ad.priority = 4;
ad.shortMessage = i18nc("Advice on making the best (short)", "Scheduled \
operation '%1' not uptodate", name); ad.longMessage = i18nc("Advice on making the \
best (long)", "The scheduled operation '%1' does not have the amount of the last \
inserted operation (%2)", name, amountLastOperation);
diff --git a/skrooge_scheduled/skgscheduledpluginwidget.cpp \
b/skrooge_scheduled/skgscheduledpluginwidget.cpp index b7f9449..ef55c49 100644
--- a/skrooge_scheduled/skgscheduledpluginwidget.cpp
+++ b/skrooge_scheduled/skgscheduledpluginwidget.cpp
@@ -119,7 +119,7 @@ void SKGScheduledPluginWidget::onDoubleClick()
SKGRecurrentOperationObject recOp(selection.at(0));
//Build where clause and title
- QString wc = "EXISTS(SELECT 1 FROM recurrentoperation s WHERE \
s.rd_operation_id=v_operation_display.id and s.id=" + \
SKGServices::intToString(recOp.getID()) + ") OR r_recurrentoperation_id=" + \
SKGServices::intToString(recOp.getID()); + QString wc = "EXISTS(SELECT 1 FROM \
recurrentoperation s WHERE s.rd_operation_id=v_operation_display.id and s.id=" % \
SKGServices::intToString(recOp.getID()) % ") OR r_recurrentoperation_id=" % \
SKGServices::intToString(recOp.getID());
QString title = i18nc("Noun, a list of items", "Recurrent operations");
//Open
@@ -128,7 +128,7 @@ void SKGScheduledPluginWidget::onDoubleClick()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_display WHERE " \
+ wc); + root.setAttribute("sqlOrder", "SELECT * from v_operation_display \
WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
@@ -163,7 +163,7 @@ void SKGScheduledPluginWidget::onJumpToTheOperation()
recOp.getParentOperation(op);
//Build where clause and title
- QString wc = "id=" + SKGServices::intToString(op.getID());
+ QString wc = "id=" % SKGServices::intToString(op.getID());
QString title = i18nc("Noun, a list of items", "Operation of the schedule");
//Open
@@ -172,7 +172,7 @@ void SKGScheduledPluginWidget::onJumpToTheOperation()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_display WHERE " \
+ wc); + root.setAttribute("sqlOrder", "SELECT * from v_operation_display \
WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
diff --git a/skrooge_search/skgalarmboardwidget.cpp \
b/skrooge_search/skgalarmboardwidget.cpp index f9b166d..8d063fd 100644
--- a/skrooge_search/skgalarmboardwidget.cpp
+++ b/skrooge_search/skgalarmboardwidget.cpp
@@ -104,11 +104,11 @@ void SKGAlarmBoardWidget::dataModified(const QString& \
iTableName, int iIdTransac //Build where clause
QString wc = "t_action_type='A'";
if(m_menuFavorite && m_menuFavorite->isChecked()) {
- wc = "t_bookmarked='Y' AND (" + wc + ')';
+ wc = "t_bookmarked='Y' AND (" % wc % ')';
}
SKGObjectBase::SKGListSKGObjectBase rules;
- SKGError err = doc->getObjects("v_rule", wc + " ORDER BY i_ORDER", \
rules); + SKGError err = doc->getObjects("v_rule", wc % " ORDER BY \
i_ORDER", rules); int nb = rules.count();
if(nb) {
for(int i = 0; err.isSucceeded() && i < nb; ++i) {
@@ -128,17 +128,17 @@ void SKGAlarmBoardWidget::dataModified(const QString& \
iTableName, int iIdTransac progressBar->setSizePolicy(sizePolicy);
//Set tooltip
- QString txt = alarm.Message + "<br>";
- txt += doc->formatMoney(alarm.Amount, primary) + " / " + \
doc->formatMoney(alarm.Limit, primary); + QString txt = \
alarm.Message % "<br>"; + txt += doc->formatMoney(alarm.Amount, \
primary) % " / " % doc->formatMoney(alarm.Limit, primary); \
if(!secondary.Symbol.isEmpty() && secondary.Value) {
- txt += "<br>" + doc->formatMoney(alarm.Amount, secondary) + \
" / " + doc->formatMoney(alarm.Limit, secondary); + txt += \
"<br>" % doc->formatMoney(alarm.Amount, secondary) % " / " % \
doc->formatMoney(alarm.Limit, secondary); }
progressBar->setToolTip(txt);
//Change color
double pourcent = 100 * alarm.Amount / alarm.Limit;
QString st = progressBar->styleSheet();
- st = QString(" QProgressBar { text-align: center; padding: \
0.5px;} QProgressBar::chunk {text-align: center; border-radius:4px; background-color: \
") + (pourcent < 70 ? "green" : (pourcent > 90 ? "red" : "yellow")) + ";}" + st; + \
st = QString(" QProgressBar { text-align: center; padding: 0.5px;} \
QProgressBar::chunk {text-align: center; border-radius:4px; background-color: ") % \
(pourcent < 70 ? "green" : (pourcent > 90 ? "red" : "yellow")) % ";}" % st; \
progressBar->setStyleSheet(st);
//Add progress bar
diff --git a/skrooge_search/skgsearchplugin.cpp b/skrooge_search/skgsearchplugin.cpp
index c7788f9..1ce52f6 100644
--- a/skrooge_search/skgsearchplugin.cpp
+++ b/skrooge_search/skgsearchplugin.cpp
@@ -400,7 +400,7 @@ QList< SKGInterfacePlugin::SKGAdvice > SKGSearchPlugin::advices() \
const double pourcent = 100 * alarm.Amount / alarm.Limit;
if(pourcent >= 80) {
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgsearchplugin_alarm|" + \
SKGServices::intToString(rule.getID()); + ad.uuid = \
"skgsearchplugin_alarm|" % SKGServices::intToString(rule.getID()); ad.priority = 9;
ad.shortMessage = alarm.Message;
ad.longMessage = i18nc("Advice on making the best (long)", "Take \
care to your alarms.<br> %1.<br>%2 / %3", alarm.Message, \
m_currentBankDocument->formatMoney(alarm.Amount, primary), \
m_currentBankDocument->formatMoney(alarm.Limit, primary));
diff --git a/skrooge_search/skgsearchpluginwidget.cpp \
b/skrooge_search/skgsearchpluginwidget.cpp index 65ad71c..c519840 100644
--- a/skrooge_search/skgsearchpluginwidget.cpp
+++ b/skrooge_search/skgsearchpluginwidget.cpp
@@ -92,8 +92,8 @@ SKGSearchPluginWidget::SKGSearchPluginWidget(SKGDocument* \
iDocument)
iDocument->getDistinctValues("parameters", "t_name", "t_uuid_parent like \
'%-operation'", properties); int nb = properties.count();
for(int i = 0; i < nb; ++i) {
- attributeForQuery.push_back("p_" + properties.at(i));
- attributeForUpdate.push_back("p_" + properties.at(i));
+ attributeForQuery.push_back("p_" % properties.at(i));
+ attributeForUpdate.push_back("p_" % properties.at(i));
}
ui.kQueryCreator->setParameters(iDocument, "v_operation_consolidated", \
attributeForQuery); @@ -387,7 +387,7 @@ void SKGSearchPluginWidget::onUp()
double order = rule.getOrder();
SKGStringListList result;
- err = getDocument()->executeSelectSqliteOrder("SELECT f_sortorder from \
rule where f_sortorder<" + SKGServices::doubleToString(order) + " ORDER BY \
f_sortorder DESC", result); + err = \
getDocument()->executeSelectSqliteOrder("SELECT f_sortorder from rule where \
f_sortorder<" % SKGServices::doubleToString(order) % " ORDER BY f_sortorder DESC", \
result); if(err.isSucceeded()) {
if(result.count() == 2) {
order = SKGServices::stringToDouble(result.at(1).at(0)) - 1;
@@ -426,7 +426,7 @@ void SKGSearchPluginWidget::onDown()
double order = rule.getOrder();
SKGStringListList result;
- err = getDocument()->executeSelectSqliteOrder("SELECT f_sortorder from \
rule where f_sortorder>" + SKGServices::doubleToString(order) + " ORDER BY \
f_sortorder ASC", result); + err = \
getDocument()->executeSelectSqliteOrder("SELECT f_sortorder from rule where \
f_sortorder>" % SKGServices::doubleToString(order) % " ORDER BY f_sortorder ASC", \
result); if(err.isSucceeded()) {
if(result.count() == 2) {
order = SKGServices::stringToDouble(result.at(1).at(0)) + 1;
@@ -488,7 +488,7 @@ void SKGSearchPluginWidget::open(const SKGRuleObject& iRule)
_SKGTRACEIN(10, "SKGSearchPluginWidget::open");
//Build where clause and title
- QString wc = "i_SUBOPID in (SELECT i_SUBOPID FROM v_operation_prop WHERE " + \
iRule.getSelectSqlOrder() + ')'; + QString wc = "i_SUBOPID in (SELECT i_SUBOPID \
FROM v_operation_prop WHERE " % iRule.getSelectSqlOrder() % ')';
QString title = i18nc("Noun, a list of items", "Sub operations corresponding to \
rule '%1'", iRule.getSearchDescription());
//Open
@@ -497,7 +497,7 @@ void SKGSearchPluginWidget::open(const SKGRuleObject& iRule)
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_consolidated WHERE \
" + wc); + root.setAttribute("sqlOrder", "SELECT * from \
v_operation_consolidated WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
@@ -547,15 +547,15 @@ void SKGSearchPluginWidget::onEditorModified()
SKGStringListList result;
int vAll = 0;
- getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE " + wc, result); + \
getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE " % wc, result);
if(result.count() == 2) vAll = SKGServices::stringToInt(result.at(1).at(0));
int vImported = 0;
- getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE t_imported!='N' AND " + wc, result); + \
getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE t_imported!='N' AND " % wc, result);
if(result.count() == 2) vImported = \
SKGServices::stringToInt(result.at(1).at(0));
int vNotValidatedl = 0;
- getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE t_imported='P' AND " + wc, result); + \
getDocument()->executeSelectSqliteOrder("SELECT count(distinct(id)) from \
v_operation_prop WHERE t_imported='P' AND " % wc, result);
if(result.count() == 2) vNotValidatedl = \
SKGServices::stringToInt(result.at(1).at(0));
ui.kQueryInfo->setText(i18np("%1 operation found (%2 imported, %3 not yet \
validated).", "%1 operations found (%2 imported, %3 not yet validated).", vAll, \
vImported, vNotValidatedl));
diff --git a/skrooge_tracker/skgtrackerpluginwidget.cpp \
b/skrooge_tracker/skgtrackerpluginwidget.cpp index 74e1cd2..6ca6266 100644
--- a/skrooge_tracker/skgtrackerpluginwidget.cpp
+++ b/skrooge_tracker/skgtrackerpluginwidget.cpp
@@ -225,7 +225,7 @@ void SKGTrackerPluginWidget::onDoubleClick()
QString name = tracker.getName();
//Build where clause and title
- QString wc = "t_REALREFUND = '" + SKGServices::stringToSqlString(name) + \
'\''; + QString wc = "t_REALREFUND = '" % SKGServices::stringToSqlString(name) \
% '\'';
QString title = i18nc("Noun, a list of items", "Sub operations followed by \
tracker '%1'", name);
//Open
@@ -234,7 +234,7 @@ void SKGTrackerPluginWidget::onDoubleClick()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_consolidated \
WHERE " + wc); + root.setAttribute("sqlOrder", "SELECT * from \
v_operation_consolidated WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
diff --git a/skrooge_unit/skgunitboardwidget.cpp \
b/skrooge_unit/skgunitboardwidget.cpp index 09b01e5..96f1e7d 100644
--- a/skrooge_unit/skgunitboardwidget.cpp
+++ b/skrooge_unit/skgunitboardwidget.cpp
@@ -123,7 +123,7 @@ void SKGUnitBoardWidget::dataModified(const QString& iTableName, \
int iIdTransact if(wc.isEmpty()) wc = "1=0";
SKGObjectBase::SKGListSKGObjectBase objs;
- SKGError err = getDocument()->getObjects("v_unit_display", wc + " ORDER \
BY t_type DESC, t_name ASC", objs); + SKGError err = \
getDocument()->getObjects("v_unit_display", wc % " ORDER BY t_type DESC, t_name ASC", \
objs); if(err.isSucceeded()) {
QString html;
html += "<html><body>";
@@ -136,9 +136,9 @@ void SKGUnitBoardWidget::dataModified(const QString& iTableName, \
int iIdTransact QString type = obj.getAttribute("t_TYPENLS");
if(lastTitle != type) {
lastTitle = type;
- html += "<tr><td><b>" + \
SKGServices::stringToHtml(lastTitle) + "</b></td></tr>"; + \
html += "<tr><td><b>" % SKGServices::stringToHtml(lastTitle) % "</b></td></tr>"; }
- html += QString("<tr><td><a href=\"" + \
SKGServices::stringToHtml(obj.getSymbol()) + "\">") + \
SKGServices::stringToHtml(obj.getDisplayName()) + "</a></td><td align=\"right\">"; + \
html += QString("<tr><td><a href=\"" % SKGServices::stringToHtml(obj.getSymbol()) % \
"\">") % SKGServices::stringToHtml(obj.getDisplayName()) % "</a></td><td \
align=\"right\">"; QString unitSymbol = primary.Symbol;
if(obj.getType() == SKGUnitObject::INDEX) unitSymbol = ' ';
html += \
SKGServices::stringToHtml(locale->formatMoney(SKGServices::stringToDouble(obj.getAttribute("f_CURRENTAMOUNT")), \
unitSymbol , primary.NbDecimal)); @@ -176,7 +176,7 @@ void \
SKGUnitBoardWidget::onOpen(const QString& iLink) int unitid = unit.getID();
//Build where clause and title
- QString wc = "rc_unit_id=" + SKGServices::intToString(unitid);
+ QString wc = "rc_unit_id=" % SKGServices::intToString(unitid);
QString title = i18nc("A list of operations made on the specified unit", \
"Operations with unit equal to '%1'", unit.getName());
//Open
diff --git a/skrooge_unit/skgunitplugin.cpp b/skrooge_unit/skgunitplugin.cpp
index 0f6fd3f..a7a5977 100644
--- a/skrooge_unit/skgunitplugin.cpp
+++ b/skrooge_unit/skgunitplugin.cpp
@@ -255,7 +255,7 @@ QList< SKGInterfacePlugin::SKGAdvice > SKGUnitPlugin::advices() \
const QString unit = result.at(1).at(1);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgunitplugin_primaryunit|" + unit;
+ ad.uuid = "skgunitplugin_primaryunit|" % unit;
ad.priority = 8;
ad.shortMessage = i18nc("Advice on making the best (short)", "Define a \
primary currency"); ad.longMessage = i18nc("Advice on making the best (long)", "To \
avoid misunderstanding and conflicts between units at conversion time, you should \
define a primary currency. It is the currency against which all other will be \
converted"); @@ -272,7 +272,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGUnitPlugin::advices() const QString unit = result.at(1).at(1);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgunitplugin_secondaryunit|" + unit;
+ ad.uuid = "skgunitplugin_secondaryunit|" % unit;
ad.priority = 2;
ad.shortMessage = i18nc("Advice on making the best (short)", "Define a \
secondary currency"); ad.longMessage = i18nc("Advice on making the best (long)", \
"When a secondary unit is defined, Skrooge will display it as an additional amount \
information."); @@ -291,7 +291,7 @@ QList< SKGInterfacePlugin::SKGAdvice > \
SKGUnitPlugin::advices() const QString internet_code = line.at(1);
SKGInterfacePlugin::SKGAdvice ad;
- ad.uuid = "skgunitplugin_notdownloaded|" + unit;
+ ad.uuid = "skgunitplugin_notdownloaded|" % unit;
ad.priority = 5;
ad.shortMessage = i18nc("Advice on making the best (short)", "Unit '%1' has \
not been downloaded for more than a month", unit);
ad.longMessage = i18nc("Advice on making the best (long)", "Don't forget \
download units to have a better view of your accounts");
diff --git a/skrooge_unit/skgunitpluginwidget.cpp \
b/skrooge_unit/skgunitpluginwidget.cpp index bec9fb5..6743263 100644
--- a/skrooge_unit/skgunitpluginwidget.cpp
+++ b/skrooge_unit/skgunitpluginwidget.cpp
@@ -228,11 +228,11 @@ void SKGUnitPluginWidget::onSelectionChanged()
ui.kUnitValueDownload->setEnabled(nbSelect > 0);
//Fill values
- QString wc = "rd_unit_id=(select id from unit where t_name='" + \
SKGServices::stringToSqlString(ui.kNameCreatorUnit->text()) + "')"; + QString wc = \
"rd_unit_id=(select id from unit where t_name='" % \
SKGServices::stringToSqlString(ui.kNameCreatorUnit->text()) % "')";
SKGObjectModel* objectModel = \
static_cast<SKGObjectModel*>(ui.kUnitValueTableViewEdition->model()); \
if(objectModel) {
objectModel->setFilter(""); //Correction 2299600: to be sure that refresh \
will be done
- objectModel->setFilter(wc + " order by d_date desc");
+ objectModel->setFilter(wc % " order by d_date desc");
objectModel->refresh();
}
@@ -428,7 +428,7 @@ void SKGUnitPluginWidget::onDoubleClickUnit()
int unitid = unit.getID();
//Build where clause and title
- QString wc = "rc_unit_id=" + SKGServices::intToString(unitid);
+ QString wc = "rc_unit_id=" % SKGServices::intToString(unitid);
QString title = i18nc("Noun, a list of items", "Operations with unit equal \
to '%1'", unit.getName());
//Open
@@ -437,7 +437,7 @@ void SKGUnitPluginWidget::onDoubleClickUnit()
QDomDocument doc("SKGML");
QDomElement root = doc.createElement("parameters");
doc.appendChild(root);
- root.setAttribute("sqlOrder", "SELECT * from v_operation_display WHERE " \
+ wc); + root.setAttribute("sqlOrder", "SELECT * from v_operation_display \
WHERE " % wc);
SKGMainPanel::getMainPanel()->openPage(SKGMainPanel::getMainPanel()->getPluginByName("Debug \
plugin"), -1, doc.toString()); } else {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic