Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/views/kaccountsview_p.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include "kaccountsview.h" | 20 | #include "kaccountsview.h" | ||
21 | 21 | | |||
22 | // ---------------------------------------------------------------------------- | 22 | // ---------------------------------------------------------------------------- | ||
23 | // QT Includes | 23 | // QT Includes | ||
24 | 24 | | |||
25 | #include <QAction> | 25 | #include <QAction> | ||
26 | #include <QPointer> | 26 | #include <QPointer> | ||
27 | #include <QFile> | ||||
27 | 28 | | |||
28 | // ---------------------------------------------------------------------------- | 29 | // ---------------------------------------------------------------------------- | ||
29 | // KDE Includes | 30 | // KDE Includes | ||
30 | 31 | | |||
31 | #include <KMessageBox> | 32 | #include <KMessageBox> | ||
32 | 33 | | |||
33 | // ---------------------------------------------------------------------------- | 34 | // ---------------------------------------------------------------------------- | ||
34 | // Project Includes | 35 | // Project Includes | ||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Line(s) | 308 | case AccountChildrenOpen: | |||
308 | a->setToolTip(i18n("All subaccounts must be closed before the account can be closed")); | 309 | a->setToolTip(i18n("All subaccounts must be closed before the account can be closed")); | ||
309 | return; | 310 | return; | ||
310 | case AccountScheduleReference: | 311 | case AccountScheduleReference: | ||
311 | a->setToolTip(i18n("This account is still included in an active schedule")); | 312 | a->setToolTip(i18n("This account is still included in an active schedule")); | ||
312 | return; | 313 | return; | ||
313 | } | 314 | } | ||
314 | } | 315 | } | ||
315 | 316 | | |||
317 | void setCustomIcon(const QString iconFilename) | ||||
wojnilowicz: You should pass by reference like that
```
const QString& iconFilename
```
| |||||
318 | { | ||||
319 | const auto kmmFile = MyMoneyFile::instance(); | ||||
320 | if (kmmFile->isStandardAccount(m_currentAccount.id())) | ||||
321 | return; | ||||
322 | | ||||
323 | const QFile iconFile(iconFilename); | ||||
324 | if (iconFile.exists()) { | ||||
325 | MyMoneyFileTransaction ft; | ||||
326 | m_currentAccount.setValue(QStringLiteral("kmm_custom_icon_file"), iconFilename); | ||||
327 | kmmFile->modifyAccount(m_currentAccount); | ||||
328 | ft.commit(); | ||||
329 | } | ||||
330 | } | ||||
331 | | ||||
332 | void removeCustomIcon() | ||||
333 | { | ||||
334 | const auto kmmFile = MyMoneyFile::instance(); | ||||
335 | if (kmmFile->isStandardAccount(m_currentAccount.id())) | ||||
336 | return; | ||||
337 | | ||||
338 | MyMoneyFileTransaction ft; | ||||
339 | m_currentAccount.deletePair(QStringLiteral("kmm_custom_icon_file")); | ||||
340 | kmmFile->modifyAccount(m_currentAccount); | ||||
341 | ft.commit(); | ||||
342 | } | ||||
343 | | ||||
316 | KAccountsView *q_ptr; | 344 | KAccountsView *q_ptr; | ||
317 | Ui::KAccountsView *ui; | 345 | Ui::KAccountsView *ui; | ||
318 | bool m_haveUnusedCategories; | 346 | bool m_haveUnusedCategories; | ||
319 | MyMoneyAccount m_currentAccount; | 347 | MyMoneyAccount m_currentAccount; | ||
320 | QMap<QString, KMyMoneyPlugin::OnlinePlugin*>* m_onlinePlugins; | 348 | QMap<QString, KMyMoneyPlugin::OnlinePlugin*>* m_onlinePlugins; | ||
321 | }; | 349 | }; | ||
322 | 350 | | |||
323 | #endif | 351 | #endif |
You should pass by reference like that