Renamed some core classes.
This commit is contained in:
parent
c3f32119db
commit
be51f0c3c1
@ -399,13 +399,13 @@ set(APP_SOURCES
|
|||||||
src/core/messagesproxymodel.cpp
|
src/core/messagesproxymodel.cpp
|
||||||
src/core/feedsmodel.cpp
|
src/core/feedsmodel.cpp
|
||||||
src/core/feedsproxymodel.cpp
|
src/core/feedsproxymodel.cpp
|
||||||
src/core/feedsmodelcategory.cpp
|
src/core/category.cpp
|
||||||
src/core/feedsmodelrootitem.cpp
|
src/core/rootitem.cpp
|
||||||
src/core/feedsmodelfeed.cpp
|
src/core/feed.cpp
|
||||||
src/core/parsingfactory.cpp
|
src/core/parsingfactory.cpp
|
||||||
src/core/feeddownloader.cpp
|
src/core/feeddownloader.cpp
|
||||||
src/core/feedsimportexportmodel.cpp
|
src/core/feedsimportexportmodel.cpp
|
||||||
src/core/feedsmodelrecyclebin.cpp
|
src/core/recyclebin.cpp
|
||||||
src/core/feedsselection.cpp
|
src/core/feedsselection.cpp
|
||||||
|
|
||||||
# NETWORK-WEB sources.
|
# NETWORK-WEB sources.
|
||||||
|
@ -198,6 +198,29 @@ Berte také na paměti, že některé prostředky webových stránek jsou intern
|
|||||||
<translation>Obnovení nastavení nebylo spuštěno. Ujistěte se, že cílový adresář je zapisovatelný.</translation>
|
<translation>Obnovení nastavení nebylo spuštěno. Ujistěte se, že cílový adresář je zapisovatelný.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation>%1 (kategorie)%2%3</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation>
|
||||||
|
Tato kategorie neobsahuje žádné položky.</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation>
|
||||||
|
<numerusform>%n nepřečtená zpráva.</numerusform>
|
||||||
|
<numerusform>%n nepřečtené zprávy.</numerusform>
|
||||||
|
<numerusform>%n nepřečtených zpráv.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -425,6 +448,50 @@ Klikněte sem pro otevření nadřazeného adresáře.</translation>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation>nepoužívá auto-aktualizace</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation>používá globální nastavení</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation>
|
||||||
|
<numerusform>používá specifické nastavení (%n minuta do další aktualizace)</numerusform>
|
||||||
|
<numerusform>používá specifické nastavení (%n minuty do další aktualizace)</numerusform>
|
||||||
|
<numerusform>používá specifické nastavení (%n minut do další aktualizace)</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation>%1 (%2)%3
|
||||||
|
|
||||||
|
Síťový status: %6
|
||||||
|
Kódování: %4
|
||||||
|
Automatický update: %5</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation>
|
||||||
|
<numerusform>%n nepřečtená zpráva.</numerusform>
|
||||||
|
<numerusform>%n nepřečtené zprávy.</numerusform>
|
||||||
|
<numerusform>%n nepřečtených zpráv.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -518,98 +585,6 @@ Klikněte sem pro otevření nadřazeného adresáře.</translation>
|
|||||||
<translation>Import byl zcela úspěšný.</translation>
|
<translation>Import byl zcela úspěšný.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n nepřečtená zpráva.</numerusform>
|
|
||||||
<numerusform>%n nepřečtené zprávy.</numerusform>
|
|
||||||
<numerusform>%n nepřečtených zpráv.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation>%1 (kategorie)%2%3</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation>
|
|
||||||
Tato kategorie neobsahuje žádné položky.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>nepoužívá auto-aktualizace</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>používá globální nastavení</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>používá specifické nastavení (%n minuta do další aktualizace)</numerusform>
|
|
||||||
<numerusform>používá specifické nastavení (%n minuty do další aktualizace)</numerusform>
|
|
||||||
<numerusform>používá specifické nastavení (%n minut do další aktualizace)</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n nepřečtená zpráva.</numerusform>
|
|
||||||
<numerusform>%n nepřečtené zprávy.</numerusform>
|
|
||||||
<numerusform>%n nepřečtených zpráv.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation>%1 (%2)%3
|
|
||||||
|
|
||||||
Síťový status: %6
|
|
||||||
Kódování: %4
|
|
||||||
Automatický update: %5</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation>Koš</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation>Koš obsahuje všechny smazané zprávy ze všech kanálů.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation>Koš
|
|
||||||
%1</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n smazaná zpráva.</numerusform>
|
|
||||||
<numerusform>%n smazané zprávy.</numerusform>
|
|
||||||
<numerusform>%n smazaných zpráv.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2981,6 +2956,31 @@ Přejít na web aplikace a stáhnout jej ručně.</translation>
|
|||||||
<translation>Vítá vás %1 %2.</translation>
|
<translation>Vítá vás %1 %2.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation>Koš</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation>Koš obsahuje všechny smazané zprávy ze všech kanálů.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation>Koš
|
||||||
|
%1</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation>
|
||||||
|
<numerusform>%n smazaná zpráva.</numerusform>
|
||||||
|
<numerusform>%n smazané zprávy.</numerusform>
|
||||||
|
<numerusform>%n smazaných zpráv.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,27 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -415,6 +436,44 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -508,88 +567,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation>Mülleimer</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation>Der Mülleimer enthält die gelöschten Nachrichten aus allen Feeds.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2944,6 +2921,29 @@ Go to application website to obtain it manually.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished">Mülleimer</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished">Der Mülleimer enthält die gelöschten Nachrichten aus allen Feeds.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,27 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -415,6 +436,44 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -508,88 +567,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2939,6 +2916,29 @@ Go to application website to obtain it manually.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -242,6 +242,30 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/category.cpp" line="61"/>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/category.cpp" line="65"/>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../src/core/category.cpp" line="70"/>
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -510,6 +534,49 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/feed.cpp" line="331"/>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/feed.cpp" line="336"/>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../src/core/feed.cpp" line="342"/>
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/feed.cpp" line="350"/>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../src/core/feed.cpp" line="363"/>
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -623,100 +690,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelcategory.cpp" line="62"/>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelcategory.cpp" line="66"/>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<location filename="../src/core/feedsmodelcategory.cpp" line="71"/>
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelfeed.cpp" line="331"/>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelfeed.cpp" line="336"/>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<location filename="../src/core/feedsmodelfeed.cpp" line="342"/>
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelfeed.cpp" line="350"/>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<location filename="../src/core/feedsmodelfeed.cpp" line="363"/>
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelrecyclebin.cpp" line="31"/>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelrecyclebin.cpp" line="32"/>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/core/feedsmodelrecyclebin.cpp" line="96"/>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<location filename="../src/core/feedsmodelrecyclebin.cpp" line="96"/>
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -3662,6 +3635,33 @@ currently installed one.</source>
|
|||||||
<translation>rotter.martinos@gmail.com</translation>
|
<translation>rotter.martinos@gmail.com</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/recyclebin.cpp" line="31"/>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/recyclebin.cpp" line="32"/>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/core/recyclebin.cpp" line="96"/>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../src/core/recyclebin.cpp" line="96"/>
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,27 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished">%1 (catégorie)%2%3</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -415,6 +436,44 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">Ne pas utiliser la mise à jour automatique</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">Utiliser les paramètres globaux</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -508,89 +567,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n message(s) non lu(s).</numerusform>
|
|
||||||
<numerusform>%n message(s) non lu(s).</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation>%1 (catégorie)%2%3</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>Ne pas utiliser la mise à jour automatique</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>Utiliser les paramètres globaux</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform>%n message(s) non lu(s).</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation>Poubelle</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation>Corbeille
|
|
||||||
%1</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2956,6 +2932,30 @@ Aller sur le site de l'application pour les obtenir manuellement.</translat
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished">Poubelle</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished">Corbeille
|
||||||
|
%1</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,27 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -415,6 +436,44 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">non utilizza l'auto-aggiornamento</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">utilizza impostazioni globali</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -508,88 +567,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n messaggio(i) non letto.</numerusform>
|
|
||||||
<numerusform>%n messaggio(i) non letti.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>non utilizza l'auto-aggiornamento</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>utilizza impostazioni globali</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform>%n messaggio(i) non letti.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation type="unfinished">
|
|
||||||
<numerusform></numerusform>
|
|
||||||
<numerusform></numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2944,6 +2921,29 @@ Go to application website to obtain it manually.</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform></numerusform>
|
||||||
|
<numerusform></numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,29 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation>Herstel van de instellingen werd niet gestart. Zorg ervoor dat de uitvoermap beschrijfbaar is.</translation>
|
<translation>Herstel van de instellingen werd niet gestart. Zorg ervoor dat de uitvoermap beschrijfbaar is.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished">%1 (categorie)%2%3</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
|
||||||
|
Deze categorie bevat geen nested items.</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n ongelezen bericht.</numerusform>
|
||||||
|
<numerusform>%n ongelezen berichten.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -417,6 +440,48 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">automatisch bijwerken niet gebruiken</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">gebruik algemene instellingen</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>gebruik specifieke instellingen (%n minuut voor volgende automatische update)</numerusform>
|
||||||
|
<numerusform>gebruik specifieke instellingen (%n minuten voor volgende automatische update)</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished">%1 (%2)%3
|
||||||
|
|
||||||
|
Netwerk status: %6
|
||||||
|
Coderen: %4
|
||||||
|
Auto-update status: %5</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n ongelezen bericht.</numerusform>
|
||||||
|
<numerusform>%n ongelezen berichten.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -510,95 +575,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation>Importeren is helemaal geslaagd.</translation>
|
<translation>Importeren is helemaal geslaagd.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n ongelezen bericht.</numerusform>
|
|
||||||
<numerusform>%n ongelezen berichten.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation>%1 (categorie)%2%3</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation>
|
|
||||||
|
|
||||||
Deze categorie bevat geen nested items.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>automatisch bijwerken niet gebruiken</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>gebruik algemene instellingen</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>gebruik specifieke instellingen (%n minuut voor volgende automatische update)</numerusform>
|
|
||||||
<numerusform>gebruik specifieke instellingen (%n minuten voor volgende automatische update)</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n ongelezen bericht.</numerusform>
|
|
||||||
<numerusform>%n ongelezen berichten.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation>%1 (%2)%3
|
|
||||||
|
|
||||||
Netwerk status: %6
|
|
||||||
Coderen: %4
|
|
||||||
Auto-update status: %5</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation>Prullenbak</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation>De prullenbak bevat alle verwijderde berichten van alle feeds.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation>Prullenbak
|
|
||||||
%1</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n verwijderde bericht(en).</numerusform>
|
|
||||||
<numerusform>%n verwijderde bericht(en).</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2981,6 +2957,30 @@ Ga naar RRSguard website en download het handmatig.</translation>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished">Prullenbak</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished">De prullenbak bevat alle verwijderde berichten van alle feeds.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished">Prullenbak
|
||||||
|
%1</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n verwijderde bericht(en).</numerusform>
|
||||||
|
<numerusform>%n verwijderde bericht(en).</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -196,6 +196,28 @@ Also note that some resources are cached by internal web browser. Thus, after ch
|
|||||||
<translation>Inställningsåterställning startades inte. Tillse att utdatamappen är skrivbar.</translation>
|
<translation>Inställningsåterställning startades inte. Tillse att utdatamappen är skrivbar.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Category</name>
|
||||||
|
<message>
|
||||||
|
<source>%1 (category)%2%3</source>
|
||||||
|
<extracomment>Tooltip for standard feed.</extracomment>
|
||||||
|
<translation type="unfinished">%1 (kategori)%2%3</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>
|
||||||
|
This category does not contain any nested items.</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
Denna kategori innehåller inga objekt.</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n oläst meddelande.</numerusform>
|
||||||
|
<numerusform>%n olästa meddelanden.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>DatabaseCleaner</name>
|
<name>DatabaseCleaner</name>
|
||||||
<message>
|
<message>
|
||||||
@ -417,6 +439,48 @@ Click here to open parent directory.</source>
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Feed</name>
|
||||||
|
<message>
|
||||||
|
<source>does not use auto-update</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">Uppdateras inte automatiskt</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>uses global settings</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">Globala inställningar</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
||||||
|
<extracomment>Describes feed auto-update status.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>Anpassade inställningar. (%n minut till nästa auto-uppdatering)</numerusform>
|
||||||
|
<numerusform>Anpassade inställningar. (%n minuter till nästa auto-uppdatering)</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 (%2)%3
|
||||||
|
|
||||||
|
Network status: %6
|
||||||
|
Encoding: %4
|
||||||
|
Auto-update status: %5</source>
|
||||||
|
<extracomment>Tooltip for feed.</extracomment>
|
||||||
|
<translation type="unfinished">%1 (%2)%3
|
||||||
|
|
||||||
|
Nätverksstatus: %6
|
||||||
|
Kodning: %4
|
||||||
|
Uppdateringsstatus: %5</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n unread message(s).</source>
|
||||||
|
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n oläst meddelande.</numerusform>
|
||||||
|
<numerusform>%n olästa meddelanden.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FeedMessageViewer</name>
|
<name>FeedMessageViewer</name>
|
||||||
<message>
|
<message>
|
||||||
@ -510,94 +574,6 @@ Click here to open parent directory.</source>
|
|||||||
<translation>Importen slutfördes korrekt.</translation>
|
<translation>Importen slutfördes korrekt.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>FeedsModelCategory</name>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n oläst meddelande.</numerusform>
|
|
||||||
<numerusform>%n olästa meddelanden.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (category)%2%3</source>
|
|
||||||
<extracomment>Tooltip for standard feed.</extracomment>
|
|
||||||
<translation>%1 (kategori)%2%3</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>
|
|
||||||
This category does not contain any nested items.</source>
|
|
||||||
<translation>
|
|
||||||
Denna kategori innehåller inga objekt.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelFeed</name>
|
|
||||||
<message>
|
|
||||||
<source>does not use auto-update</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>Uppdateras inte automatiskt</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>uses global settings</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>Globala inställningar</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>uses specific settings (%n minute(s) to next auto-update)</source>
|
|
||||||
<extracomment>Describes feed auto-update status.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>Anpassade inställningar. (%n minut till nästa auto-uppdatering)</numerusform>
|
|
||||||
<numerusform>Anpassade inställningar. (%n minuter till nästa auto-uppdatering)</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n unread message(s).</source>
|
|
||||||
<extracomment>Tooltip for "unread" column of feed list.</extracomment>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n oläst meddelande.</numerusform>
|
|
||||||
<numerusform>%n olästa meddelanden.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>%1 (%2)%3
|
|
||||||
|
|
||||||
Network status: %6
|
|
||||||
Encoding: %4
|
|
||||||
Auto-update status: %5</source>
|
|
||||||
<extracomment>Tooltip for feed.</extracomment>
|
|
||||||
<translation>%1 (%2)%3
|
|
||||||
|
|
||||||
Nätverksstatus: %6
|
|
||||||
Kodning: %4
|
|
||||||
Uppdateringsstatus: %5</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>FeedsModelRecycleBin</name>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin</source>
|
|
||||||
<translation>Papperskorgen</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
|
||||||
<translation>Papperskorgen innehåller borttagna meddelanden från samtliga flöden.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Recycle bin
|
|
||||||
%1</source>
|
|
||||||
<translation>Papperskorgen
|
|
||||||
%1</translation>
|
|
||||||
</message>
|
|
||||||
<message numerus="yes">
|
|
||||||
<source>%n deleted message(s).</source>
|
|
||||||
<translation>
|
|
||||||
<numerusform>%n borttaget meddelande.</numerusform>
|
|
||||||
<numerusform>%n borttagna meddelanden.</numerusform>
|
|
||||||
</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>FeedsToolBar</name>
|
<name>FeedsToolBar</name>
|
||||||
<message>
|
<message>
|
||||||
@ -2971,6 +2947,30 @@ Gå till programmets hemsida för att hämta den manuellt.</translation>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>RecycleBin</name>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin</source>
|
||||||
|
<translation type="unfinished">Papperskorgen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin contains all deleted messages from all feeds.</source>
|
||||||
|
<translation type="unfinished">Papperskorgen innehåller borttagna meddelanden från samtliga flöden.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Recycle bin
|
||||||
|
%1</source>
|
||||||
|
<translation type="unfinished">Papperskorgen
|
||||||
|
%1</translation>
|
||||||
|
</message>
|
||||||
|
<message numerus="yes">
|
||||||
|
<source>%n deleted message(s).</source>
|
||||||
|
<translation type="unfinished">
|
||||||
|
<numerusform>%n borttaget meddelande.</numerusform>
|
||||||
|
<numerusform>%n borttagna meddelanden.</numerusform>
|
||||||
|
</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ShortcutCatcher</name>
|
<name>ShortcutCatcher</name>
|
||||||
<message>
|
<message>
|
||||||
|
39
src/core/feedsmodelcategory.cpp → src/core/category.cpp
Executable file → Normal file
39
src/core/feedsmodelcategory.cpp → src/core/category.cpp
Executable file → Normal file
@ -15,14 +15,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "miscellaneous/databasefactory.h"
|
#include "miscellaneous/databasefactory.h"
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "miscellaneous/settings.h"
|
#include "miscellaneous/settings.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "gui/dialogs/formcategorydetails.h"
|
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
@ -30,12 +29,12 @@
|
|||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
|
|
||||||
|
|
||||||
FeedsModelCategory::FeedsModelCategory(FeedsModelRootItem *parent_item) : FeedsModelRootItem(parent_item) {
|
Category::Category(RootItem *parent_item) : RootItem(parent_item) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory::FeedsModelCategory(const FeedsModelCategory &other)
|
Category::Category(const Category &other)
|
||||||
: FeedsModelRootItem(NULL) {
|
: RootItem(NULL) {
|
||||||
m_kind = other.kind();
|
m_kind = other.kind();
|
||||||
m_id = other.id();
|
m_id = other.id();
|
||||||
m_title = other.title();
|
m_title = other.title();
|
||||||
@ -46,15 +45,15 @@ FeedsModelCategory::FeedsModelCategory(const FeedsModelCategory &other)
|
|||||||
m_parentItem = other.parent();
|
m_parentItem = other.parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory::~FeedsModelCategory() {
|
Category::~Category() {
|
||||||
qDebug("Destroying FeedsModelCategory instance.");
|
qDebug("Destroying Category instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModelCategory::init() {
|
void Category::init() {
|
||||||
m_kind = FeedsModelRootItem::Category;
|
m_kind = RootItem::Cattegory;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FeedsModelCategory::data(int column, int role) const {
|
QVariant Category::data(int column, int role) const {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (column == FDS_MODEL_TITLE_INDEX) {
|
if (column == FDS_MODEL_TITLE_INDEX) {
|
||||||
@ -122,17 +121,17 @@ QVariant FeedsModelCategory::data(int column, int role) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelCategory::removeItself() {
|
bool Category::removeItself() {
|
||||||
bool children_removed = true;
|
bool children_removed = true;
|
||||||
|
|
||||||
// Remove all child items (feeds, categories.)
|
// Remove all child items (feeds, categories.)
|
||||||
foreach (FeedsModelRootItem *child, m_childItems) {
|
foreach (RootItem *child, m_childItems) {
|
||||||
children_removed &= child->removeItself();
|
children_removed &= child->removeItself();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (children_removed) {
|
if (children_removed) {
|
||||||
// Children are removed, remove this standard category too.
|
// Children are removed, remove this standard category too.
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelCategory"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Category"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_remove(database);
|
QSqlQuery query_remove(database);
|
||||||
|
|
||||||
// Remove this category from database.
|
// Remove this category from database.
|
||||||
@ -147,10 +146,10 @@ bool FeedsModelCategory::removeItself() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelCategory::addItself(FeedsModelRootItem *parent) {
|
bool Category::addItself(RootItem *parent) {
|
||||||
// Now, add category to persistent storage.
|
// Now, add category to persistent storage.
|
||||||
// Children are removed, remove this standard category too.
|
// Children are removed, remove this standard category too.
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelCategory"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Category"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_add(database);
|
QSqlQuery query_add(database);
|
||||||
|
|
||||||
query_add.setForwardOnly(true);
|
query_add.setForwardOnly(true);
|
||||||
@ -186,11 +185,11 @@ bool FeedsModelCategory::addItself(FeedsModelRootItem *parent) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelCategory::editItself(FeedsModelCategory *new_category_data) {
|
bool Category::editItself(Category *new_category_data) {
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelCategory"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Category"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_update_category(database);
|
QSqlQuery query_update_category(database);
|
||||||
FeedsModelCategory *original_category = this;
|
Category *original_category = this;
|
||||||
FeedsModelRootItem *new_parent = new_category_data->parent();
|
RootItem *new_parent = new_category_data->parent();
|
||||||
|
|
||||||
query_update_category.setForwardOnly(true);
|
query_update_category.setForwardOnly(true);
|
||||||
query_update_category.prepare("UPDATE Categories "
|
query_update_category.prepare("UPDATE Categories "
|
||||||
@ -216,7 +215,7 @@ bool FeedsModelCategory::editItself(FeedsModelCategory *new_category_data) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory::FeedsModelCategory(const QSqlRecord &record) : FeedsModelRootItem(NULL) {
|
Category::Category(const QSqlRecord &record) : RootItem(NULL) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
setId(record.value(CAT_DB_ID_INDEX).toInt());
|
setId(record.value(CAT_DB_ID_INDEX).toInt());
|
18
src/core/feedsmodelcategory.h → src/core/category.h
Executable file → Normal file
18
src/core/feedsmodelcategory.h → src/core/category.h
Executable file → Normal file
@ -18,7 +18,7 @@
|
|||||||
#ifndef FEEDSMODELCATEGORY_H
|
#ifndef FEEDSMODELCATEGORY_H
|
||||||
#define FEEDSMODELCATEGORY_H
|
#define FEEDSMODELCATEGORY_H
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
#include <QSqlRecord>
|
#include <QSqlRecord>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@ -29,15 +29,15 @@ class FeedsModel;
|
|||||||
// Base class for all categories contained in FeedsModel.
|
// Base class for all categories contained in FeedsModel.
|
||||||
// NOTE: This class should be derived to create PARTICULAR category types.
|
// NOTE: This class should be derived to create PARTICULAR category types.
|
||||||
// NOTE: This class should not be instantiated directly.
|
// NOTE: This class should not be instantiated directly.
|
||||||
class FeedsModelCategory : public FeedsModelRootItem {
|
class Category : public RootItem {
|
||||||
Q_DECLARE_TR_FUNCTIONS(FeedsModelCategory)
|
Q_DECLARE_TR_FUNCTIONS(Category)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructors and destructors
|
// Constructors and destructors
|
||||||
explicit FeedsModelCategory(FeedsModelRootItem *parent_item = NULL);
|
explicit Category(RootItem *parent_item = NULL);
|
||||||
explicit FeedsModelCategory(const FeedsModelCategory &other);
|
explicit Category(const Category &other);
|
||||||
explicit FeedsModelCategory(const QSqlRecord &record);
|
explicit Category(const QSqlRecord &record);
|
||||||
virtual ~FeedsModelCategory();
|
virtual ~Category();
|
||||||
|
|
||||||
// Returns the actual data representation of standard category.
|
// Returns the actual data representation of standard category.
|
||||||
QVariant data(int column, int role) const;
|
QVariant data(int column, int role) const;
|
||||||
@ -46,8 +46,8 @@ class FeedsModelCategory : public FeedsModelRootItem {
|
|||||||
// database.
|
// database.
|
||||||
bool removeItself();
|
bool removeItself();
|
||||||
|
|
||||||
bool addItself(FeedsModelRootItem *parent);
|
bool addItself(RootItem *parent);
|
||||||
bool editItself(FeedsModelCategory *new_category_data);
|
bool editItself(Category *new_category_data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
80
src/core/feedsmodelfeed.cpp → src/core/feed.cpp
Executable file → Normal file
80
src/core/feedsmodelfeed.cpp → src/core/feed.cpp
Executable file → Normal file
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/parsingfactory.h"
|
#include "core/parsingfactory.h"
|
||||||
@ -38,7 +38,7 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
|
|
||||||
void FeedsModelFeed::init() {
|
void Feed::init() {
|
||||||
m_passwordProtected = false;
|
m_passwordProtected = false;
|
||||||
m_username = QString();
|
m_username = QString();
|
||||||
m_password = QString();
|
m_password = QString();
|
||||||
@ -52,16 +52,16 @@ void FeedsModelFeed::init() {
|
|||||||
m_autoUpdateRemainingInterval = DEFAULT_AUTO_UPDATE_INTERVAL;
|
m_autoUpdateRemainingInterval = DEFAULT_AUTO_UPDATE_INTERVAL;
|
||||||
m_encoding = QString();
|
m_encoding = QString();
|
||||||
m_url = QString();
|
m_url = QString();
|
||||||
m_kind = FeedsModelRootItem::Feed;
|
m_kind = RootItem::Feeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed::FeedsModelFeed(FeedsModelRootItem *parent_item)
|
Feed::Feed(RootItem *parent_item)
|
||||||
: FeedsModelRootItem(parent_item) {
|
: RootItem(parent_item) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed::FeedsModelFeed(const FeedsModelFeed &other)
|
Feed::Feed(const Feed &other)
|
||||||
: FeedsModelRootItem(NULL) {
|
: RootItem(NULL) {
|
||||||
m_passwordProtected = other.passwordProtected();
|
m_passwordProtected = other.passwordProtected();
|
||||||
m_username = other.username();
|
m_username = other.username();
|
||||||
m_password = other.password();
|
m_password = other.password();
|
||||||
@ -75,7 +75,7 @@ FeedsModelFeed::FeedsModelFeed(const FeedsModelFeed &other)
|
|||||||
m_autoUpdateRemainingInterval = other.autoUpdateRemainingInterval();
|
m_autoUpdateRemainingInterval = other.autoUpdateRemainingInterval();
|
||||||
m_encoding = other.encoding();
|
m_encoding = other.encoding();
|
||||||
m_url = other.url();
|
m_url = other.url();
|
||||||
m_kind = FeedsModelRootItem::Feed;
|
m_kind = RootItem::Feeed;
|
||||||
m_title = other.title();
|
m_title = other.title();
|
||||||
m_id = other.id();
|
m_id = other.id();
|
||||||
m_icon = other.icon();
|
m_icon = other.icon();
|
||||||
@ -85,24 +85,24 @@ FeedsModelFeed::FeedsModelFeed(const FeedsModelFeed &other)
|
|||||||
m_description = other.description();
|
m_description = other.description();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed::~FeedsModelFeed() {
|
Feed::~Feed() {
|
||||||
qDebug("Destroying FeedsModelFeed instance.");
|
qDebug("Destroying Feed instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelFeed::childCount() const {
|
int Feed::childCount() const {
|
||||||
// Because feed has no children.
|
// Because feed has no children.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelFeed::countOfAllMessages() const {
|
int Feed::countOfAllMessages() const {
|
||||||
return m_totalCount;
|
return m_totalCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelFeed::countOfUnreadMessages() const {
|
int Feed::countOfUnreadMessages() const {
|
||||||
return m_unreadCount;
|
return m_unreadCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FeedsModelFeed::typeToString(FeedsModelFeed::Type type) {
|
QString Feed::typeToString(Feed::Type type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Atom10:
|
case Atom10:
|
||||||
return QSL("ATOM 1.0");
|
return QSL("ATOM 1.0");
|
||||||
@ -119,8 +119,8 @@ QString FeedsModelFeed::typeToString(FeedsModelFeed::Type type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModelFeed::updateCounts(bool including_total_count, bool update_feed_statuses) {
|
void Feed::updateCounts(bool including_total_count, bool update_feed_statuses) {
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelFeed"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Feed"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_all(database);
|
QSqlQuery query_all(database);
|
||||||
|
|
||||||
query_all.setForwardOnly(true);
|
query_all.setForwardOnly(true);
|
||||||
@ -143,10 +143,10 @@ void FeedsModelFeed::updateCounts(bool including_total_count, bool update_feed_s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<FeedsModelFeed*, QNetworkReply::NetworkError> FeedsModelFeed::guessFeed(const QString &url,
|
QPair<Feed*, QNetworkReply::NetworkError> Feed::guessFeed(const QString &url,
|
||||||
const QString &username,
|
const QString &username,
|
||||||
const QString &password) {
|
const QString &password) {
|
||||||
QPair<FeedsModelFeed*, QNetworkReply::NetworkError> result; result.first = NULL;
|
QPair<Feed*, QNetworkReply::NetworkError> result; result.first = NULL;
|
||||||
|
|
||||||
QByteArray feed_contents;
|
QByteArray feed_contents;
|
||||||
NetworkResult network_result = NetworkFactory::downloadFeedFile(url,
|
NetworkResult network_result = NetworkFactory::downloadFeedFile(url,
|
||||||
@ -175,7 +175,7 @@ QPair<FeedsModelFeed*, QNetworkReply::NetworkError> FeedsModelFeed::guessFeed(co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result.first == NULL) {
|
if (result.first == NULL) {
|
||||||
result.first = new FeedsModelFeed();
|
result.first = new Feed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextCodec *custom_codec = QTextCodec::codecForName(xml_schema_encoding.toLocal8Bit());
|
QTextCodec *custom_codec = QTextCodec::codecForName(xml_schema_encoding.toLocal8Bit());
|
||||||
@ -287,7 +287,7 @@ QPair<FeedsModelFeed*, QNetworkReply::NetworkError> FeedsModelFeed::guessFeed(co
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FeedsModelFeed::data(int column, int role) const {
|
QVariant Feed::data(int column, int role) const {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
if (column == FDS_MODEL_TITLE_INDEX) {
|
if (column == FDS_MODEL_TITLE_INDEX) {
|
||||||
@ -352,7 +352,7 @@ QVariant FeedsModelFeed::data(int column, int role) const {
|
|||||||
"Network status: %6\n"
|
"Network status: %6\n"
|
||||||
"Encoding: %4\n"
|
"Encoding: %4\n"
|
||||||
"Auto-update status: %5").arg(m_title,
|
"Auto-update status: %5").arg(m_title,
|
||||||
FeedsModelFeed::typeToString(m_type),
|
Feed::typeToString(m_type),
|
||||||
m_description.isEmpty() ? QString() : QString('\n') + m_description,
|
m_description.isEmpty() ? QString() : QString('\n') + m_description,
|
||||||
m_encoding,
|
m_encoding,
|
||||||
auto_update_string,
|
auto_update_string,
|
||||||
@ -394,7 +394,7 @@ QVariant FeedsModelFeed::data(int column, int role) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelFeed::update() {
|
int Feed::update() {
|
||||||
QByteArray feed_contents;
|
QByteArray feed_contents;
|
||||||
int download_timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
int download_timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
m_networkError = NetworkFactory::downloadFeedFile(url(), download_timeout, feed_contents,
|
m_networkError = NetworkFactory::downloadFeedFile(url(), download_timeout, feed_contents,
|
||||||
@ -427,16 +427,16 @@ int FeedsModelFeed::update() {
|
|||||||
QList<Message> messages;
|
QList<Message> messages;
|
||||||
|
|
||||||
switch (type()) {
|
switch (type()) {
|
||||||
case FeedsModelFeed::Rss0X:
|
case Feed::Rss0X:
|
||||||
case FeedsModelFeed::Rss2X:
|
case Feed::Rss2X:
|
||||||
messages = ParsingFactory::parseAsRSS20(formatted_feed_contents);
|
messages = ParsingFactory::parseAsRSS20(formatted_feed_contents);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::Rdf:
|
case Feed::Rdf:
|
||||||
messages = ParsingFactory::parseAsRDF(formatted_feed_contents);
|
messages = ParsingFactory::parseAsRDF(formatted_feed_contents);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::Atom10:
|
case Feed::Atom10:
|
||||||
messages = ParsingFactory::parseAsATOM10(formatted_feed_contents);
|
messages = ParsingFactory::parseAsATOM10(formatted_feed_contents);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -446,8 +446,8 @@ int FeedsModelFeed::update() {
|
|||||||
return updateMessages(messages);
|
return updateMessages(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelFeed::removeItself() {
|
bool Feed::removeItself() {
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelFeed"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Feed"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_remove(database);
|
QSqlQuery query_remove(database);
|
||||||
|
|
||||||
query_remove.setForwardOnly(true);
|
query_remove.setForwardOnly(true);
|
||||||
@ -467,9 +467,9 @@ bool FeedsModelFeed::removeItself() {
|
|||||||
return query_remove.exec();
|
return query_remove.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelFeed::addItself(FeedsModelRootItem *parent) {
|
bool Feed::addItself(RootItem *parent) {
|
||||||
// Now, add feed to persistent storage.
|
// Now, add feed to persistent storage.
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelFeed"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Feed"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_add_feed(database);
|
QSqlQuery query_add_feed(database);
|
||||||
|
|
||||||
query_add_feed.setForwardOnly(true);
|
query_add_feed.setForwardOnly(true);
|
||||||
@ -511,11 +511,11 @@ bool FeedsModelFeed::addItself(FeedsModelRootItem *parent) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelFeed::editItself(FeedsModelFeed *new_feed_data) {
|
bool Feed::editItself(Feed *new_feed_data) {
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelFeed"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Feed"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_update_feed(database);
|
QSqlQuery query_update_feed(database);
|
||||||
FeedsModelFeed *original_feed = this;
|
Feed *original_feed = this;
|
||||||
FeedsModelRootItem *new_parent = new_feed_data->parent();
|
RootItem *new_parent = new_feed_data->parent();
|
||||||
|
|
||||||
query_update_feed.setForwardOnly(true);
|
query_update_feed.setForwardOnly(true);
|
||||||
query_update_feed.prepare("UPDATE Feeds "
|
query_update_feed.prepare("UPDATE Feeds "
|
||||||
@ -558,10 +558,10 @@ bool FeedsModelFeed::editItself(FeedsModelFeed *new_feed_data) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelFeed::updateMessages(const QList<Message> &messages) {
|
int Feed::updateMessages(const QList<Message> &messages) {
|
||||||
int feed_id = id();
|
int feed_id = id();
|
||||||
int updated_messages = 0;
|
int updated_messages = 0;
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelFeed"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("Feed"), DatabaseFactory::FromSettings);
|
||||||
bool remove_duplicates = qApp->settings()->value(GROUP(Messages), SETTING(Messages::RemoveDuplicates)).toBool();
|
bool remove_duplicates = qApp->settings()->value(GROUP(Messages), SETTING(Messages::RemoveDuplicates)).toBool();
|
||||||
|
|
||||||
// Prepare queries.
|
// Prepare queries.
|
||||||
@ -685,12 +685,12 @@ int FeedsModelFeed::updateMessages(const QList<Message> &messages) {
|
|||||||
return updated_messages;
|
return updated_messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkReply::NetworkError FeedsModelFeed::networkError() const {
|
QNetworkReply::NetworkError Feed::networkError() const {
|
||||||
return m_networkError;
|
return m_networkError;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed::FeedsModelFeed(const QSqlRecord &record) : FeedsModelRootItem(NULL) {
|
Feed::Feed(const QSqlRecord &record) : RootItem(NULL) {
|
||||||
m_kind = FeedsModelRootItem::Feed;
|
m_kind = RootItem::Feeed;
|
||||||
|
|
||||||
setTitle(record.value(FDS_DB_TITLE_INDEX).toString());
|
setTitle(record.value(FDS_DB_TITLE_INDEX).toString());
|
||||||
setId(record.value(FDS_DB_ID_INDEX).toInt());
|
setId(record.value(FDS_DB_ID_INDEX).toInt());
|
||||||
@ -702,7 +702,7 @@ FeedsModelFeed::FeedsModelFeed(const QSqlRecord &record) : FeedsModelRootItem(NU
|
|||||||
setPasswordProtected(record.value(FDS_DB_PROTECTED_INDEX).toBool());
|
setPasswordProtected(record.value(FDS_DB_PROTECTED_INDEX).toBool());
|
||||||
setUsername(record.value(FDS_DB_USERNAME_INDEX).toString());
|
setUsername(record.value(FDS_DB_USERNAME_INDEX).toString());
|
||||||
setPassword(TextFactory::decrypt(record.value(FDS_DB_PASSWORD_INDEX).toString()));
|
setPassword(TextFactory::decrypt(record.value(FDS_DB_PASSWORD_INDEX).toString()));
|
||||||
setAutoUpdateType(static_cast<FeedsModelFeed::AutoUpdateType>(record.value(FDS_DB_UPDATE_TYPE_INDEX).toInt()));
|
setAutoUpdateType(static_cast<Feed::AutoUpdateType>(record.value(FDS_DB_UPDATE_TYPE_INDEX).toInt()));
|
||||||
setAutoUpdateInitialInterval(record.value(FDS_DB_UPDATE_INTERVAL_INDEX).toInt());
|
setAutoUpdateInitialInterval(record.value(FDS_DB_UPDATE_INTERVAL_INDEX).toInt());
|
||||||
updateCounts();
|
updateCounts();
|
||||||
}
|
}
|
22
src/core/feedsmodelfeed.h → src/core/feed.h
Executable file → Normal file
22
src/core/feedsmodelfeed.h → src/core/feed.h
Executable file → Normal file
@ -18,7 +18,7 @@
|
|||||||
#ifndef FEEDSMODELFEED_H
|
#ifndef FEEDSMODELFEED_H
|
||||||
#define FEEDSMODELFEED_H
|
#define FEEDSMODELFEED_H
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@ -33,8 +33,8 @@ class FeedsModel;
|
|||||||
|
|
||||||
// Represents BASE class for feeds contained in FeedsModel.
|
// Represents BASE class for feeds contained in FeedsModel.
|
||||||
// NOTE: This class should be derived to create PARTICULAR feed types.
|
// NOTE: This class should be derived to create PARTICULAR feed types.
|
||||||
class FeedsModelFeed : public FeedsModelRootItem {
|
class Feed : public RootItem {
|
||||||
Q_DECLARE_TR_FUNCTIONS(FeedsModelFeed)
|
Q_DECLARE_TR_FUNCTIONS(Feed)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Describes possible types of feeds.
|
// Describes possible types of feeds.
|
||||||
@ -63,10 +63,10 @@ class FeedsModelFeed : public FeedsModelRootItem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Constructors and destructors.
|
// Constructors and destructors.
|
||||||
explicit FeedsModelFeed(FeedsModelRootItem *parent_item = NULL);
|
explicit Feed(RootItem *parent_item = NULL);
|
||||||
explicit FeedsModelFeed(const FeedsModelFeed &other);
|
explicit Feed(const Feed &other);
|
||||||
explicit FeedsModelFeed(const QSqlRecord &record);
|
explicit Feed(const QSqlRecord &record);
|
||||||
virtual ~FeedsModelFeed();
|
virtual ~Feed();
|
||||||
|
|
||||||
// Returns 0, feeds have no children.
|
// Returns 0, feeds have no children.
|
||||||
int childCount() const;
|
int childCount() const;
|
||||||
@ -86,8 +86,8 @@ class FeedsModelFeed : public FeedsModelRootItem {
|
|||||||
// Removes this standard feed from persistent
|
// Removes this standard feed from persistent
|
||||||
// storage.
|
// storage.
|
||||||
bool removeItself();
|
bool removeItself();
|
||||||
bool addItself(FeedsModelRootItem *parent);
|
bool addItself(RootItem *parent);
|
||||||
bool editItself(FeedsModelFeed *new_feed_data);
|
bool editItself(Feed *new_feed_data);
|
||||||
|
|
||||||
// Other getters/setters.
|
// Other getters/setters.
|
||||||
inline Type type() const {
|
inline Type type() const {
|
||||||
@ -180,7 +180,7 @@ class FeedsModelFeed : public FeedsModelRootItem {
|
|||||||
// Returns pointer to guessed feed (if at least partially
|
// Returns pointer to guessed feed (if at least partially
|
||||||
// guessed) and retrieved error/status code from network layer
|
// guessed) and retrieved error/status code from network layer
|
||||||
// or NULL feed.
|
// or NULL feed.
|
||||||
static QPair<FeedsModelFeed*, QNetworkReply::NetworkError> guessFeed(const QString &url,
|
static QPair<Feed*, QNetworkReply::NetworkError> guessFeed(const QString &url,
|
||||||
const QString &username,
|
const QString &username,
|
||||||
const QString &password);
|
const QString &password);
|
||||||
|
|
||||||
@ -219,6 +219,6 @@ class FeedsModelFeed : public FeedsModelRootItem {
|
|||||||
QString m_url;
|
QString m_url;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(FeedsModelFeed::Type)
|
Q_DECLARE_METATYPE(Feed::Type)
|
||||||
|
|
||||||
#endif // FEEDSMODELFEED_H
|
#endif // FEEDSMODELFEED_H
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include "core/feeddownloader.h"
|
#include "core/feeddownloader.h"
|
||||||
|
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
@ -32,7 +32,7 @@ FeedDownloader::~FeedDownloader() {
|
|||||||
qDebug("Destroying FeedDownloader instance.");
|
qDebug("Destroying FeedDownloader instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedDownloader::updateFeeds(const QList<FeedsModelFeed*> &feeds) {
|
void FeedDownloader::updateFeeds(const QList<Feed*> &feeds) {
|
||||||
qDebug().nospace() << "Performing feed updates in thread: \'" << QThread::currentThreadId() << "\'.";
|
qDebug().nospace() << "Performing feed updates in thread: \'" << QThread::currentThreadId() << "\'.";
|
||||||
|
|
||||||
// Job starts now.
|
// Job starts now.
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QPair>
|
#include <QPair>
|
||||||
|
|
||||||
|
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
|
|
||||||
// Represents results of batch feed updates.
|
// Represents results of batch feed updates.
|
||||||
struct FeedDownloadResults {
|
struct FeedDownloadResults {
|
||||||
@ -55,7 +55,7 @@ class FeedDownloader : public QObject {
|
|||||||
// New messages are downloaded for each feed and they
|
// New messages are downloaded for each feed and they
|
||||||
// are stored persistently in the database.
|
// are stored persistently in the database.
|
||||||
// Appropriate signals are emitted.
|
// Appropriate signals are emitted.
|
||||||
void updateFeeds(const QList<FeedsModelFeed*> &feeds);
|
void updateFeeds(const QList<Feed*> &feeds);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Emitted if feed updates started.
|
// Emitted if feed updates started.
|
||||||
@ -69,7 +69,7 @@ class FeedDownloader : public QObject {
|
|||||||
// "Current" number indicates count of processed feeds
|
// "Current" number indicates count of processed feeds
|
||||||
// and "total" number indicates total number of feeds
|
// and "total" number indicates total number of feeds
|
||||||
// which were in the initial queue.
|
// which were in the initial queue.
|
||||||
void progress(FeedsModelFeed *feed, int current, int total);
|
void progress(Feed *feed, int current, int total);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FEEDDOWNLOADER_H
|
#endif // FEEDDOWNLOADER_H
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
#include "core/feedsimportexportmodel.h"
|
#include "core/feedsimportexportmodel.h"
|
||||||
|
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
FeedsImportExportModel::FeedsImportExportModel(QObject *parent)
|
FeedsImportExportModel::FeedsImportExportModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent), m_checkStates(QHash<FeedsModelRootItem*, Qt::CheckState>()),
|
: QAbstractItemModel(parent), m_checkStates(QHash<RootItem*, Qt::CheckState>()),
|
||||||
m_rootItem(NULL), m_recursiveChange(false), m_mode(Import) {
|
m_rootItem(NULL), m_recursiveChange(false), m_mode(Import) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,20 +43,20 @@ FeedsImportExportModel::~FeedsImportExportModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsImportExportModel::itemForIndex(const QModelIndex &index) const {
|
RootItem *FeedsImportExportModel::itemForIndex(const QModelIndex &index) const {
|
||||||
if (index.isValid() && index.model() == this) {
|
if (index.isValid() && index.model() == this) {
|
||||||
return static_cast<FeedsModelRootItem*>(index.internalPointer());
|
return static_cast<RootItem*>(index.internalPointer());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return m_rootItem;
|
return m_rootItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsImportExportModel::rootItem() const {
|
RootItem *FeedsImportExportModel::rootItem() const {
|
||||||
return m_rootItem;
|
return m_rootItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsImportExportModel::setRootItem(FeedsModelRootItem *rootItem) {
|
void FeedsImportExportModel::setRootItem(RootItem *rootItem) {
|
||||||
m_rootItem = rootItem;
|
m_rootItem = rootItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,21 +85,21 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
|
|||||||
opml_document.documentElement().appendChild(elem_opml_head);
|
opml_document.documentElement().appendChild(elem_opml_head);
|
||||||
|
|
||||||
QDomElement elem_opml_body = opml_document.createElement(QSL("body"));
|
QDomElement elem_opml_body = opml_document.createElement(QSL("body"));
|
||||||
QStack<FeedsModelRootItem*> items_to_process; items_to_process.push(m_rootItem);
|
QStack<RootItem*> items_to_process; items_to_process.push(m_rootItem);
|
||||||
QStack<QDomElement> elements_to_use; elements_to_use.push(elem_opml_body);
|
QStack<QDomElement> elements_to_use; elements_to_use.push(elem_opml_body);
|
||||||
|
|
||||||
// Process all unprocessed nodes.
|
// Process all unprocessed nodes.
|
||||||
while (!items_to_process.isEmpty()) {
|
while (!items_to_process.isEmpty()) {
|
||||||
QDomElement active_element = elements_to_use.pop();
|
QDomElement active_element = elements_to_use.pop();
|
||||||
FeedsModelRootItem *active_item = items_to_process.pop();
|
RootItem *active_item = items_to_process.pop();
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child_item, active_item->childItems()) {
|
foreach (RootItem *child_item, active_item->childItems()) {
|
||||||
if (!m_checkStates.contains(child_item) || m_checkStates[child_item] != Qt::Checked) {
|
if (!m_checkStates.contains(child_item) || m_checkStates[child_item] != Qt::Checked) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (child_item->kind()) {
|
switch (child_item->kind()) {
|
||||||
case FeedsModelRootItem::Category: {
|
case RootItem::Cattegory: {
|
||||||
QDomElement outline_category = opml_document.createElement(QSL("outline"));
|
QDomElement outline_category = opml_document.createElement(QSL("outline"));
|
||||||
outline_category.setAttribute(QSL("text"), child_item->title());
|
outline_category.setAttribute(QSL("text"), child_item->title());
|
||||||
outline_category.setAttribute(QSL("description"), child_item->description());
|
outline_category.setAttribute(QSL("description"), child_item->description());
|
||||||
@ -110,8 +110,8 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FeedsModelRootItem::Feed: {
|
case RootItem::Feeed: {
|
||||||
FeedsModelFeed *child_feed = child_item->toFeed();
|
Feed *child_feed = child_item->toFeed();
|
||||||
QDomElement outline_feed = opml_document.createElement("outline");
|
QDomElement outline_feed = opml_document.createElement("outline");
|
||||||
outline_feed.setAttribute(QSL("text"), child_feed->title());
|
outline_feed.setAttribute(QSL("text"), child_feed->title());
|
||||||
outline_feed.setAttribute(QSL("xmlUrl"), child_feed->url());
|
outline_feed.setAttribute(QSL("xmlUrl"), child_feed->url());
|
||||||
@ -121,16 +121,16 @@ bool FeedsImportExportModel::exportToOMPL20(QByteArray &result) {
|
|||||||
outline_feed.setAttribute(QSL("rssguard:icon"), QString(qApp->icons()->toByteArray(child_feed->icon())));
|
outline_feed.setAttribute(QSL("rssguard:icon"), QString(qApp->icons()->toByteArray(child_feed->icon())));
|
||||||
|
|
||||||
switch (child_feed->type()) {
|
switch (child_feed->type()) {
|
||||||
case FeedsModelFeed::Rss0X:
|
case Feed::Rss0X:
|
||||||
case FeedsModelFeed::Rss2X:
|
case Feed::Rss2X:
|
||||||
outline_feed.setAttribute(QSL("version"), QSL("RSS"));
|
outline_feed.setAttribute(QSL("version"), QSL("RSS"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::Rdf:
|
case Feed::Rdf:
|
||||||
outline_feed.setAttribute(QSL("version"), QSL("RSS1"));
|
outline_feed.setAttribute(QSL("version"), QSL("RSS1"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::Atom10:
|
case Feed::Atom10:
|
||||||
outline_feed.setAttribute(QSL("version"), QSL("ATOM"));
|
outline_feed.setAttribute(QSL("version"), QSL("ATOM"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -166,12 +166,12 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *root_item = new FeedsModelRootItem();
|
RootItem *root_item = new RootItem();
|
||||||
QStack<FeedsModelRootItem*> model_items; model_items.push(root_item);
|
QStack<RootItem*> model_items; model_items.push(root_item);
|
||||||
QStack<QDomElement> elements_to_process; elements_to_process.push(opml_document.documentElement().elementsByTagName(QSL("body")).at(0).toElement());
|
QStack<QDomElement> elements_to_process; elements_to_process.push(opml_document.documentElement().elementsByTagName(QSL("body")).at(0).toElement());
|
||||||
|
|
||||||
while (!elements_to_process.isEmpty()) {
|
while (!elements_to_process.isEmpty()) {
|
||||||
FeedsModelRootItem *active_model_item = model_items.pop();
|
RootItem *active_model_item = model_items.pop();
|
||||||
QDomElement active_element = elements_to_process.pop();
|
QDomElement active_element = elements_to_process.pop();
|
||||||
|
|
||||||
for (int i = 0; i < active_element.childNodes().size(); i++) {
|
for (int i = 0; i < active_element.childNodes().size(); i++) {
|
||||||
@ -192,23 +192,23 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
|
|||||||
QString feed_description = child_element.attribute(QSL("description"));
|
QString feed_description = child_element.attribute(QSL("description"));
|
||||||
QIcon feed_icon = qApp->icons()->fromByteArray(child_element.attribute(QSL("rssguard:icon")).toLocal8Bit());
|
QIcon feed_icon = qApp->icons()->fromByteArray(child_element.attribute(QSL("rssguard:icon")).toLocal8Bit());
|
||||||
|
|
||||||
FeedsModelFeed *new_feed = new FeedsModelFeed(active_model_item);
|
Feed *new_feed = new Feed(active_model_item);
|
||||||
new_feed->setTitle(feed_title);
|
new_feed->setTitle(feed_title);
|
||||||
new_feed->setDescription(feed_description);
|
new_feed->setDescription(feed_description);
|
||||||
new_feed->setEncoding(feed_encoding);
|
new_feed->setEncoding(feed_encoding);
|
||||||
new_feed->setUrl(feed_url);
|
new_feed->setUrl(feed_url);
|
||||||
new_feed->setCreationDate(QDateTime::currentDateTime());
|
new_feed->setCreationDate(QDateTime::currentDateTime());
|
||||||
new_feed->setIcon(feed_icon.isNull() ? qApp->icons()->fromTheme(QSL("folder-feed")) : feed_icon);
|
new_feed->setIcon(feed_icon.isNull() ? qApp->icons()->fromTheme(QSL("folder-feed")) : feed_icon);
|
||||||
new_feed->setAutoUpdateType(FeedsModelFeed::DefaultAutoUpdate);
|
new_feed->setAutoUpdateType(Feed::DefaultAutoUpdate);
|
||||||
|
|
||||||
if (feed_type == QL1S("RSS1")) {
|
if (feed_type == QL1S("RSS1")) {
|
||||||
new_feed->setType(FeedsModelFeed::Rdf);
|
new_feed->setType(Feed::Rdf);
|
||||||
}
|
}
|
||||||
else if (feed_type == QL1S("ATOM")) {
|
else if (feed_type == QL1S("ATOM")) {
|
||||||
new_feed->setType(FeedsModelFeed::Atom10);
|
new_feed->setType(Feed::Atom10);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new_feed->setType(FeedsModelFeed::Rss2X);
|
new_feed->setType(Feed::Rss2X);
|
||||||
}
|
}
|
||||||
|
|
||||||
active_model_item->appendChild(new_feed);
|
active_model_item->appendChild(new_feed);
|
||||||
@ -230,7 +230,7 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory *new_category = new FeedsModelCategory(active_model_item);
|
Category *new_category = new Category(active_model_item);
|
||||||
new_category->setTitle(category_title);
|
new_category->setTitle(category_title);
|
||||||
new_category->setIcon(category_icon.isNull() ? qApp->icons()->fromTheme(QSL("folder-category")) : category_icon);
|
new_category->setIcon(category_icon.isNull() ? qApp->icons()->fromTheme(QSL("folder-category")) : category_icon);
|
||||||
new_category->setCreationDate(QDateTime::currentDateTime());
|
new_category->setCreationDate(QDateTime::currentDateTime());
|
||||||
@ -263,16 +263,16 @@ void FeedsImportExportModel::setMode(const FeedsImportExportModel::Mode &mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsImportExportModel::checkAllItems() {
|
void FeedsImportExportModel::checkAllItems() {
|
||||||
foreach (FeedsModelRootItem *root_child, m_rootItem->childItems()) {
|
foreach (RootItem *root_child, m_rootItem->childItems()) {
|
||||||
if (root_child->kind() != FeedsModelRootItem::RecycleBin) {
|
if (root_child->kind() != RootItem::Bin) {
|
||||||
setData(indexForItem(root_child), Qt::Checked, Qt::CheckStateRole);
|
setData(indexForItem(root_child), Qt::Checked, Qt::CheckStateRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsImportExportModel::uncheckAllItems() {
|
void FeedsImportExportModel::uncheckAllItems() {
|
||||||
foreach (FeedsModelRootItem *root_child, m_rootItem->childItems()) {
|
foreach (RootItem *root_child, m_rootItem->childItems()) {
|
||||||
if (root_child->kind() != FeedsModelRootItem::RecycleBin) {
|
if (root_child->kind() != RootItem::Bin) {
|
||||||
setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
|
setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,8 +283,8 @@ QModelIndex FeedsImportExportModel::index(int row, int column, const QModelIndex
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *parent_item = itemForIndex(parent);
|
RootItem *parent_item = itemForIndex(parent);
|
||||||
FeedsModelRootItem *child_item = parent_item->child(row);
|
RootItem *child_item = parent_item->child(row);
|
||||||
|
|
||||||
if (child_item) {
|
if (child_item) {
|
||||||
return createIndex(row, column, child_item);
|
return createIndex(row, column, child_item);
|
||||||
@ -294,8 +294,8 @@ QModelIndex FeedsImportExportModel::index(int row, int column, const QModelIndex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex FeedsImportExportModel::indexForItem(FeedsModelRootItem *item) const {
|
QModelIndex FeedsImportExportModel::indexForItem(RootItem *item) const {
|
||||||
if (item == NULL || item->kind() == FeedsModelRootItem::RootItem) {
|
if (item == NULL || item->kind() == RootItem::Root) {
|
||||||
// Root item lies on invalid index.
|
// Root item lies on invalid index.
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ QModelIndex FeedsImportExportModel::indexForItem(FeedsModelRootItem *item) const
|
|||||||
if (row_count > 0) {
|
if (row_count > 0) {
|
||||||
// This index has children.
|
// This index has children.
|
||||||
// Lets take a look if our target item is among them.
|
// Lets take a look if our target item is among them.
|
||||||
FeedsModelRootItem *active_item = itemForIndex(active_index);
|
RootItem *active_item = itemForIndex(active_index);
|
||||||
int candidate_index = active_item->childItems().indexOf(item);
|
int candidate_index = active_item->childItems().indexOf(item);
|
||||||
|
|
||||||
if (candidate_index >= 0) {
|
if (candidate_index >= 0) {
|
||||||
@ -322,9 +322,9 @@ QModelIndex FeedsImportExportModel::indexForItem(FeedsModelRootItem *item) const
|
|||||||
else {
|
else {
|
||||||
// Item is not found, add all "categories" from active_item.
|
// Item is not found, add all "categories" from active_item.
|
||||||
for (int i = 0; i < row_count; i++) {
|
for (int i = 0; i < row_count; i++) {
|
||||||
FeedsModelRootItem *possible_category = active_item->child(i);
|
RootItem *possible_category = active_item->child(i);
|
||||||
|
|
||||||
if (possible_category->kind() == FeedsModelRootItem::Category) {
|
if (possible_category->kind() == RootItem::Cattegory) {
|
||||||
parents << index(i, 0, active_index);
|
parents << index(i, 0, active_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -340,8 +340,8 @@ QModelIndex FeedsImportExportModel::parent(const QModelIndex &child) const {
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *child_item = itemForIndex(child);
|
RootItem *child_item = itemForIndex(child);
|
||||||
FeedsModelRootItem *parent_item = child_item->parent();
|
RootItem *parent_item = child_item->parent();
|
||||||
|
|
||||||
if (parent_item == m_rootItem) {
|
if (parent_item == m_rootItem) {
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
@ -371,7 +371,7 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
|
|
||||||
if (role == Qt::CheckStateRole) {
|
if (role == Qt::CheckStateRole) {
|
||||||
if (m_checkStates.contains(item)) {
|
if (m_checkStates.contains(item)) {
|
||||||
@ -383,9 +383,9 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
|
|||||||
}
|
}
|
||||||
else if (role == Qt::DecorationRole) {
|
else if (role == Qt::DecorationRole) {
|
||||||
switch (item->kind()) {
|
switch (item->kind()) {
|
||||||
case FeedsModelRootItem::Category:
|
case RootItem::Cattegory:
|
||||||
case FeedsModelRootItem::RecycleBin:
|
case RootItem::Bin:
|
||||||
case FeedsModelRootItem::Feed:
|
case RootItem::Feeed:
|
||||||
return item->icon();
|
return item->icon();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -394,10 +394,10 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
|
|||||||
}
|
}
|
||||||
else if (role == Qt::DisplayRole) {
|
else if (role == Qt::DisplayRole) {
|
||||||
switch (item->kind()) {
|
switch (item->kind()) {
|
||||||
case FeedsModelRootItem::Category:
|
case RootItem::Cattegory:
|
||||||
return QVariant(item->data(index.column(), role).toString() + tr(" (category)"));
|
return QVariant(item->data(index.column(), role).toString() + tr(" (category)"));
|
||||||
|
|
||||||
case FeedsModelRootItem::Feed:
|
case RootItem::Feeed:
|
||||||
return QVariant(item->data(index.column(), role).toString() + tr(" (feed)"));
|
return QVariant(item->data(index.column(), role).toString() + tr(" (feed)"));
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -411,7 +411,7 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &value, int role) {
|
bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &value, int role) {
|
||||||
if (index.isValid() && index.column() == 0 && role == Qt::CheckStateRole) {
|
if (index.isValid() && index.column() == 0 && role == Qt::CheckStateRole) {
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
|
|
||||||
if (item == m_rootItem) {
|
if (item == m_rootItem) {
|
||||||
// Cannot set data on root item.
|
// Cannot set data on root item.
|
||||||
@ -427,7 +427,7 @@ bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &v
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set new data for all descendants of this actual item.
|
// Set new data for all descendants of this actual item.
|
||||||
foreach(FeedsModelRootItem *child, item->childItems()) {
|
foreach(RootItem *child, item->childItems()) {
|
||||||
setData(indexForItem(child), value, Qt::CheckStateRole);
|
setData(indexForItem(child), value, Qt::CheckStateRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &v
|
|||||||
|
|
||||||
// Check children of this new parent item.
|
// Check children of this new parent item.
|
||||||
Qt::CheckState parent_state = Qt::Unchecked;
|
Qt::CheckState parent_state = Qt::Unchecked;
|
||||||
foreach (FeedsModelRootItem *child_of_parent, item->childItems()) {
|
foreach (RootItem *child_of_parent, item->childItems()) {
|
||||||
if (m_checkStates.contains(child_of_parent) && m_checkStates[child_of_parent] == Qt::Checked) {
|
if (m_checkStates.contains(child_of_parent) && m_checkStates[child_of_parent] == Qt::Checked) {
|
||||||
// We found out, that some child of this item is checked,
|
// We found out, that some child of this item is checked,
|
||||||
// therefore this item must be checked too.
|
// therefore this item must be checked too.
|
||||||
@ -462,7 +462,7 @@ bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &v
|
|||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
|
Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
|
||||||
if (!index.isValid() || itemForIndex(index)->kind() == FeedsModelRootItem::RecycleBin) {
|
if (!index.isValid() || itemForIndex(index)->kind() == RootItem::Bin) {
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,6 +475,6 @@ Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsImportExportModel::isItemChecked(FeedsModelRootItem *item) {
|
bool FeedsImportExportModel::isItemChecked(RootItem *item) {
|
||||||
return m_checkStates.contains(item) && m_checkStates.value(item, Qt::Unchecked);
|
return m_checkStates.contains(item) && m_checkStates.value(item, Qt::Unchecked);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
|
|
||||||
class FeedsImportExportModel : public QAbstractItemModel {
|
class FeedsImportExportModel : public QAbstractItemModel {
|
||||||
@ -44,18 +44,18 @@ class FeedsImportExportModel : public QAbstractItemModel {
|
|||||||
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
|
|
||||||
bool isItemChecked(FeedsModelRootItem *item);
|
bool isItemChecked(RootItem *item);
|
||||||
|
|
||||||
// Returns feed/category which lies at the specified index or
|
// Returns feed/category which lies at the specified index or
|
||||||
// root item if index is invalid.
|
// root item if index is invalid.
|
||||||
FeedsModelRootItem *itemForIndex(const QModelIndex &index) const;
|
RootItem *itemForIndex(const QModelIndex &index) const;
|
||||||
|
|
||||||
// Returns source QModelIndex on which lies given item.
|
// Returns source QModelIndex on which lies given item.
|
||||||
QModelIndex indexForItem(FeedsModelRootItem *item) const;
|
QModelIndex indexForItem(RootItem *item) const;
|
||||||
|
|
||||||
// Root item manipulators.
|
// Root item manipulators.
|
||||||
FeedsModelRootItem *rootItem() const;
|
RootItem *rootItem() const;
|
||||||
void setRootItem(FeedsModelRootItem *rootItem);
|
void setRootItem(RootItem *rootItem);
|
||||||
|
|
||||||
// Exports to OPML 2.0
|
// Exports to OPML 2.0
|
||||||
// NOTE: http://dev.opml.org/spec2.html
|
// NOTE: http://dev.opml.org/spec2.html
|
||||||
@ -70,8 +70,8 @@ class FeedsImportExportModel : public QAbstractItemModel {
|
|||||||
void uncheckAllItems();
|
void uncheckAllItems();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<FeedsModelRootItem*, Qt::CheckState> m_checkStates;
|
QHash<RootItem*, Qt::CheckState> m_checkStates;
|
||||||
FeedsModelRootItem *m_rootItem;
|
RootItem *m_rootItem;
|
||||||
|
|
||||||
// When it's true, then
|
// When it's true, then
|
||||||
bool m_recursiveChange;
|
bool m_recursiveChange;
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsmodelrecyclebin.h"
|
#include "core/recyclebin.h"
|
||||||
#include "core/feedsimportexportmodel.h"
|
#include "core/feedsimportexportmodel.h"
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "miscellaneous/databasefactory.h"
|
#include "miscellaneous/databasefactory.h"
|
||||||
@ -38,11 +38,11 @@
|
|||||||
|
|
||||||
|
|
||||||
FeedsModel::FeedsModel(QObject *parent)
|
FeedsModel::FeedsModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent), m_recycleBin(new FeedsModelRecycleBin()) {
|
: QAbstractItemModel(parent), m_recycleBin(new RecycleBin()) {
|
||||||
setObjectName(QSL("FeedsModel"));
|
setObjectName(QSL("FeedsModel"));
|
||||||
|
|
||||||
// Create root item.
|
// Create root item.
|
||||||
m_rootItem = new FeedsModelRootItem();
|
m_rootItem = new RootItem();
|
||||||
m_rootItem->setId(NO_PARENT_CATEGORY);
|
m_rootItem->setId(NO_PARENT_CATEGORY);
|
||||||
|
|
||||||
//: Name of root item of feed list which can be seen in feed add/edit dialog.
|
//: Name of root item of feed list which can be seen in feed add/edit dialog.
|
||||||
@ -78,9 +78,9 @@ QMimeData *FeedsModel::mimeData(const QModelIndexList &indexes) const {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *item_for_index = itemForIndex(index);
|
RootItem *item_for_index = itemForIndex(index);
|
||||||
|
|
||||||
if (item_for_index->kind() != FeedsModelRootItem::RootItem) {
|
if (item_for_index->kind() != RootItem::Root) {
|
||||||
stream << (quintptr) item_for_index;
|
stream << (quintptr) item_for_index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,30 +117,30 @@ bool FeedsModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
|
|||||||
stream >> pointer_to_item;
|
stream >> pointer_to_item;
|
||||||
|
|
||||||
// We have item we want to drag, we also determine the target item.
|
// We have item we want to drag, we also determine the target item.
|
||||||
FeedsModelRootItem *dragged_item = (FeedsModelRootItem*) pointer_to_item;
|
RootItem *dragged_item = (RootItem*) pointer_to_item;
|
||||||
FeedsModelRootItem *target_item = itemForIndex(parent);
|
RootItem *target_item = itemForIndex(parent);
|
||||||
|
|
||||||
if (dragged_item == target_item || dragged_item->parent() == target_item) {
|
if (dragged_item == target_item || dragged_item->parent() == target_item) {
|
||||||
qDebug("Dragged item is equal to target item or its parent is equal to target item. Cancelling drag-drop action.");
|
qDebug("Dragged item is equal to target item or its parent is equal to target item. Cancelling drag-drop action.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragged_item->kind() == FeedsModelRootItem::Feed) {
|
if (dragged_item->kind() == RootItem::Feeed) {
|
||||||
qDebug("Drag-drop action for feed '%s' detected, editing the feed.", qPrintable(dragged_item->title()));
|
qDebug("Drag-drop action for feed '%s' detected, editing the feed.", qPrintable(dragged_item->title()));
|
||||||
|
|
||||||
FeedsModelFeed *actual_feed = dragged_item->toFeed();
|
Feed *actual_feed = dragged_item->toFeed();
|
||||||
FeedsModelFeed *feed_new = new FeedsModelFeed(*actual_feed);
|
Feed *feed_new = new Feed(*actual_feed);
|
||||||
|
|
||||||
feed_new->setParent(target_item);
|
feed_new->setParent(target_item);
|
||||||
editFeed(actual_feed, feed_new);
|
editFeed(actual_feed, feed_new);
|
||||||
|
|
||||||
emit requireItemValidationAfterDragDrop(indexForItem(actual_feed));
|
emit requireItemValidationAfterDragDrop(indexForItem(actual_feed));
|
||||||
}
|
}
|
||||||
else if (dragged_item->kind() == FeedsModelRootItem::Category) {
|
else if (dragged_item->kind() == RootItem::Cattegory) {
|
||||||
qDebug("Drag-drop action for category '%s' detected, editing the feed.", qPrintable(dragged_item->title()));
|
qDebug("Drag-drop action for category '%s' detected, editing the feed.", qPrintable(dragged_item->title()));
|
||||||
|
|
||||||
FeedsModelCategory *actual_category = dragged_item->toCategory();
|
Category *actual_category = dragged_item->toCategory();
|
||||||
FeedsModelCategory *category_new = new FeedsModelCategory(*actual_category);
|
Category *category_new = new Category(*actual_category);
|
||||||
|
|
||||||
category_new->clearChildren();
|
category_new->clearChildren();
|
||||||
category_new->setParent(target_item);
|
category_new->setParent(target_item);
|
||||||
@ -160,19 +160,19 @@ Qt::DropActions FeedsModel::supportedDropActions() const {
|
|||||||
|
|
||||||
Qt::ItemFlags FeedsModel::flags(const QModelIndex &index) const {
|
Qt::ItemFlags FeedsModel::flags(const QModelIndex &index) const {
|
||||||
Qt::ItemFlags base_flags = QAbstractItemModel::flags(index);
|
Qt::ItemFlags base_flags = QAbstractItemModel::flags(index);
|
||||||
FeedsModelRootItem *item_for_index = itemForIndex(index);
|
RootItem *item_for_index = itemForIndex(index);
|
||||||
|
|
||||||
switch (item_for_index->kind()) {
|
switch (item_for_index->kind()) {
|
||||||
case FeedsModelRootItem::RecycleBin:
|
case RootItem::Bin:
|
||||||
return base_flags;
|
return base_flags;
|
||||||
|
|
||||||
case FeedsModelRootItem::Category:
|
case RootItem::Cattegory:
|
||||||
return base_flags | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
return base_flags | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
||||||
|
|
||||||
case FeedsModelRootItem::Feed:
|
case RootItem::Feeed:
|
||||||
return base_flags | Qt::ItemIsDragEnabled;
|
return base_flags | Qt::ItemIsDragEnabled;
|
||||||
|
|
||||||
case FeedsModelRootItem::RootItem:
|
case RootItem::Root:
|
||||||
default:
|
default:
|
||||||
return base_flags | Qt::ItemIsDropEnabled;
|
return base_flags | Qt::ItemIsDropEnabled;
|
||||||
}
|
}
|
||||||
@ -213,8 +213,8 @@ QModelIndex FeedsModel::index(int row, int column, const QModelIndex &parent) co
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *parent_item = itemForIndex(parent);
|
RootItem *parent_item = itemForIndex(parent);
|
||||||
FeedsModelRootItem *child_item = parent_item->child(row);
|
RootItem *child_item = parent_item->child(row);
|
||||||
|
|
||||||
if (child_item) {
|
if (child_item) {
|
||||||
return createIndex(row, column, child_item);
|
return createIndex(row, column, child_item);
|
||||||
@ -229,8 +229,8 @@ QModelIndex FeedsModel::parent(const QModelIndex &child) const {
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *child_item = itemForIndex(child);
|
RootItem *child_item = itemForIndex(child);
|
||||||
FeedsModelRootItem *parent_item = child_item->parent();
|
RootItem *parent_item = child_item->parent();
|
||||||
|
|
||||||
if (parent_item == m_rootItem) {
|
if (parent_item == m_rootItem) {
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
@ -252,8 +252,8 @@ int FeedsModel::rowCount(const QModelIndex &parent) const {
|
|||||||
bool FeedsModel::removeItem(const QModelIndex &index) {
|
bool FeedsModel::removeItem(const QModelIndex &index) {
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
QModelIndex parent_index = index.parent();
|
QModelIndex parent_index = index.parent();
|
||||||
FeedsModelRootItem *deleting_item = itemForIndex(index);
|
RootItem *deleting_item = itemForIndex(index);
|
||||||
FeedsModelRootItem *parent_item = deleting_item->parent();
|
RootItem *parent_item = deleting_item->parent();
|
||||||
|
|
||||||
// Try to persistently remove the item.
|
// Try to persistently remove the item.
|
||||||
if (deleting_item->removeItself()) {
|
if (deleting_item->removeItself()) {
|
||||||
@ -272,7 +272,7 @@ bool FeedsModel::removeItem(const QModelIndex &index) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::addCategory(FeedsModelCategory *category, FeedsModelRootItem *parent) {
|
bool FeedsModel::addCategory(Category *category, RootItem *parent) {
|
||||||
// Get index of parent item (parent standard category).
|
// Get index of parent item (parent standard category).
|
||||||
QModelIndex parent_index = indexForItem(parent);
|
QModelIndex parent_index = indexForItem(parent);
|
||||||
bool result = category->addItself(parent);
|
bool result = category->addItself(parent);
|
||||||
@ -292,9 +292,9 @@ bool FeedsModel::addCategory(FeedsModelCategory *category, FeedsModelRootItem *p
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::editCategory(FeedsModelCategory *original_category, FeedsModelCategory *new_category_data) {
|
bool FeedsModel::editCategory(Category *original_category, Category *new_category_data) {
|
||||||
FeedsModelRootItem *original_parent = original_category->parent();
|
RootItem *original_parent = original_category->parent();
|
||||||
FeedsModelRootItem *new_parent = new_category_data->parent();
|
RootItem *new_parent = new_category_data->parent();
|
||||||
bool result = original_category->editItself(new_category_data);
|
bool result = original_category->editItself(new_category_data);
|
||||||
|
|
||||||
if (result && original_parent != new_parent) {
|
if (result && original_parent != new_parent) {
|
||||||
@ -319,7 +319,7 @@ bool FeedsModel::editCategory(FeedsModelCategory *original_category, FeedsModelC
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::addFeed(FeedsModelFeed *feed, FeedsModelRootItem *parent) {
|
bool FeedsModel::addFeed(Feed *feed, RootItem *parent) {
|
||||||
// Get index of parent item (parent standard category or root item).
|
// Get index of parent item (parent standard category or root item).
|
||||||
QModelIndex parent_index = indexForItem(parent);
|
QModelIndex parent_index = indexForItem(parent);
|
||||||
bool result = feed->addItself(parent);
|
bool result = feed->addItself(parent);
|
||||||
@ -337,9 +337,9 @@ bool FeedsModel::addFeed(FeedsModelFeed *feed, FeedsModelRootItem *parent) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::editFeed(FeedsModelFeed *original_feed, FeedsModelFeed *new_feed_data) {
|
bool FeedsModel::editFeed(Feed *original_feed, Feed *new_feed_data) {
|
||||||
FeedsModelRootItem *original_parent = original_feed->parent();
|
RootItem *original_parent = original_feed->parent();
|
||||||
FeedsModelRootItem *new_parent = new_feed_data->parent();
|
RootItem *new_parent = new_feed_data->parent();
|
||||||
bool result = original_feed->editItself(new_feed_data);
|
bool result = original_feed->editItself(new_feed_data);
|
||||||
|
|
||||||
if (result && original_parent != new_parent) {
|
if (result && original_parent != new_parent) {
|
||||||
@ -363,23 +363,23 @@ bool FeedsModel::editFeed(FeedsModelFeed *original_feed, FeedsModelFeed *new_fee
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsModel::feedsForScheduledUpdate(bool auto_update_now) {
|
QList<Feed*> FeedsModel::feedsForScheduledUpdate(bool auto_update_now) {
|
||||||
QList<FeedsModelFeed*> feeds_for_update;
|
QList<Feed*> feeds_for_update;
|
||||||
|
|
||||||
foreach (FeedsModelFeed *feed, allFeeds()) {
|
foreach (Feed *feed, allFeeds()) {
|
||||||
switch (feed->autoUpdateType()) {
|
switch (feed->autoUpdateType()) {
|
||||||
case FeedsModelFeed::DontAutoUpdate:
|
case Feed::DontAutoUpdate:
|
||||||
// Do not auto-update this feed ever.
|
// Do not auto-update this feed ever.
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case FeedsModelFeed::DefaultAutoUpdate:
|
case Feed::DefaultAutoUpdate:
|
||||||
if (auto_update_now) {
|
if (auto_update_now) {
|
||||||
feeds_for_update.append(feed);
|
feeds_for_update.append(feed);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::SpecificAutoUpdate:
|
case Feed::SpecificAutoUpdate:
|
||||||
default:
|
default:
|
||||||
int remaining_interval = feed->autoUpdateRemainingInterval();
|
int remaining_interval = feed->autoUpdateRemainingInterval();
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ QList<FeedsModelFeed*> FeedsModel::feedsForScheduledUpdate(bool auto_update_now)
|
|||||||
return feeds_for_update;
|
return feeds_for_update;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Message> FeedsModel::messagesForFeeds(const QList<FeedsModelFeed*> &feeds) {
|
QList<Message> FeedsModel::messagesForFeeds(const QList<Feed*> &feeds) {
|
||||||
QList<Message> messages;
|
QList<Message> messages;
|
||||||
|
|
||||||
QSqlDatabase database = qApp->database()->connection(objectName(),
|
QSqlDatabase database = qApp->database()->connection(objectName(),
|
||||||
@ -413,7 +413,7 @@ QList<Message> FeedsModel::messagesForFeeds(const QList<FeedsModelFeed*> &feeds)
|
|||||||
"FROM Messages "
|
"FROM Messages "
|
||||||
"WHERE is_deleted = 0 AND feed = :feed;");
|
"WHERE is_deleted = 0 AND feed = :feed;");
|
||||||
|
|
||||||
foreach (FeedsModelFeed *feed, feeds) {
|
foreach (Feed *feed, feeds) {
|
||||||
query_read_msg.bindValue(QSL(":feed"), feed->id());
|
query_read_msg.bindValue(QSL(":feed"), feed->id());
|
||||||
|
|
||||||
if (query_read_msg.exec()) {
|
if (query_read_msg.exec()) {
|
||||||
@ -441,19 +441,19 @@ int FeedsModel::columnCount(const QModelIndex &parent) const {
|
|||||||
return FEEDS_VIEW_COLUMN_COUNT;
|
return FEEDS_VIEW_COLUMN_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsModel::itemForIndex(const QModelIndex &index) const {
|
RootItem *FeedsModel::itemForIndex(const QModelIndex &index) const {
|
||||||
if (index.isValid() && index.model() == this) {
|
if (index.isValid() && index.model() == this) {
|
||||||
return static_cast<FeedsModelRootItem*>(index.internalPointer());
|
return static_cast<RootItem*>(index.internalPointer());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return m_rootItem;
|
return m_rootItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory *FeedsModel::categoryForIndex(const QModelIndex &index) const {
|
Category *FeedsModel::categoryForIndex(const QModelIndex &index) const {
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
|
|
||||||
if (item->kind() == FeedsModelRootItem::Category) {
|
if (item->kind() == RootItem::Cattegory) {
|
||||||
return item->toCategory();
|
return item->toCategory();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -461,10 +461,10 @@ FeedsModelCategory *FeedsModel::categoryForIndex(const QModelIndex &index) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRecycleBin *FeedsModel::recycleBinForIndex(const QModelIndex &index) const {
|
RecycleBin *FeedsModel::recycleBinForIndex(const QModelIndex &index) const {
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
|
|
||||||
if (item->kind() == FeedsModelRootItem::RecycleBin) {
|
if (item->kind() == RootItem::Bin) {
|
||||||
return item->toRecycleBin();
|
return item->toRecycleBin();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -472,15 +472,15 @@ FeedsModelRecycleBin *FeedsModel::recycleBinForIndex(const QModelIndex &index) c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex FeedsModel::indexForItem(FeedsModelRootItem *item) const {
|
QModelIndex FeedsModel::indexForItem(RootItem *item) const {
|
||||||
if (item == NULL || item->kind() == FeedsModelRootItem::RootItem) {
|
if (item == NULL || item->kind() == RootItem::Root) {
|
||||||
// Root item lies on invalid index.
|
// Root item lies on invalid index.
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStack<FeedsModelRootItem*> chain;
|
QStack<RootItem*> chain;
|
||||||
|
|
||||||
while (item->kind() != FeedsModelRootItem::RootItem) {
|
while (item->kind() != RootItem::Root) {
|
||||||
chain.push(item);
|
chain.push(item);
|
||||||
item = item->parent();
|
item = item->parent();
|
||||||
}
|
}
|
||||||
@ -490,7 +490,7 @@ QModelIndex FeedsModel::indexForItem(FeedsModelRootItem *item) const {
|
|||||||
|
|
||||||
// We go through the stack and create our target index.
|
// We go through the stack and create our target index.
|
||||||
while (!chain.isEmpty()) {
|
while (!chain.isEmpty()) {
|
||||||
FeedsModelRootItem *parent_item = chain.pop();
|
RootItem *parent_item = chain.pop();
|
||||||
target_index = index(parent_item->parent()->childItems().indexOf(parent_item), 0, target_index);
|
target_index = index(parent_item->parent()->childItems().indexOf(parent_item), 0, target_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,8 +498,8 @@ QModelIndex FeedsModel::indexForItem(FeedsModelRootItem *item) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::hasAnyFeedNewMessages() {
|
bool FeedsModel::hasAnyFeedNewMessages() {
|
||||||
foreach (const FeedsModelFeed *feed, allFeeds()) {
|
foreach (const Feed *feed, allFeeds()) {
|
||||||
if (feed->status() == FeedsModelFeed::NewMessages) {
|
if (feed->status() == Feed::NewMessages) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -514,8 +514,8 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStack<FeedsModelRootItem*> original_parents; original_parents.push(m_rootItem);
|
QStack<RootItem*> original_parents; original_parents.push(m_rootItem);
|
||||||
QStack<FeedsModelRootItem*> new_parents; new_parents.push(model->rootItem());
|
QStack<RootItem*> new_parents; new_parents.push(model->rootItem());
|
||||||
bool some_feed_category_error = false;
|
bool some_feed_category_error = false;
|
||||||
|
|
||||||
// We are definitely about to add some new items into the model.
|
// We are definitely about to add some new items into the model.
|
||||||
@ -523,19 +523,19 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
|
|||||||
|
|
||||||
// Iterate all new items we would like to merge into current model.
|
// Iterate all new items we would like to merge into current model.
|
||||||
while (!new_parents.isEmpty()) {
|
while (!new_parents.isEmpty()) {
|
||||||
FeedsModelRootItem *target_parent = original_parents.pop();
|
RootItem *target_parent = original_parents.pop();
|
||||||
FeedsModelRootItem *source_parent = new_parents.pop();
|
RootItem *source_parent = new_parents.pop();
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *source_item, source_parent->childItems()) {
|
foreach (RootItem *source_item, source_parent->childItems()) {
|
||||||
if (!model->isItemChecked(source_item)) {
|
if (!model->isItemChecked(source_item)) {
|
||||||
// We can skip this item, because it is not checked and should not be imported.
|
// We can skip this item, because it is not checked and should not be imported.
|
||||||
// NOTE: All descendants are thus skipped too.
|
// NOTE: All descendants are thus skipped too.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source_item->kind() == FeedsModelRootItem::Category) {
|
if (source_item->kind() == RootItem::Cattegory) {
|
||||||
FeedsModelCategory *source_category = source_item->toCategory();
|
Category *source_category = source_item->toCategory();
|
||||||
FeedsModelCategory *new_category = new FeedsModelCategory(*source_category);
|
Category *new_category = new Category(*source_category);
|
||||||
|
|
||||||
// Add category to model.
|
// Add category to model.
|
||||||
new_category->clearChildren();
|
new_category->clearChildren();
|
||||||
@ -549,7 +549,7 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
|
|||||||
// Add category failed, but this can mean that the same category (with same title)
|
// Add category failed, but this can mean that the same category (with same title)
|
||||||
// already exists. If such a category exists in current parent, then find it and
|
// already exists. If such a category exists in current parent, then find it and
|
||||||
// add descendants to it.
|
// add descendants to it.
|
||||||
FeedsModelRootItem *existing_category = target_parent->child(FeedsModelRootItem::Category, new_category->title());
|
RootItem *existing_category = target_parent->child(RootItem::Cattegory, new_category->title());
|
||||||
|
|
||||||
if (existing_category != NULL) {
|
if (existing_category != NULL) {
|
||||||
original_parents.push(existing_category);
|
original_parents.push(existing_category);
|
||||||
@ -560,9 +560,9 @@ bool FeedsModel::mergeModel(FeedsImportExportModel *model, QString &output_messa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (source_item->kind() == FeedsModelRootItem::Feed) {
|
else if (source_item->kind() == RootItem::Feeed) {
|
||||||
FeedsModelFeed *source_feed = source_item->toFeed();
|
Feed *source_feed = source_item->toFeed();
|
||||||
FeedsModelFeed *new_feed = new FeedsModelFeed(*source_feed);
|
Feed *new_feed = new Feed(*source_feed);
|
||||||
|
|
||||||
// Append this feed and end this iteration.
|
// Append this feed and end this iteration.
|
||||||
if (!addFeed(new_feed, target_parent)) {
|
if (!addFeed(new_feed, target_parent)) {
|
||||||
@ -595,11 +595,11 @@ void FeedsModel::reloadChangedLayout(QModelIndexList list) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList FeedsModel::textualFeedIds(const QList<FeedsModelFeed*> &feeds) {
|
QStringList FeedsModel::textualFeedIds(const QList<Feed*> &feeds) {
|
||||||
QStringList stringy_ids;
|
QStringList stringy_ids;
|
||||||
stringy_ids.reserve(feeds.size());
|
stringy_ids.reserve(feeds.size());
|
||||||
|
|
||||||
foreach (FeedsModelFeed *feed, feeds) {
|
foreach (Feed *feed, feeds) {
|
||||||
stringy_ids.append(QString::number(feed->id()));
|
stringy_ids.append(QString::number(feed->id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,7 +632,7 @@ void FeedsModel::loadFromDatabase() {
|
|||||||
while (query_categories.next()) {
|
while (query_categories.next()) {
|
||||||
CategoryAssignmentItem pair;
|
CategoryAssignmentItem pair;
|
||||||
pair.first = query_categories.value(CAT_DB_PARENT_ID_INDEX).toInt();
|
pair.first = query_categories.value(CAT_DB_PARENT_ID_INDEX).toInt();
|
||||||
pair.second = new FeedsModelCategory(query_categories.record());
|
pair.second = new Category(query_categories.record());
|
||||||
|
|
||||||
categories << pair;
|
categories << pair;
|
||||||
}
|
}
|
||||||
@ -648,16 +648,16 @@ void FeedsModel::loadFromDatabase() {
|
|||||||
|
|
||||||
while (query_feeds.next()) {
|
while (query_feeds.next()) {
|
||||||
// Process this feed.
|
// Process this feed.
|
||||||
FeedsModelFeed::Type type = static_cast<FeedsModelFeed::Type>(query_feeds.value(FDS_DB_TYPE_INDEX).toInt());
|
Feed::Type type = static_cast<Feed::Type>(query_feeds.value(FDS_DB_TYPE_INDEX).toInt());
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FeedsModelFeed::Atom10:
|
case Feed::Atom10:
|
||||||
case FeedsModelFeed::Rdf:
|
case Feed::Rdf:
|
||||||
case FeedsModelFeed::Rss0X:
|
case Feed::Rss0X:
|
||||||
case FeedsModelFeed::Rss2X: {
|
case Feed::Rss2X: {
|
||||||
FeedAssignmentItem pair;
|
FeedAssignmentItem pair;
|
||||||
pair.first = query_feeds.value(FDS_DB_CATEGORY_INDEX).toInt();
|
pair.first = query_feeds.value(FDS_DB_CATEGORY_INDEX).toInt();
|
||||||
pair.second = new FeedsModelFeed(query_feeds.record());
|
pair.second = new Feed(query_feeds.record());
|
||||||
pair.second->setType(type);
|
pair.second->setType(type);
|
||||||
|
|
||||||
feeds << pair;
|
feeds << pair;
|
||||||
@ -677,15 +677,15 @@ void FeedsModel::loadFromDatabase() {
|
|||||||
m_rootItem->appendChild(m_recycleBin);
|
m_rootItem->appendChild(m_recycleBin);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsModel::feedsForIndex(const QModelIndex &index) {
|
QList<Feed*> FeedsModel::feedsForIndex(const QModelIndex &index) {
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
return feedsForItem(item);
|
return feedsForItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed *FeedsModel::feedForIndex(const QModelIndex &index) {
|
Feed *FeedsModel::feedForIndex(const QModelIndex &index) {
|
||||||
FeedsModelRootItem *item = itemForIndex(index);
|
RootItem *item = itemForIndex(index);
|
||||||
|
|
||||||
if (item->kind() == FeedsModelRootItem::Feed) {
|
if (item->kind() == RootItem::Feeed) {
|
||||||
return item->toFeed();
|
return item->toFeed();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -693,8 +693,8 @@ FeedsModelFeed *FeedsModel::feedForIndex(const QModelIndex &index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsModel::feedsForIndexes(const QModelIndexList &indexes) {
|
QList<Feed*> FeedsModel::feedsForIndexes(const QModelIndexList &indexes) {
|
||||||
QList<FeedsModelFeed*> feeds;
|
QList<Feed*> feeds;
|
||||||
|
|
||||||
// Get selected feeds for each index.
|
// Get selected feeds for each index.
|
||||||
foreach (const QModelIndex &index, indexes) {
|
foreach (const QModelIndex &index, indexes) {
|
||||||
@ -706,14 +706,14 @@ QList<FeedsModelFeed*> FeedsModel::feedsForIndexes(const QModelIndexList &indexe
|
|||||||
// Selection contains duplicate feeds (for
|
// Selection contains duplicate feeds (for
|
||||||
// example situation where feed and its parent category are both
|
// example situation where feed and its parent category are both
|
||||||
// selected). So, remove duplicates from the list.
|
// selected). So, remove duplicates from the list.
|
||||||
qSort(feeds.begin(), feeds.end(), FeedsModelRootItem::lessThan);
|
qSort(feeds.begin(), feeds.end(), RootItem::lessThan);
|
||||||
feeds.erase(std::unique(feeds.begin(), feeds.end(), FeedsModelRootItem::isEqual), feeds.end());
|
feeds.erase(std::unique(feeds.begin(), feeds.end(), RootItem::isEqual), feeds.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
return feeds;
|
return feeds;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::markFeedsRead(const QList<FeedsModelFeed*> &feeds, int read) {
|
bool FeedsModel::markFeedsRead(const QList<Feed*> &feeds, int read) {
|
||||||
QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings);
|
QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings);
|
||||||
|
|
||||||
if (!db_handle.transaction()) {
|
if (!db_handle.transaction()) {
|
||||||
@ -748,7 +748,7 @@ bool FeedsModel::markFeedsRead(const QList<FeedsModelFeed*> &feeds, int read) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::markFeedsDeleted(const QList<FeedsModelFeed*> &feeds, int deleted, bool read_only) {
|
bool FeedsModel::markFeedsDeleted(const QList<Feed*> &feeds, int deleted, bool read_only) {
|
||||||
QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings);
|
QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings);
|
||||||
|
|
||||||
if (!db_handle.transaction()) {
|
if (!db_handle.transaction()) {
|
||||||
@ -794,24 +794,24 @@ bool FeedsModel::markFeedsDeleted(const QList<FeedsModelFeed*> &feeds, int delet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<int, FeedsModelCategory*> FeedsModel::allCategories() {
|
QHash<int, Category*> FeedsModel::allCategories() {
|
||||||
return categoriesForItem(m_rootItem);
|
return categoriesForItem(m_rootItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<int, FeedsModelCategory*> FeedsModel::categoriesForItem(FeedsModelRootItem *root) {
|
QHash<int, Category*> FeedsModel::categoriesForItem(RootItem *root) {
|
||||||
QHash<int, FeedsModelCategory*> categories;
|
QHash<int, Category*> categories;
|
||||||
QList<FeedsModelRootItem*> parents;
|
QList<RootItem*> parents;
|
||||||
|
|
||||||
parents.append(root->childItems());
|
parents.append(root->childItems());
|
||||||
|
|
||||||
while (!parents.isEmpty()) {
|
while (!parents.isEmpty()) {
|
||||||
FeedsModelRootItem *item = parents.takeFirst();
|
RootItem *item = parents.takeFirst();
|
||||||
|
|
||||||
if (item->kind() == FeedsModelRootItem::Category) {
|
if (item->kind() == RootItem::Cattegory) {
|
||||||
// This item is category, add it to the output list and
|
// This item is category, add it to the output list and
|
||||||
// scan its children.
|
// scan its children.
|
||||||
int category_id = item->id();
|
int category_id = item->id();
|
||||||
FeedsModelCategory *category = item->toCategory();
|
Category *category = item->toCategory();
|
||||||
|
|
||||||
if (!categories.contains(category_id)) {
|
if (!categories.contains(category_id)) {
|
||||||
categories.insert(category_id, category);
|
categories.insert(category_id, category);
|
||||||
@ -824,16 +824,16 @@ QHash<int, FeedsModelCategory*> FeedsModel::categoriesForItem(FeedsModelRootItem
|
|||||||
return categories;
|
return categories;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsModel::allFeeds() {
|
QList<Feed*> FeedsModel::allFeeds() {
|
||||||
return feedsForItem(m_rootItem);
|
return feedsForItem(m_rootItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsModel::feedsForItem(FeedsModelRootItem *root) {
|
QList<Feed*> FeedsModel::feedsForItem(RootItem *root) {
|
||||||
QList<FeedsModelRootItem*> children = root->getRecursiveChildren();
|
QList<RootItem*> children = root->getRecursiveChildren();
|
||||||
QList<FeedsModelFeed*> feeds;
|
QList<Feed*> feeds;
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child, children) {
|
foreach (RootItem *child, children) {
|
||||||
if (child->kind() == FeedsModelRootItem::Feed) {
|
if (child->kind() == RootItem::Feeed) {
|
||||||
feeds.append(child->toFeed());
|
feeds.append(child->toFeed());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -842,7 +842,7 @@ QList<FeedsModelFeed*> FeedsModel::feedsForItem(FeedsModelRootItem *root) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModel::assembleFeeds(FeedAssignment feeds) {
|
void FeedsModel::assembleFeeds(FeedAssignment feeds) {
|
||||||
QHash<int, FeedsModelCategory*> categories = allCategories();
|
QHash<int, Category*> categories = allCategories();
|
||||||
|
|
||||||
foreach (const FeedAssignmentItem &feed, feeds) {
|
foreach (const FeedAssignmentItem &feed, feeds) {
|
||||||
if (feed.first == NO_PARENT_CATEGORY) {
|
if (feed.first == NO_PARENT_CATEGORY) {
|
||||||
@ -859,12 +859,12 @@ void FeedsModel::assembleFeeds(FeedAssignment feeds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRecycleBin *FeedsModel::recycleBin() const {
|
RecycleBin *FeedsModel::recycleBin() const {
|
||||||
return m_recycleBin;
|
return m_recycleBin;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModel::assembleCategories(CategoryAssignment categories) {
|
void FeedsModel::assembleCategories(CategoryAssignment categories) {
|
||||||
QHash<int, FeedsModelRootItem*> assignments;
|
QHash<int, RootItem*> assignments;
|
||||||
assignments.insert(NO_PARENT_CATEGORY, m_rootItem);
|
assignments.insert(NO_PARENT_CATEGORY, m_rootItem);
|
||||||
|
|
||||||
// Add top-level categories.
|
// Add top-level categories.
|
||||||
|
@ -21,27 +21,27 @@
|
|||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
#include "core/messagesmodel.h"
|
#include "core/messagesmodel.h"
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
class FeedsModelRecycleBin;
|
class RecycleBin;
|
||||||
class FeedsImportExportModel;
|
class FeedsImportExportModel;
|
||||||
|
|
||||||
typedef QList<QPair<int, FeedsModelCategory*> > CategoryAssignment;
|
typedef QList<QPair<int, Category*> > CategoryAssignment;
|
||||||
typedef QPair<int, FeedsModelCategory*> CategoryAssignmentItem;
|
typedef QPair<int, Category*> CategoryAssignmentItem;
|
||||||
|
|
||||||
typedef QList<QPair<int, FeedsModelFeed*> > FeedAssignment;
|
typedef QList<QPair<int, Feed*> > FeedAssignment;
|
||||||
typedef QPair<int, FeedsModelFeed*> FeedAssignmentItem;
|
typedef QPair<int, Feed*> FeedAssignmentItem;
|
||||||
|
|
||||||
class FeedsModel : public QAbstractItemModel {
|
class FeedsModel : public QAbstractItemModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
friend class FeedsModelFeed;
|
friend class Feed;
|
||||||
friend class FeedsModelCategory;
|
friend class Category;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructors and destructors.
|
// Constructors and destructors.
|
||||||
@ -78,73 +78,73 @@ class FeedsModel : public QAbstractItemModel {
|
|||||||
bool removeItem(const QModelIndex &index);
|
bool removeItem(const QModelIndex &index);
|
||||||
|
|
||||||
// Standard category manipulators.
|
// Standard category manipulators.
|
||||||
bool addCategory(FeedsModelCategory *category, FeedsModelRootItem *parent);
|
bool addCategory(Category *category, RootItem *parent);
|
||||||
bool editCategory(FeedsModelCategory *original_category, FeedsModelCategory *new_category_data);
|
bool editCategory(Category *original_category, Category *new_category_data);
|
||||||
|
|
||||||
// Standard feed manipulators.
|
// Standard feed manipulators.
|
||||||
bool addFeed(FeedsModelFeed *feed, FeedsModelRootItem *parent);
|
bool addFeed(Feed *feed, RootItem *parent);
|
||||||
|
|
||||||
// New feed is just temporary feed, it is not added to the model.
|
// New feed is just temporary feed, it is not added to the model.
|
||||||
// It is used to fetch its data to the original feed
|
// It is used to fetch its data to the original feed
|
||||||
// and the original feed is moved if needed.
|
// and the original feed is moved if needed.
|
||||||
bool editFeed(FeedsModelFeed *original_feed, FeedsModelFeed *new_feed_data);
|
bool editFeed(Feed *original_feed, Feed *new_feed_data);
|
||||||
|
|
||||||
// Returns the list of updates which should be updated
|
// Returns the list of updates which should be updated
|
||||||
// according to auto-update schedule.
|
// according to auto-update schedule.
|
||||||
// Variable "auto_update_now" is true, when global timeout
|
// Variable "auto_update_now" is true, when global timeout
|
||||||
// for scheduled auto-update was met so feeds with "default"
|
// for scheduled auto-update was met so feeds with "default"
|
||||||
// auto-update strategy should be updated.
|
// auto-update strategy should be updated.
|
||||||
QList<FeedsModelFeed*> feedsForScheduledUpdate(bool auto_update_now);
|
QList<Feed*> feedsForScheduledUpdate(bool auto_update_now);
|
||||||
|
|
||||||
// Returns (undeleted) messages for given feeds.
|
// Returns (undeleted) messages for given feeds.
|
||||||
// This is usually used for displaying whole feeds
|
// This is usually used for displaying whole feeds
|
||||||
// in "newspaper" mode.
|
// in "newspaper" mode.
|
||||||
QList<Message> messagesForFeeds(const QList<FeedsModelFeed*> &feeds);
|
QList<Message> messagesForFeeds(const QList<Feed*> &feeds);
|
||||||
|
|
||||||
// Returns all categories, each pair
|
// Returns all categories, each pair
|
||||||
// consists of ID of parent item and pointer to category.
|
// consists of ID of parent item and pointer to category.
|
||||||
QHash<int, FeedsModelCategory*> allCategories();
|
QHash<int, Category*> allCategories();
|
||||||
|
|
||||||
// Returns categories from the subtree with given root node, each pair
|
// Returns categories from the subtree with given root node, each pair
|
||||||
// consists of ID of parent item and pointer to category.
|
// consists of ID of parent item and pointer to category.
|
||||||
QHash<int, FeedsModelCategory*> categoriesForItem(FeedsModelRootItem *root);
|
QHash<int, Category*> categoriesForItem(RootItem *root);
|
||||||
|
|
||||||
// Returns list of all feeds contained in the model.
|
// Returns list of all feeds contained in the model.
|
||||||
QList<FeedsModelFeed*> allFeeds();
|
QList<Feed*> allFeeds();
|
||||||
|
|
||||||
// Get list of feeds from tree with particular item
|
// Get list of feeds from tree with particular item
|
||||||
// as root. If root itself is a feed, then it is returned.
|
// as root. If root itself is a feed, then it is returned.
|
||||||
QList<FeedsModelFeed*> feedsForItem(FeedsModelRootItem *root);
|
QList<Feed*> feedsForItem(RootItem *root);
|
||||||
|
|
||||||
// Returns list of ALL CHILD feeds which belong to given parent indexes.
|
// Returns list of ALL CHILD feeds which belong to given parent indexes.
|
||||||
QList<FeedsModelFeed*> feedsForIndexes(const QModelIndexList &indexes);
|
QList<Feed*> feedsForIndexes(const QModelIndexList &indexes);
|
||||||
|
|
||||||
// Returns ALL CHILD feeds contained within single index.
|
// Returns ALL CHILD feeds contained within single index.
|
||||||
QList<FeedsModelFeed*> feedsForIndex(const QModelIndex &index);
|
QList<Feed*> feedsForIndex(const QModelIndex &index);
|
||||||
|
|
||||||
// Returns pointer to feed if it lies on given index
|
// Returns pointer to feed if it lies on given index
|
||||||
// or NULL if no feed lies on given index.
|
// or NULL if no feed lies on given index.
|
||||||
FeedsModelFeed *feedForIndex(const QModelIndex &index);
|
Feed *feedForIndex(const QModelIndex &index);
|
||||||
|
|
||||||
// Returns pointer to category if it lies on given index
|
// Returns pointer to category if it lies on given index
|
||||||
// or NULL if no category lies on given index.
|
// or NULL if no category lies on given index.
|
||||||
FeedsModelCategory *categoryForIndex(const QModelIndex &index) const;
|
Category *categoryForIndex(const QModelIndex &index) const;
|
||||||
|
|
||||||
// Returns pointer to recycle bin if lies on given index
|
// Returns pointer to recycle bin if lies on given index
|
||||||
// or NULL if no recycle bin lies on given index.
|
// or NULL if no recycle bin lies on given index.
|
||||||
FeedsModelRecycleBin *recycleBinForIndex(const QModelIndex &index) const;
|
RecycleBin *recycleBinForIndex(const QModelIndex &index) const;
|
||||||
|
|
||||||
// Returns feed/category which lies at the specified index or
|
// Returns feed/category which lies at the specified index or
|
||||||
// root item if index is invalid.
|
// root item if index is invalid.
|
||||||
FeedsModelRootItem *itemForIndex(const QModelIndex &index) const;
|
RootItem *itemForIndex(const QModelIndex &index) const;
|
||||||
|
|
||||||
// Returns source QModelIndex on which lies given item.
|
// Returns source QModelIndex on which lies given item.
|
||||||
QModelIndex indexForItem(FeedsModelRootItem *item) const;
|
QModelIndex indexForItem(RootItem *item) const;
|
||||||
|
|
||||||
bool hasAnyFeedNewMessages();
|
bool hasAnyFeedNewMessages();
|
||||||
|
|
||||||
// Access to root item.
|
// Access to root item.
|
||||||
inline FeedsModelRootItem *rootItem() const {
|
inline RootItem *rootItem() const {
|
||||||
return m_rootItem;
|
return m_rootItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,12 +153,12 @@ class FeedsModel : public QAbstractItemModel {
|
|||||||
bool mergeModel(FeedsImportExportModel *model, QString &output_message);
|
bool mergeModel(FeedsImportExportModel *model, QString &output_message);
|
||||||
|
|
||||||
// Access to recycle bin.
|
// Access to recycle bin.
|
||||||
FeedsModelRecycleBin *recycleBin() const;
|
RecycleBin *recycleBin() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Feeds operations.
|
// Feeds operations.
|
||||||
bool markFeedsRead(const QList<FeedsModelFeed*> &feeds, int read);
|
bool markFeedsRead(const QList<Feed*> &feeds, int read);
|
||||||
bool markFeedsDeleted(const QList<FeedsModelFeed*> &feeds, int deleted, bool read_only);
|
bool markFeedsDeleted(const QList<Feed*> &feeds, int deleted, bool read_only);
|
||||||
|
|
||||||
// Signals that properties (probably counts)
|
// Signals that properties (probably counts)
|
||||||
// of ALL items have changed.
|
// of ALL items have changed.
|
||||||
@ -172,7 +172,7 @@ class FeedsModel : public QAbstractItemModel {
|
|||||||
protected:
|
protected:
|
||||||
// Returns converted ids of given feeds
|
// Returns converted ids of given feeds
|
||||||
// which are suitable as IN clause for SQL queries.
|
// which are suitable as IN clause for SQL queries.
|
||||||
QStringList textualFeedIds(const QList<FeedsModelFeed*> &feeds);
|
QStringList textualFeedIds(const QList<Feed*> &feeds);
|
||||||
|
|
||||||
// Loads feed/categories from the database.
|
// Loads feed/categories from the database.
|
||||||
void loadFromDatabase();
|
void loadFromDatabase();
|
||||||
@ -186,8 +186,8 @@ class FeedsModel : public QAbstractItemModel {
|
|||||||
void requireItemValidationAfterDragDrop(const QModelIndex &source_index);
|
void requireItemValidationAfterDragDrop(const QModelIndex &source_index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FeedsModelRootItem *m_rootItem;
|
RootItem *m_rootItem;
|
||||||
FeedsModelRecycleBin *m_recycleBin;
|
RecycleBin *m_recycleBin;
|
||||||
QList<QString> m_headerData;
|
QList<QString> m_headerData;
|
||||||
QList<QString> m_tooltipData;
|
QList<QString> m_tooltipData;
|
||||||
QIcon m_countsIcon;
|
QIcon m_countsIcon;
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
|
|
||||||
FeedsProxyModel::FeedsProxyModel(QObject *parent)
|
FeedsProxyModel::FeedsProxyModel(QObject *parent)
|
||||||
@ -134,8 +134,8 @@ QModelIndexList FeedsProxyModel::match(const QModelIndex &start, int role, const
|
|||||||
bool FeedsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
|
bool FeedsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
|
||||||
if (left.isValid() && right.isValid()) {
|
if (left.isValid() && right.isValid()) {
|
||||||
// Make necessary castings.
|
// Make necessary castings.
|
||||||
FeedsModelRootItem *left_item = m_sourceModel->itemForIndex(left);
|
RootItem *left_item = m_sourceModel->itemForIndex(left);
|
||||||
FeedsModelRootItem *right_item = m_sourceModel->itemForIndex(right);
|
RootItem *right_item = m_sourceModel->itemForIndex(right);
|
||||||
|
|
||||||
// NOTE: Here we want to accomplish that ALL
|
// NOTE: Here we want to accomplish that ALL
|
||||||
// categories are queued one after another and all
|
// categories are queued one after another and all
|
||||||
@ -154,15 +154,15 @@ bool FeedsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right
|
|||||||
return QString::localeAwareCompare(left_item->title(), right_item->title()) < 0;
|
return QString::localeAwareCompare(left_item->title(), right_item->title()) < 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (left_item->kind() == FeedsModelRootItem::RecycleBin) {
|
else if (left_item->kind() == RootItem::Bin) {
|
||||||
// Left item is recycle bin. Make sure it is "biggest" item if we have selected ascending order.
|
// Left item is recycle bin. Make sure it is "biggest" item if we have selected ascending order.
|
||||||
return sortOrder() == Qt::DescendingOrder;
|
return sortOrder() == Qt::DescendingOrder;
|
||||||
}
|
}
|
||||||
else if (right_item->kind() == FeedsModelRootItem::RecycleBin) {
|
else if (right_item->kind() == RootItem::Bin) {
|
||||||
// Right item is recycle bin. Make sure it is "smallest" item if we have selected descending order.
|
// Right item is recycle bin. Make sure it is "smallest" item if we have selected descending order.
|
||||||
return sortOrder() == Qt::AscendingOrder;
|
return sortOrder() == Qt::AscendingOrder;
|
||||||
}
|
}
|
||||||
else if (left_item->kind() == FeedsModelRootItem::Feed) {
|
else if (left_item->kind() == RootItem::Feeed) {
|
||||||
// Left item is feed, right item is category.
|
// Left item is feed, right item is category.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -190,9 +190,9 @@ bool FeedsProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *item = m_sourceModel->itemForIndex(idx);
|
RootItem *item = m_sourceModel->itemForIndex(idx);
|
||||||
|
|
||||||
if (item->kind() == FeedsModelRootItem::RecycleBin) {
|
if (item->kind() == RootItem::Bin) {
|
||||||
// Recycle bin is always displayed.
|
// Recycle bin is always displayed.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -205,11 +205,11 @@ bool FeedsProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsProxyModel::selectedItem() const {
|
RootItem *FeedsProxyModel::selectedItem() const {
|
||||||
return m_selectedItem;
|
return m_selectedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsProxyModel::setSelectedItem(FeedsModelRootItem *selected_item) {
|
void FeedsProxyModel::setSelectedItem(RootItem *selected_item) {
|
||||||
m_selectedItem = selected_item;
|
m_selectedItem = selected_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#ifndef FEEDSPROXYMODEL_H
|
#ifndef FEEDSPROXYMODEL_H
|
||||||
#define FEEDSPROXYMODEL_H
|
#define FEEDSPROXYMODEL_H
|
||||||
|
|
||||||
#include "feedsmodelrootitem.h"
|
#include "rootitem.h"
|
||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
@ -46,8 +46,8 @@ class FeedsProxyModel : public QSortFilterProxyModel {
|
|||||||
bool showUnreadOnly() const;
|
bool showUnreadOnly() const;
|
||||||
void setShowUnreadOnly(bool show_unread_only);
|
void setShowUnreadOnly(bool show_unread_only);
|
||||||
|
|
||||||
FeedsModelRootItem *selectedItem() const;
|
RootItem *selectedItem() const;
|
||||||
void setSelectedItem(FeedsModelRootItem *selected_item);
|
void setSelectedItem(RootItem *selected_item);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void invalidateFilter();
|
void invalidateFilter();
|
||||||
@ -61,7 +61,7 @@ class FeedsProxyModel : public QSortFilterProxyModel {
|
|||||||
// Source model pointer.
|
// Source model pointer.
|
||||||
FeedsModel *m_sourceModel;
|
FeedsModel *m_sourceModel;
|
||||||
|
|
||||||
FeedsModelRootItem *m_selectedItem;
|
RootItem *m_selectedItem;
|
||||||
bool m_showUnreadOnly;
|
bool m_showUnreadOnly;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
#include "core/feedsselection.h"
|
#include "core/feedsselection.h"
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
|
|
||||||
|
|
||||||
FeedsSelection::FeedsSelection(FeedsModelRootItem *root_of_selection) : m_selectedItem(root_of_selection) {
|
FeedsSelection::FeedsSelection(RootItem *root_of_selection) : m_selectedItem(root_of_selection) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsSelection::FeedsSelection(const FeedsSelection &other) {
|
FeedsSelection::FeedsSelection(const FeedsSelection &other) {
|
||||||
@ -39,11 +39,11 @@ FeedsSelection::SelectionMode FeedsSelection::mode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (m_selectedItem->kind()) {
|
switch (m_selectedItem->kind()) {
|
||||||
case FeedsModelRootItem::RecycleBin:
|
case RootItem::Bin:
|
||||||
return FeedsSelection::MessagesFromRecycleBin;
|
return FeedsSelection::MessagesFromRecycleBin;
|
||||||
|
|
||||||
case FeedsModelRootItem::Category:
|
case RootItem::Cattegory:
|
||||||
case FeedsModelRootItem::Feed:
|
case RootItem::Feeed:
|
||||||
return FeedsSelection::MessagesFromFeeds;
|
return FeedsSelection::MessagesFromFeeds;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -51,18 +51,18 @@ FeedsSelection::SelectionMode FeedsSelection::mode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsSelection::selectedItem() const {
|
RootItem *FeedsSelection::selectedItem() const {
|
||||||
return m_selectedItem;
|
return m_selectedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FeedsSelection::generateListOfIds() {
|
QString FeedsSelection::generateListOfIds() {
|
||||||
if (m_selectedItem != NULL &&
|
if (m_selectedItem != NULL &&
|
||||||
(m_selectedItem->kind() == FeedsModelRootItem::Feed || m_selectedItem->kind() == FeedsModelRootItem::Category)) {
|
(m_selectedItem->kind() == RootItem::Feeed || m_selectedItem->kind() == RootItem::Cattegory)) {
|
||||||
QList<FeedsModelRootItem*> children = m_selectedItem->getRecursiveChildren();
|
QList<RootItem*> children = m_selectedItem->getRecursiveChildren();
|
||||||
QStringList stringy_ids;
|
QStringList stringy_ids;
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child, children) {
|
foreach (RootItem *child, children) {
|
||||||
if (child->kind() == FeedsModelRootItem::Feed) {
|
if (child->kind() == RootItem::Feeed) {
|
||||||
stringy_ids.append(QString::number(child->id()));
|
stringy_ids.append(QString::number(child->id()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
|
||||||
|
|
||||||
class FeedsModelRootItem;
|
class RootItem;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
|
|
||||||
class FeedsSelection {
|
class FeedsSelection {
|
||||||
public:
|
public:
|
||||||
@ -33,16 +33,16 @@ class FeedsSelection {
|
|||||||
MessagesFromRecycleBin
|
MessagesFromRecycleBin
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit FeedsSelection(FeedsModelRootItem *root_of_selection = NULL);
|
explicit FeedsSelection(RootItem *root_of_selection = NULL);
|
||||||
FeedsSelection(const FeedsSelection &other);
|
FeedsSelection(const FeedsSelection &other);
|
||||||
virtual ~FeedsSelection();
|
virtual ~FeedsSelection();
|
||||||
|
|
||||||
SelectionMode mode();
|
SelectionMode mode();
|
||||||
FeedsModelRootItem *selectedItem() const;
|
RootItem *selectedItem() const;
|
||||||
QString generateListOfIds();
|
QString generateListOfIds();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FeedsModelRootItem *m_selectedItem;
|
RootItem *m_selectedItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(FeedsSelection::SelectionMode)
|
Q_DECLARE_METATYPE(FeedsSelection::SelectionMode)
|
||||||
|
34
src/core/feedsmodelrecyclebin.cpp → src/core/recyclebin.cpp
Executable file → Normal file
34
src/core/feedsmodelrecyclebin.cpp → src/core/recyclebin.cpp
Executable file → Normal file
@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "core/feedsmodelrecyclebin.h"
|
#include "core/recyclebin.h"
|
||||||
|
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
@ -23,9 +23,9 @@
|
|||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
|
|
||||||
|
|
||||||
FeedsModelRecycleBin::FeedsModelRecycleBin(FeedsModelRootItem *parent)
|
RecycleBin::RecycleBin(RootItem *parent)
|
||||||
: FeedsModelRootItem(parent) {
|
: RootItem(parent) {
|
||||||
m_kind = FeedsModelRootItem::RecycleBin;
|
m_kind = RootItem::Bin;
|
||||||
m_icon = qApp->icons()->fromTheme(QSL("folder-recycle-bin"));
|
m_icon = qApp->icons()->fromTheme(QSL("folder-recycle-bin"));
|
||||||
m_id = ID_RECYCLE_BIN;
|
m_id = ID_RECYCLE_BIN;
|
||||||
m_title = tr("Recycle bin");
|
m_title = tr("Recycle bin");
|
||||||
@ -35,27 +35,27 @@ FeedsModelRecycleBin::FeedsModelRecycleBin(FeedsModelRootItem *parent)
|
|||||||
updateCounts(true);
|
updateCounts(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRecycleBin::~FeedsModelRecycleBin() {
|
RecycleBin::~RecycleBin() {
|
||||||
qDebug("Destroying FeedsModelRecycleBin instance.");
|
qDebug("Destroying RecycleBin instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRecycleBin::childCount() const {
|
int RecycleBin::childCount() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModelRecycleBin::appendChild(FeedsModelRootItem *child) {
|
void RecycleBin::appendChild(RootItem *child) {
|
||||||
Q_UNUSED(child)
|
Q_UNUSED(child)
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRecycleBin::countOfUnreadMessages() const {
|
int RecycleBin::countOfUnreadMessages() const {
|
||||||
return m_unreadCount;
|
return m_unreadCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRecycleBin::countOfAllMessages() const {
|
int RecycleBin::countOfAllMessages() const {
|
||||||
return m_totalCount;
|
return m_totalCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FeedsModelRecycleBin::data(int column, int role) const {
|
QVariant RecycleBin::data(int column, int role) const {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
if (column == FDS_MODEL_TITLE_INDEX) {
|
if (column == FDS_MODEL_TITLE_INDEX) {
|
||||||
@ -108,8 +108,8 @@ QVariant FeedsModelRecycleBin::data(int column, int role) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRecycleBin::empty() {
|
bool RecycleBin::empty() {
|
||||||
QSqlDatabase db_handle = qApp->database()->connection(QSL("FeedsModelRecycleBin"), DatabaseFactory::FromSettings);
|
QSqlDatabase db_handle = qApp->database()->connection(QSL("RecycleBin"), DatabaseFactory::FromSettings);
|
||||||
|
|
||||||
if (!db_handle.transaction()) {
|
if (!db_handle.transaction()) {
|
||||||
qWarning("Starting transaction for recycle bin emptying.");
|
qWarning("Starting transaction for recycle bin emptying.");
|
||||||
@ -135,8 +135,8 @@ bool FeedsModelRecycleBin::empty() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRecycleBin::restore() {
|
bool RecycleBin::restore() {
|
||||||
QSqlDatabase db_handle = qApp->database()->connection(QSL("FeedsModelRecycleBin"), DatabaseFactory::FromSettings);
|
QSqlDatabase db_handle = qApp->database()->connection(QSL("RecycleBin"), DatabaseFactory::FromSettings);
|
||||||
|
|
||||||
if (!db_handle.transaction()) {
|
if (!db_handle.transaction()) {
|
||||||
qWarning("Starting transaction for recycle bin restoring.");
|
qWarning("Starting transaction for recycle bin restoring.");
|
||||||
@ -162,8 +162,8 @@ bool FeedsModelRecycleBin::restore() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModelRecycleBin::updateCounts(bool update_total_count) {
|
void RecycleBin::updateCounts(bool update_total_count) {
|
||||||
QSqlDatabase database = qApp->database()->connection(QSL("FeedsModelRecycleBin"), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(QSL("RecycleBin"), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_all(database);
|
QSqlQuery query_all(database);
|
||||||
query_all.setForwardOnly(true);
|
query_all.setForwardOnly(true);
|
||||||
|
|
18
src/core/feedsmodelrecyclebin.h → src/core/recyclebin.h
Executable file → Normal file
18
src/core/feedsmodelrecyclebin.h → src/core/recyclebin.h
Executable file → Normal file
@ -15,23 +15,23 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef FEEDSMODELRECYCLEBIN_H
|
#ifndef RECYCLEBIN_H
|
||||||
#define FEEDSMODELRECYCLEBIN_H
|
#define RECYCLEBIN_H
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
|
|
||||||
class FeedsModelRecycleBin : public FeedsModelRootItem {
|
class RecycleBin : public RootItem {
|
||||||
Q_DECLARE_TR_FUNCTIONS(FeedsModelRecycleBin)
|
Q_DECLARE_TR_FUNCTIONS(RecycleBin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FeedsModelRecycleBin(FeedsModelRootItem *parent = NULL);
|
explicit RecycleBin(RootItem *parent = NULL);
|
||||||
virtual ~FeedsModelRecycleBin();
|
virtual ~RecycleBin();
|
||||||
|
|
||||||
int childCount() const;
|
int childCount() const;
|
||||||
void appendChild(FeedsModelRootItem *child);
|
void appendChild(RootItem *child);
|
||||||
int countOfUnreadMessages() const;
|
int countOfUnreadMessages() const;
|
||||||
int countOfAllMessages() const;
|
int countOfAllMessages() const;
|
||||||
QVariant data(int column, int role) const;
|
QVariant data(int column, int role) const;
|
||||||
@ -47,4 +47,4 @@ class FeedsModelRecycleBin : public FeedsModelRootItem {
|
|||||||
int m_unreadCount;
|
int m_unreadCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FEEDSMODELRECYCLEBIN_H
|
#endif // RECYCLEBIN_H
|
80
src/core/feedsmodelrootitem.cpp → src/core/rootitem.cpp
Executable file → Normal file
80
src/core/feedsmodelrootitem.cpp → src/core/rootitem.cpp
Executable file → Normal file
@ -15,41 +15,41 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
|
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsmodelrecyclebin.h"
|
#include "core/recyclebin.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
|
||||||
FeedsModelRootItem::FeedsModelRootItem(FeedsModelRootItem *parent_item)
|
RootItem::RootItem(RootItem *parent_item)
|
||||||
: m_kind(FeedsModelRootItem::RootItem),
|
: m_kind(RootItem::Root),
|
||||||
m_id(NO_PARENT_CATEGORY),
|
m_id(NO_PARENT_CATEGORY),
|
||||||
m_title(QString()),
|
m_title(QString()),
|
||||||
m_description(QString()),
|
m_description(QString()),
|
||||||
m_icon(QIcon()),
|
m_icon(QIcon()),
|
||||||
m_creationDate(QDateTime()),
|
m_creationDate(QDateTime()),
|
||||||
m_childItems(QList<FeedsModelRootItem*>()),
|
m_childItems(QList<RootItem*>()),
|
||||||
m_parentItem(parent_item) {
|
m_parentItem(parent_item) {
|
||||||
setupFonts();
|
setupFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem::~FeedsModelRootItem() {
|
RootItem::~RootItem() {
|
||||||
qDeleteAll(m_childItems);
|
qDeleteAll(m_childItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModelRootItem::setupFonts() {
|
void RootItem::setupFonts() {
|
||||||
m_normalFont = Application::font("FeedsView");
|
m_normalFont = Application::font("FeedsView");
|
||||||
m_boldFont = m_normalFont;
|
m_boldFont = m_normalFont;
|
||||||
m_boldFont.setBold(true);
|
m_boldFont.setBold(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRootItem::row() const {
|
int RootItem::row() const {
|
||||||
if (m_parentItem) {
|
if (m_parentItem) {
|
||||||
return m_parentItem->m_childItems.indexOf(const_cast<FeedsModelRootItem*>(this));
|
return m_parentItem->m_childItems.indexOf(const_cast<RootItem*>(this));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// This item has no parent. Therefore, its row index is 0.
|
// This item has no parent. Therefore, its row index is 0.
|
||||||
@ -57,7 +57,7 @@ int FeedsModelRootItem::row() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FeedsModelRootItem::data(int column, int role) const {
|
QVariant RootItem::data(int column, int role) const {
|
||||||
Q_UNUSED(column)
|
Q_UNUSED(column)
|
||||||
Q_UNUSED(role)
|
Q_UNUSED(role)
|
||||||
|
|
||||||
@ -65,11 +65,11 @@ QVariant FeedsModelRootItem::data(int column, int role) const {
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRootItem::countOfAllMessages() const {
|
int RootItem::countOfAllMessages() const {
|
||||||
int total_count = 0;
|
int total_count = 0;
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child_item, m_childItems) {
|
foreach (RootItem *child_item, m_childItems) {
|
||||||
if (child_item->kind() != FeedsModelRootItem::RecycleBin) {
|
if (child_item->kind() != RootItem::Bin) {
|
||||||
total_count += child_item->countOfAllMessages();
|
total_count += child_item->countOfAllMessages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,29 +77,29 @@ int FeedsModelRootItem::countOfAllMessages() const {
|
|||||||
return total_count;
|
return total_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelRootItem*> FeedsModelRootItem::getRecursiveChildren() {
|
QList<RootItem*> RootItem::getRecursiveChildren() {
|
||||||
QList<FeedsModelRootItem*> children;
|
QList<RootItem*> children;
|
||||||
|
|
||||||
if (kind() == FeedsModelRootItem::Feed) {
|
if (kind() == RootItem::Feeed) {
|
||||||
// Root itself is a FEED.
|
// Root itself is a FEED.
|
||||||
children.append(this);
|
children.append(this);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Root itself is a CATEGORY or ROOT item.
|
// Root itself is a CATEGORY or ROOT item.
|
||||||
QList<FeedsModelRootItem*> traversable_items;
|
QList<RootItem*> traversable_items;
|
||||||
|
|
||||||
traversable_items.append(this);
|
traversable_items.append(this);
|
||||||
|
|
||||||
// Iterate all nested categories.
|
// Iterate all nested categories.
|
||||||
while (!traversable_items.isEmpty()) {
|
while (!traversable_items.isEmpty()) {
|
||||||
FeedsModelRootItem *active_category = traversable_items.takeFirst();
|
RootItem *active_category = traversable_items.takeFirst();
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child, active_category->childItems()) {
|
foreach (RootItem *child, active_category->childItems()) {
|
||||||
if (child->kind() == FeedsModelRootItem::Feed) {
|
if (child->kind() == RootItem::Feeed) {
|
||||||
// This child is feed.
|
// This child is feed.
|
||||||
children.append(child);
|
children.append(child);
|
||||||
}
|
}
|
||||||
else if (child->kind() == FeedsModelRootItem::Category) {
|
else if (child->kind() == RootItem::Cattegory) {
|
||||||
// This child is category, add its child feeds too.
|
// This child is category, add its child feeds too.
|
||||||
traversable_items.append(child);
|
traversable_items.append(child);
|
||||||
}
|
}
|
||||||
@ -110,27 +110,27 @@ QList<FeedsModelRootItem*> FeedsModelRootItem::getRecursiveChildren() {
|
|||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRootItem::removeChild(FeedsModelRootItem *child) {
|
bool RootItem::removeChild(RootItem *child) {
|
||||||
return m_childItems.removeOne(child);
|
return m_childItems.removeOne(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRecycleBin *FeedsModelRootItem::toRecycleBin() {
|
RecycleBin *RootItem::toRecycleBin() {
|
||||||
return static_cast<FeedsModelRecycleBin*>(this);
|
return static_cast<RecycleBin*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory *FeedsModelRootItem::toCategory() {
|
Category *RootItem::toCategory() {
|
||||||
return static_cast<FeedsModelCategory*>(this);
|
return static_cast<Category*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed *FeedsModelRootItem::toFeed() {
|
Feed *RootItem::toFeed() {
|
||||||
return static_cast<FeedsModelFeed*>(this);
|
return static_cast<Feed*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsModelRootItem::child(FeedsModelRootItem::Kind kind_of_child, const QString &identifier) {
|
RootItem *RootItem::child(RootItem::Kind kind_of_child, const QString &identifier) {
|
||||||
foreach (FeedsModelRootItem *child, childItems()) {
|
foreach (RootItem *child, childItems()) {
|
||||||
if (child->kind() == kind_of_child) {
|
if (child->kind() == kind_of_child) {
|
||||||
if ((kind_of_child == Category && child->title() == identifier) ||
|
if ((kind_of_child == Cattegory && child->title() == identifier) ||
|
||||||
(kind_of_child == Feed && child->toFeed()->url() == identifier)) {
|
(kind_of_child == Feeed && child->toFeed()->url() == identifier)) {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,11 +139,11 @@ FeedsModelRootItem *FeedsModelRootItem::child(FeedsModelRootItem::Kind kind_of_c
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FeedsModelRootItem::countOfUnreadMessages() const {
|
int RootItem::countOfUnreadMessages() const {
|
||||||
int total_count = 0;
|
int total_count = 0;
|
||||||
|
|
||||||
foreach (FeedsModelRootItem *child_item, m_childItems) {
|
foreach (RootItem *child_item, m_childItems) {
|
||||||
if (child_item->kind() != FeedsModelRootItem::RecycleBin) {
|
if (child_item->kind() != RootItem::Bin) {
|
||||||
total_count += child_item->countOfUnreadMessages();
|
total_count += child_item->countOfUnreadMessages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ int FeedsModelRootItem::countOfUnreadMessages() const {
|
|||||||
return total_count;
|
return total_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRootItem::removeChild(int index) {
|
bool RootItem::removeChild(int index) {
|
||||||
if (index >= 0 && index < m_childItems.size()) {
|
if (index >= 0 && index < m_childItems.size()) {
|
||||||
m_childItems.removeAt(index);
|
m_childItems.removeAt(index);
|
||||||
return true;
|
return true;
|
||||||
@ -161,11 +161,11 @@ bool FeedsModelRootItem::removeChild(int index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRootItem::isEqual(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs) {
|
bool RootItem::isEqual(RootItem *lhs, RootItem *rhs) {
|
||||||
return (lhs->kind() == rhs->kind()) && (lhs->id() == rhs->id());
|
return (lhs->kind() == rhs->kind()) && (lhs->id() == rhs->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModelRootItem::lessThan(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs) {
|
bool RootItem::lessThan(RootItem *lhs, RootItem *rhs) {
|
||||||
if (lhs->kind() == rhs->kind()) {
|
if (lhs->kind() == rhs->kind()) {
|
||||||
return lhs->id() < rhs->id();
|
return lhs->id() < rhs->id();
|
||||||
}
|
}
|
64
src/core/feedsmodelrootitem.h → src/core/rootitem.h
Executable file → Normal file
64
src/core/feedsmodelrootitem.h → src/core/rootitem.h
Executable file → Normal file
@ -15,55 +15,55 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef FEEDSMODELROOTITEM_H
|
#ifndef ROOTITEM_H
|
||||||
#define FEEDSMODELROOTITEM_H
|
#define ROOTITEM_H
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
|
||||||
class FeedsModelRecycleBin;
|
class RecycleBin;
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
|
|
||||||
// Represents ROOT item of FeedsModel.
|
// Represents ROOT item of FeedsModel.
|
||||||
// NOTE: This class is derived to add functionality for
|
// NOTE: This class is derived to add functionality for
|
||||||
// all other non-root items of FeedsModel.
|
// all other non-root items of FeedsModel.
|
||||||
class FeedsModelRootItem {
|
class RootItem {
|
||||||
public:
|
public:
|
||||||
// Describes the kind of the item.
|
// Describes the kind of the item.
|
||||||
enum Kind {
|
enum Kind {
|
||||||
RootItem = 1001,
|
Root = 1001,
|
||||||
RecycleBin = 1002,
|
Bin = 1002,
|
||||||
Feed = 1003,
|
Feeed = 1003,
|
||||||
Category = 1004
|
Cattegory = 1004
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constructors and destructors.
|
// Constructors and destructors.
|
||||||
explicit FeedsModelRootItem(FeedsModelRootItem *parent_item = NULL);
|
explicit RootItem(RootItem *parent_item = NULL);
|
||||||
virtual ~FeedsModelRootItem();
|
virtual ~RootItem();
|
||||||
|
|
||||||
// Basic operations.
|
// Basic operations.
|
||||||
inline virtual FeedsModelRootItem *parent() const {
|
inline virtual RootItem *parent() const {
|
||||||
return m_parentItem;
|
return m_parentItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline virtual void setParent(FeedsModelRootItem *parent_item) {
|
inline virtual void setParent(RootItem *parent_item) {
|
||||||
m_parentItem = parent_item;
|
m_parentItem = parent_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline virtual FeedsModelRootItem *child(int row) {
|
inline virtual RootItem *child(int row) {
|
||||||
return m_childItems.value(row);
|
return m_childItems.value(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual FeedsModelRootItem *child(FeedsModelRootItem::Kind kind_of_child, const QString &identifier);
|
virtual RootItem *child(RootItem::Kind kind_of_child, const QString &identifier);
|
||||||
|
|
||||||
inline virtual int childCount() const {
|
inline virtual int childCount() const {
|
||||||
return m_childItems.size();
|
return m_childItems.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline virtual void appendChild(FeedsModelRootItem *child) {
|
inline virtual void appendChild(RootItem *child) {
|
||||||
m_childItems.append(child);
|
m_childItems.append(child);
|
||||||
child->setParent(this);
|
child->setParent(this);
|
||||||
}
|
}
|
||||||
@ -87,20 +87,20 @@ class FeedsModelRootItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Access to children.
|
// Access to children.
|
||||||
inline QList<FeedsModelRootItem*> childItems() const {
|
inline QList<RootItem*> childItems() const {
|
||||||
return m_childItems;
|
return m_childItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks whether THIS object is child (direct or indirect)
|
// Checks whether THIS object is child (direct or indirect)
|
||||||
// of the given root.
|
// of the given root.
|
||||||
bool isChildOf(FeedsModelRootItem *root) {
|
bool isChildOf(RootItem *root) {
|
||||||
if (root == NULL) {
|
if (root == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *this_item = this;
|
RootItem *this_item = this;
|
||||||
|
|
||||||
while (this_item->kind() != FeedsModelRootItem::RootItem) {
|
while (this_item->kind() != RootItem::Root) {
|
||||||
if (root->childItems().contains(this_item)) {
|
if (root->childItems().contains(this_item)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ class FeedsModelRootItem {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isParentOf(FeedsModelRootItem *child) {
|
bool isParentOf(RootItem *child) {
|
||||||
if (child == NULL) {
|
if (child == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -127,12 +127,12 @@ class FeedsModelRootItem {
|
|||||||
m_childItems.clear();
|
m_childItems.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelRootItem*> getRecursiveChildren();
|
QList<RootItem*> getRecursiveChildren();
|
||||||
|
|
||||||
// Removes particular child at given index.
|
// Removes particular child at given index.
|
||||||
// NOTE: Child is NOT freed from the memory.
|
// NOTE: Child is NOT freed from the memory.
|
||||||
bool removeChild(int index);
|
bool removeChild(int index);
|
||||||
bool removeChild(FeedsModelRootItem *child);
|
bool removeChild(RootItem *child);
|
||||||
|
|
||||||
inline Kind kind() const {
|
inline Kind kind() const {
|
||||||
return m_kind;
|
return m_kind;
|
||||||
@ -182,13 +182,13 @@ class FeedsModelRootItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converters
|
// Converters
|
||||||
FeedsModelRecycleBin *toRecycleBin();
|
RecycleBin *toRecycleBin();
|
||||||
FeedsModelCategory *toCategory();
|
Category *toCategory();
|
||||||
FeedsModelFeed *toFeed();
|
Feed *toFeed();
|
||||||
|
|
||||||
// Compares two model items.
|
// Compares two model items.
|
||||||
static bool isEqual(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs);
|
static bool isEqual(RootItem *lhs, RootItem *rhs);
|
||||||
static bool lessThan(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs);
|
static bool lessThan(RootItem *lhs, RootItem *rhs);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setupFonts();
|
void setupFonts();
|
||||||
@ -203,8 +203,8 @@ class FeedsModelRootItem {
|
|||||||
QFont m_normalFont;
|
QFont m_normalFont;
|
||||||
QFont m_boldFont;
|
QFont m_boldFont;
|
||||||
|
|
||||||
QList<FeedsModelRootItem*> m_childItems;
|
QList<RootItem*> m_childItems;
|
||||||
FeedsModelRootItem *m_parentItem;
|
RootItem *m_parentItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FEEDMODELROOTITEM_H
|
#endif // ROOTITEM_H
|
@ -18,8 +18,8 @@
|
|||||||
#include "gui/dialogs/formcategorydetails.h"
|
#include "gui/dialogs/formcategorydetails.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
@ -67,7 +67,7 @@ void FormCategoryDetails::createConnections() {
|
|||||||
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
|
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) {
|
void FormCategoryDetails::setEditableCategory(Category *editable_category) {
|
||||||
m_editableCategory = editable_category;
|
m_editableCategory = editable_category;
|
||||||
|
|
||||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_category->parent())));
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_category->parent())));
|
||||||
@ -76,7 +76,7 @@ void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_categ
|
|||||||
m_ui->m_btnIcon->setIcon(editable_category->icon());
|
m_ui->m_btnIcon->setIcon(editable_category->icon());
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormCategoryDetails::exec(FeedsModelCategory *input_category, FeedsModelRootItem *parent_to_select) {
|
int FormCategoryDetails::exec(Category *input_category, RootItem *parent_to_select) {
|
||||||
// Load categories.
|
// Load categories.
|
||||||
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem(), input_category);
|
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem(), input_category);
|
||||||
|
|
||||||
@ -90,10 +90,10 @@ int FormCategoryDetails::exec(FeedsModelCategory *input_category, FeedsModelRoot
|
|||||||
|
|
||||||
// Load parent from suggested item.
|
// Load parent from suggested item.
|
||||||
if (parent_to_select != NULL) {
|
if (parent_to_select != NULL) {
|
||||||
if (parent_to_select->kind() == FeedsModelRootItem::Category) {
|
if (parent_to_select->kind() == RootItem::Cattegory) {
|
||||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||||
}
|
}
|
||||||
else if (parent_to_select->kind() == FeedsModelRootItem::Feed) {
|
else if (parent_to_select->kind() == RootItem::Feeed) {
|
||||||
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
||||||
|
|
||||||
if (target_item >= 0) {
|
if (target_item >= 0) {
|
||||||
@ -113,8 +113,8 @@ int FormCategoryDetails::exec(FeedsModelCategory *input_category, FeedsModelRoot
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormCategoryDetails::apply() {
|
void FormCategoryDetails::apply() {
|
||||||
FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
|
RootItem *parent = static_cast<RootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
|
||||||
FeedsModelCategory *new_category = new FeedsModelCategory();
|
Category *new_category = new Category();
|
||||||
|
|
||||||
new_category->setTitle(m_ui->m_txtTitle->lineEdit()->text());
|
new_category->setTitle(m_ui->m_txtTitle->lineEdit()->text());
|
||||||
new_category->setCreationDate(QDateTime::currentDateTime());
|
new_category->setCreationDate(QDateTime::currentDateTime());
|
||||||
@ -241,14 +241,14 @@ void FormCategoryDetails::initialize() {
|
|||||||
m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason);
|
m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormCategoryDetails::loadCategories(const QList<FeedsModelCategory*> categories,
|
void FormCategoryDetails::loadCategories(const QList<Category*> categories,
|
||||||
FeedsModelRootItem *root_item,
|
RootItem *root_item,
|
||||||
FeedsModelCategory *input_category) {
|
Category *input_category) {
|
||||||
m_ui->m_cmbParentCategory->addItem(root_item->icon(),
|
m_ui->m_cmbParentCategory->addItem(root_item->icon(),
|
||||||
root_item->title(),
|
root_item->title(),
|
||||||
QVariant::fromValue((void*) root_item));
|
QVariant::fromValue((void*) root_item));
|
||||||
|
|
||||||
foreach (FeedsModelCategory *category, categories) {
|
foreach (Category *category, categories) {
|
||||||
if (input_category != NULL && (category == input_category || category->isChildOf(input_category))) {
|
if (input_category != NULL && (category == input_category || category->isChildOf(input_category))) {
|
||||||
// This category cannot be selected as the new
|
// This category cannot be selected as the new
|
||||||
// parent for currently edited category, so
|
// parent for currently edited category, so
|
||||||
|
@ -27,10 +27,10 @@ namespace Ui {
|
|||||||
class FormCategoryDetails;
|
class FormCategoryDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class FeedsModel;
|
class FeedsModel;
|
||||||
class FeedsModelRootItem;
|
class RootItem;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QAction;
|
class QAction;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class FormCategoryDetails : public QDialog {
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Executes add/edit standard category dialog.
|
// Executes add/edit standard category dialog.
|
||||||
int exec(FeedsModelCategory *input_category, FeedsModelRootItem *parent_to_select);
|
int exec(Category *input_category, RootItem *parent_to_select);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// Applies changes.
|
// Applies changes.
|
||||||
@ -64,7 +64,7 @@ class FormCategoryDetails : public QDialog {
|
|||||||
void createConnections();
|
void createConnections();
|
||||||
|
|
||||||
// Sets the category which will be edited.
|
// Sets the category which will be edited.
|
||||||
void setEditableCategory(FeedsModelCategory *editable_category);
|
void setEditableCategory(Category *editable_category);
|
||||||
|
|
||||||
// Initializes the dialog.
|
// Initializes the dialog.
|
||||||
void initialize();
|
void initialize();
|
||||||
@ -72,11 +72,11 @@ class FormCategoryDetails : public QDialog {
|
|||||||
// Loads categories into the dialog + give root "category"
|
// Loads categories into the dialog + give root "category"
|
||||||
// and make sure that no childs of input category (including)
|
// and make sure that no childs of input category (including)
|
||||||
// input category are loaded.
|
// input category are loaded.
|
||||||
void loadCategories(const QList<FeedsModelCategory*> categories, FeedsModelRootItem *root_item, FeedsModelCategory *input_category);
|
void loadCategories(const QList<Category*> categories, RootItem *root_item, Category *input_category);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormCategoryDetails *m_ui;
|
Ui::FormCategoryDetails *m_ui;
|
||||||
FeedsModelCategory *m_editableCategory;
|
Category *m_editableCategory;
|
||||||
FeedsModel *m_feedsModel;
|
FeedsModel *m_feedsModel;
|
||||||
|
|
||||||
QMenu *m_iconMenu;
|
QMenu *m_iconMenu;
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
#include "network-web/networkfactory.h"
|
#include "network-web/networkfactory.h"
|
||||||
@ -58,7 +58,7 @@ FormFeedDetails::~FormFeedDetails() {
|
|||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormFeedDetails::exec(FeedsModelFeed *input_feed, FeedsModelRootItem *parent_to_select) {
|
int FormFeedDetails::exec(Feed *input_feed, RootItem *parent_to_select) {
|
||||||
// Load categories.
|
// Load categories.
|
||||||
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem());
|
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem());
|
||||||
|
|
||||||
@ -77,10 +77,10 @@ int FormFeedDetails::exec(FeedsModelFeed *input_feed, FeedsModelRootItem *parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parent_to_select != NULL) {
|
if (parent_to_select != NULL) {
|
||||||
if (parent_to_select->kind() == FeedsModelRootItem::Category) {
|
if (parent_to_select->kind() == RootItem::Cattegory) {
|
||||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select)));
|
||||||
}
|
}
|
||||||
else if (parent_to_select->kind() == FeedsModelRootItem::Feed) {
|
else if (parent_to_select->kind() == RootItem::Feeed) {
|
||||||
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
int target_item = m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) parent_to_select->parent()));
|
||||||
|
|
||||||
if (target_item >= 0) {
|
if (target_item >= 0) {
|
||||||
@ -168,15 +168,15 @@ void FormFeedDetails::onAuthenticationSwitched() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::onAutoUpdateTypeChanged(int new_index) {
|
void FormFeedDetails::onAutoUpdateTypeChanged(int new_index) {
|
||||||
FeedsModelFeed::AutoUpdateType auto_update_type = static_cast<FeedsModelFeed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(new_index).toInt());
|
Feed::AutoUpdateType auto_update_type = static_cast<Feed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(new_index).toInt());
|
||||||
|
|
||||||
switch (auto_update_type) {
|
switch (auto_update_type) {
|
||||||
case FeedsModelFeed::DontAutoUpdate:
|
case Feed::DontAutoUpdate:
|
||||||
case FeedsModelFeed::DefaultAutoUpdate:
|
case Feed::DefaultAutoUpdate:
|
||||||
m_ui->m_spinAutoUpdateInterval->setEnabled(false);
|
m_ui->m_spinAutoUpdateInterval->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FeedsModelFeed::SpecificAutoUpdate:
|
case Feed::SpecificAutoUpdate:
|
||||||
default:
|
default:
|
||||||
m_ui->m_spinAutoUpdateInterval->setEnabled(true);
|
m_ui->m_spinAutoUpdateInterval->setEnabled(true);
|
||||||
}
|
}
|
||||||
@ -219,9 +219,9 @@ void FormFeedDetails::onUseDefaultIcon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::apply() {
|
void FormFeedDetails::apply() {
|
||||||
FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
|
RootItem *parent = static_cast<RootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
|
||||||
FeedsModelFeed::Type type = static_cast<FeedsModelFeed::Type>(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value<int>());
|
Feed::Type type = static_cast<Feed::Type>(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value<int>());
|
||||||
FeedsModelFeed *new_feed = new FeedsModelFeed();
|
Feed *new_feed = new Feed();
|
||||||
|
|
||||||
// Setup data for new_feed.
|
// Setup data for new_feed.
|
||||||
new_feed->setTitle(m_ui->m_txtTitle->lineEdit()->text());
|
new_feed->setTitle(m_ui->m_txtTitle->lineEdit()->text());
|
||||||
@ -234,7 +234,7 @@ void FormFeedDetails::apply() {
|
|||||||
new_feed->setPasswordProtected(m_ui->m_gbAuthentication->isChecked());
|
new_feed->setPasswordProtected(m_ui->m_gbAuthentication->isChecked());
|
||||||
new_feed->setUsername(m_ui->m_txtUsername->lineEdit()->text());
|
new_feed->setUsername(m_ui->m_txtUsername->lineEdit()->text());
|
||||||
new_feed->setPassword(m_ui->m_txtPassword->lineEdit()->text());
|
new_feed->setPassword(m_ui->m_txtPassword->lineEdit()->text());
|
||||||
new_feed->setAutoUpdateType(static_cast<FeedsModelFeed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt()));
|
new_feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(m_ui->m_cmbAutoUpdateType->currentIndex()).toInt()));
|
||||||
new_feed->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value());
|
new_feed->setAutoUpdateInitialInterval(m_ui->m_spinAutoUpdateInterval->value());
|
||||||
new_feed->setParent(parent);
|
new_feed->setParent(parent);
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ void FormFeedDetails::apply() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::guessFeed() {
|
void FormFeedDetails::guessFeed() {
|
||||||
QPair<FeedsModelFeed*, QNetworkReply::NetworkError> result = FeedsModelFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
QPair<Feed*, QNetworkReply::NetworkError> result = Feed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
||||||
m_ui->m_txtUsername->lineEdit()->text(),
|
m_ui->m_txtUsername->lineEdit()->text(),
|
||||||
m_ui->m_txtPassword->lineEdit()->text());
|
m_ui->m_txtPassword->lineEdit()->text());
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ void FormFeedDetails::guessFeed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::guessIconOnly() {
|
void FormFeedDetails::guessIconOnly() {
|
||||||
QPair<FeedsModelFeed*, QNetworkReply::NetworkError> result = FeedsModelFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
QPair<Feed*, QNetworkReply::NetworkError> result = Feed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
||||||
m_ui->m_txtUsername->lineEdit()->text(),
|
m_ui->m_txtUsername->lineEdit()->text(),
|
||||||
m_ui->m_txtPassword->lineEdit()->text());
|
m_ui->m_txtPassword->lineEdit()->text());
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ void FormFeedDetails::createConnections() {
|
|||||||
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
|
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::setEditableFeed(FeedsModelFeed *editable_feed) {
|
void FormFeedDetails::setEditableFeed(Feed *editable_feed) {
|
||||||
m_editableFeed = editable_feed;
|
m_editableFeed = editable_feed;
|
||||||
|
|
||||||
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_feed->parent())));
|
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_feed->parent())));
|
||||||
@ -405,10 +405,10 @@ void FormFeedDetails::initialize() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add standard feed types.
|
// Add standard feed types.
|
||||||
m_ui->m_cmbType->addItem(FeedsModelFeed::typeToString(FeedsModelFeed::Atom10), QVariant::fromValue((int) FeedsModelFeed::Atom10));
|
m_ui->m_cmbType->addItem(Feed::typeToString(Feed::Atom10), QVariant::fromValue((int) Feed::Atom10));
|
||||||
m_ui->m_cmbType->addItem(FeedsModelFeed::typeToString(FeedsModelFeed::Rdf), QVariant::fromValue((int) FeedsModelFeed::Rdf));
|
m_ui->m_cmbType->addItem(Feed::typeToString(Feed::Rdf), QVariant::fromValue((int) Feed::Rdf));
|
||||||
m_ui->m_cmbType->addItem(FeedsModelFeed::typeToString(FeedsModelFeed::Rss0X), QVariant::fromValue((int) FeedsModelFeed::Rss0X));
|
m_ui->m_cmbType->addItem(Feed::typeToString(Feed::Rss0X), QVariant::fromValue((int) Feed::Rss0X));
|
||||||
m_ui->m_cmbType->addItem(FeedsModelFeed::typeToString(FeedsModelFeed::Rss2X), QVariant::fromValue((int) FeedsModelFeed::Rss2X));
|
m_ui->m_cmbType->addItem(Feed::typeToString(Feed::Rss2X), QVariant::fromValue((int) Feed::Rss2X));
|
||||||
|
|
||||||
// Load available encodings.
|
// Load available encodings.
|
||||||
QList<QByteArray> encodings = QTextCodec::availableCodecs();
|
QList<QByteArray> encodings = QTextCodec::availableCodecs();
|
||||||
@ -449,9 +449,9 @@ void FormFeedDetails::initialize() {
|
|||||||
|
|
||||||
// Setup auto-update options.
|
// Setup auto-update options.
|
||||||
m_ui->m_spinAutoUpdateInterval->setValue(DEFAULT_AUTO_UPDATE_INTERVAL);
|
m_ui->m_spinAutoUpdateInterval->setValue(DEFAULT_AUTO_UPDATE_INTERVAL);
|
||||||
m_ui->m_cmbAutoUpdateType->addItem(tr("Auto-update using global interval"), QVariant::fromValue((int) FeedsModelFeed::DefaultAutoUpdate));
|
m_ui->m_cmbAutoUpdateType->addItem(tr("Auto-update using global interval"), QVariant::fromValue((int) Feed::DefaultAutoUpdate));
|
||||||
m_ui->m_cmbAutoUpdateType->addItem(tr("Auto-update every"), QVariant::fromValue((int) FeedsModelFeed::SpecificAutoUpdate));
|
m_ui->m_cmbAutoUpdateType->addItem(tr("Auto-update every"), QVariant::fromValue((int) Feed::SpecificAutoUpdate));
|
||||||
m_ui->m_cmbAutoUpdateType->addItem(tr("Do not auto-update at all"), QVariant::fromValue((int) FeedsModelFeed::DontAutoUpdate));
|
m_ui->m_cmbAutoUpdateType->addItem(tr("Do not auto-update at all"), QVariant::fromValue((int) Feed::DontAutoUpdate));
|
||||||
|
|
||||||
// Set tab order.
|
// Set tab order.
|
||||||
setTabOrder(m_ui->m_cmbParentCategory, m_ui->m_cmbType);
|
setTabOrder(m_ui->m_cmbParentCategory, m_ui->m_cmbType);
|
||||||
@ -475,13 +475,13 @@ void FormFeedDetails::initialize() {
|
|||||||
m_ui->m_txtUrl->lineEdit()->setFocus(Qt::TabFocusReason);
|
m_ui->m_txtUrl->lineEdit()->setFocus(Qt::TabFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::loadCategories(const QList<FeedsModelCategory*> categories,
|
void FormFeedDetails::loadCategories(const QList<Category*> categories,
|
||||||
FeedsModelRootItem *root_item) {
|
RootItem *root_item) {
|
||||||
m_ui->m_cmbParentCategory->addItem(root_item->icon(),
|
m_ui->m_cmbParentCategory->addItem(root_item->icon(),
|
||||||
root_item->title(),
|
root_item->title(),
|
||||||
QVariant::fromValue((void*) root_item));
|
QVariant::fromValue((void*) root_item));
|
||||||
|
|
||||||
foreach (FeedsModelCategory *category, categories) {
|
foreach (Category *category, categories) {
|
||||||
m_ui->m_cmbParentCategory->addItem(category->data(FDS_MODEL_TITLE_INDEX,
|
m_ui->m_cmbParentCategory->addItem(category->data(FDS_MODEL_TITLE_INDEX,
|
||||||
Qt::DecorationRole).value<QIcon>(),
|
Qt::DecorationRole).value<QIcon>(),
|
||||||
category->title(),
|
category->title(),
|
||||||
|
@ -28,9 +28,9 @@ namespace Ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FeedsModel;
|
class FeedsModel;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class FeedsModelRootItem;
|
class RootItem;
|
||||||
|
|
||||||
class FormFeedDetails : public QDialog {
|
class FormFeedDetails : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -42,7 +42,7 @@ class FormFeedDetails : public QDialog {
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Executes add/edit standard feed dialog.
|
// Executes add/edit standard feed dialog.
|
||||||
int exec(FeedsModelFeed *input_feed, FeedsModelRootItem *parent_to_select);
|
int exec(Feed *input_feed, RootItem *parent_to_select);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// Applies changes.
|
// Applies changes.
|
||||||
@ -72,18 +72,18 @@ class FormFeedDetails : public QDialog {
|
|||||||
void createConnections();
|
void createConnections();
|
||||||
|
|
||||||
// Sets the feed which will be edited.
|
// Sets the feed which will be edited.
|
||||||
void setEditableFeed(FeedsModelFeed *editable_feed);
|
void setEditableFeed(Feed *editable_feed);
|
||||||
|
|
||||||
// Initializes the dialog.
|
// Initializes the dialog.
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
// Loads categories into the dialog from the model.
|
// Loads categories into the dialog from the model.
|
||||||
void loadCategories(const QList<FeedsModelCategory*> categories,
|
void loadCategories(const QList<Category*> categories,
|
||||||
FeedsModelRootItem *root_item);
|
RootItem *root_item);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormFeedDetails *m_ui;
|
Ui::FormFeedDetails *m_ui;
|
||||||
FeedsModelFeed *m_editableFeed;
|
Feed *m_editableFeed;
|
||||||
FeedsModel *m_feedsModel;
|
FeedsModel *m_feedsModel;
|
||||||
|
|
||||||
QMenu *m_iconMenu;
|
QMenu *m_iconMenu;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "miscellaneous/databasecleaner.h"
|
#include "miscellaneous/databasecleaner.h"
|
||||||
#include "core/messagesproxymodel.h"
|
#include "core/messagesproxymodel.h"
|
||||||
#include "core/feeddownloader.h"
|
#include "core/feeddownloader.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsselection.h"
|
#include "core/feedsselection.h"
|
||||||
#include "core/feedsimportexportmodel.h"
|
#include "core/feedsimportexportmodel.h"
|
||||||
#include "network-web/webbrowser.h"
|
#include "network-web/webbrowser.h"
|
||||||
@ -252,7 +252,7 @@ void FeedMessageViewer::onFeedUpdatesStarted() {
|
|||||||
qApp->mainForm()->statusBar()->showProgressFeeds(0, tr("Feed update started"));
|
qApp->mainForm()->statusBar()->showProgressFeeds(0, tr("Feed update started"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedMessageViewer::onFeedUpdatesProgress(FeedsModelFeed *feed, int current, int total) {
|
void FeedMessageViewer::onFeedUpdatesProgress(Feed *feed, int current, int total) {
|
||||||
// Some feed got updated.
|
// Some feed got updated.
|
||||||
m_feedsView->updateCountsOfParticularFeed(feed, true);
|
m_feedsView->updateCountsOfParticularFeed(feed, true);
|
||||||
qApp->mainForm()->statusBar()->showProgressFeeds((current * 100.0) / total,
|
qApp->mainForm()->statusBar()->showProgressFeeds((current * 100.0) / total,
|
||||||
@ -360,7 +360,7 @@ void FeedMessageViewer::createConnections() {
|
|||||||
form_main->m_ui->m_tabWidget, SLOT(addBrowserWithMessages(QList<Message>)));
|
form_main->m_ui->m_tabWidget, SLOT(addBrowserWithMessages(QList<Message>)));
|
||||||
|
|
||||||
// Downloader connections.
|
// Downloader connections.
|
||||||
connect(m_feedsView, SIGNAL(feedsUpdateRequested(QList<FeedsModelFeed*>)), this, SLOT(updateFeeds(QList<FeedsModelFeed*>)));
|
connect(m_feedsView, SIGNAL(feedsUpdateRequested(QList<Feed*>)), this, SLOT(updateFeeds(QList<Feed*>)));
|
||||||
|
|
||||||
// Toolbar forwardings.
|
// Toolbar forwardings.
|
||||||
connect(form_main->m_ui->m_actionCleanupDatabase,
|
connect(form_main->m_ui->m_actionCleanupDatabase,
|
||||||
@ -535,7 +535,7 @@ void FeedMessageViewer::refreshVisualProperties() {
|
|||||||
m_toolBarMessages->setToolButtonStyle(button_style);
|
m_toolBarMessages->setToolButtonStyle(button_style);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedMessageViewer::updateFeeds(QList<FeedsModelFeed *> feeds) {
|
void FeedMessageViewer::updateFeeds(QList<Feed *> feeds) {
|
||||||
if (!qApp->feedUpdateLock()->tryLock()) {
|
if (!qApp->feedUpdateLock()->tryLock()) {
|
||||||
qApp->showGuiMessage(tr("Cannot update all items"),
|
qApp->showGuiMessage(tr("Cannot update all items"),
|
||||||
tr("You cannot update all items because another another critical operation is ongoing."),
|
tr("You cannot update all items because another another critical operation is ongoing."),
|
||||||
@ -548,14 +548,14 @@ void FeedMessageViewer::updateFeeds(QList<FeedsModelFeed *> feeds) {
|
|||||||
m_feedDownloaderThread = new QThread();
|
m_feedDownloaderThread = new QThread();
|
||||||
|
|
||||||
// Downloader setup.
|
// Downloader setup.
|
||||||
qRegisterMetaType<QList<FeedsModelFeed*> >("QList<FeedsModelFeed*>");
|
qRegisterMetaType<QList<Feed*> >("QList<Feed*>");
|
||||||
m_feedDownloader->moveToThread(m_feedDownloaderThread);
|
m_feedDownloader->moveToThread(m_feedDownloaderThread);
|
||||||
|
|
||||||
connect(this, SIGNAL(feedsUpdateRequested(QList<FeedsModelFeed*>)), m_feedDownloader, SLOT(updateFeeds(QList<FeedsModelFeed*>)));
|
connect(this, SIGNAL(feedsUpdateRequested(QList<Feed*>)), m_feedDownloader, SLOT(updateFeeds(QList<Feed*>)));
|
||||||
connect(m_feedDownloaderThread, SIGNAL(finished()), m_feedDownloaderThread, SLOT(deleteLater()));
|
connect(m_feedDownloaderThread, SIGNAL(finished()), m_feedDownloaderThread, SLOT(deleteLater()));
|
||||||
connect(m_feedDownloader, SIGNAL(finished(FeedDownloadResults)), this, SLOT(onFeedUpdatesFinished(FeedDownloadResults)));
|
connect(m_feedDownloader, SIGNAL(finished(FeedDownloadResults)), this, SLOT(onFeedUpdatesFinished(FeedDownloadResults)));
|
||||||
connect(m_feedDownloader, SIGNAL(started()), this, SLOT(onFeedUpdatesStarted()));
|
connect(m_feedDownloader, SIGNAL(started()), this, SLOT(onFeedUpdatesStarted()));
|
||||||
connect(m_feedDownloader, SIGNAL(progress(FeedsModelFeed*,int,int)), this, SLOT(onFeedUpdatesProgress(FeedsModelFeed*,int,int)));
|
connect(m_feedDownloader, SIGNAL(progress(Feed*,int,int)), this, SLOT(onFeedUpdatesProgress(Feed*,int,int)));
|
||||||
|
|
||||||
// Connections are made, start the feed downloader thread.
|
// Connections are made, start the feed downloader thread.
|
||||||
m_feedDownloaderThread->start();
|
m_feedDownloaderThread->start();
|
||||||
|
@ -30,7 +30,7 @@ class MessagesToolBar;
|
|||||||
class FeedsToolBar;
|
class FeedsToolBar;
|
||||||
class FeedsView;
|
class FeedsView;
|
||||||
class DatabaseCleaner;
|
class DatabaseCleaner;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
class QSplitter;
|
class QSplitter;
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
@ -103,7 +103,7 @@ class FeedMessageViewer : public TabContent {
|
|||||||
// Reloads some changeable visual settings.
|
// Reloads some changeable visual settings.
|
||||||
void refreshVisualProperties();
|
void refreshVisualProperties();
|
||||||
|
|
||||||
void updateFeeds(QList<FeedsModelFeed*> feeds);
|
void updateFeeds(QList<Feed*> feeds);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// Updates counts of messages for example in tray icon.
|
// Updates counts of messages for example in tray icon.
|
||||||
@ -111,7 +111,7 @@ class FeedMessageViewer : public TabContent {
|
|||||||
|
|
||||||
// Reacts on feed updates.
|
// Reacts on feed updates.
|
||||||
void onFeedUpdatesStarted();
|
void onFeedUpdatesStarted();
|
||||||
void onFeedUpdatesProgress(FeedsModelFeed *feed, int current, int total);
|
void onFeedUpdatesProgress(Feed *feed, int current, int total);
|
||||||
void onFeedUpdatesFinished(FeedDownloadResults results);
|
void onFeedUpdatesFinished(FeedDownloadResults results);
|
||||||
|
|
||||||
// Switches visibility of feed list and related
|
// Switches visibility of feed list and related
|
||||||
@ -135,7 +135,7 @@ class FeedMessageViewer : public TabContent {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Emitted if user/application requested updating of some feeds.
|
// Emitted if user/application requested updating of some feeds.
|
||||||
void feedsUpdateRequested(const QList<FeedsModelFeed*> feeds);
|
void feedsUpdateRequested(const QList<Feed*> feeds);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_toolBarsEnabled;
|
bool m_toolBarsEnabled;
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "core/feedsproxymodel.h"
|
#include "core/feedsproxymodel.h"
|
||||||
#include "core/feedsmodelrootitem.h"
|
#include "core/rootitem.h"
|
||||||
#include "core/feedsmodelcategory.h"
|
#include "core/category.h"
|
||||||
#include "core/feedsmodelrecyclebin.h"
|
#include "core/recyclebin.h"
|
||||||
#include "core/feedsmodelfeed.h"
|
#include "core/feed.h"
|
||||||
#include "miscellaneous/systemfactory.h"
|
#include "miscellaneous/systemfactory.h"
|
||||||
#include "miscellaneous/mutex.h"
|
#include "miscellaneous/mutex.h"
|
||||||
#include "gui/systemtrayicon.h"
|
#include "gui/systemtrayicon.h"
|
||||||
@ -103,43 +103,43 @@ void FeedsView::updateAutoUpdateStatus() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsView::selectedFeeds() const {
|
QList<Feed*> FeedsView::selectedFeeds() const {
|
||||||
QModelIndex current_index = currentIndex();
|
QModelIndex current_index = currentIndex();
|
||||||
|
|
||||||
if (current_index.isValid()) {
|
if (current_index.isValid()) {
|
||||||
return m_sourceModel->feedsForIndex(m_proxyModel->mapToSource(current_index));
|
return m_sourceModel->feedsForIndex(m_proxyModel->mapToSource(current_index));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return QList<FeedsModelFeed*>();
|
return QList<Feed*>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsView::allFeeds() const {
|
QList<Feed*> FeedsView::allFeeds() const {
|
||||||
return m_sourceModel->allFeeds();
|
return m_sourceModel->allFeeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *FeedsView::selectedItem() const {
|
RootItem *FeedsView::selectedItem() const {
|
||||||
QModelIndexList selected_rows = selectionModel()->selectedRows();
|
QModelIndexList selected_rows = selectionModel()->selectedRows();
|
||||||
|
|
||||||
if (selected_rows.isEmpty()) {
|
if (selected_rows.isEmpty()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRootItem *selected_item = m_sourceModel->itemForIndex(m_proxyModel->mapToSource(selected_rows.at(0)));
|
RootItem *selected_item = m_sourceModel->itemForIndex(m_proxyModel->mapToSource(selected_rows.at(0)));
|
||||||
return selected_item == m_sourceModel->rootItem() ? NULL : selected_item;
|
return selected_item == m_sourceModel->rootItem() ? NULL : selected_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory *FeedsView::selectedCategory() const {
|
Category *FeedsView::selectedCategory() const {
|
||||||
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
||||||
return m_sourceModel->categoryForIndex(current_mapped);
|
return m_sourceModel->categoryForIndex(current_mapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelFeed *FeedsView::selectedFeed() const {
|
Feed *FeedsView::selectedFeed() const {
|
||||||
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
||||||
return m_sourceModel->feedForIndex(current_mapped);
|
return m_sourceModel->feedForIndex(current_mapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelRecycleBin *FeedsView::selectedRecycleBin() const{
|
RecycleBin *FeedsView::selectedRecycleBin() const{
|
||||||
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
QModelIndex current_mapped = m_proxyModel->mapToSource(currentIndex());
|
||||||
return m_sourceModel->recycleBinForIndex(current_mapped);
|
return m_sourceModel->recycleBinForIndex(current_mapped);
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ void FeedsView::saveExpandedStates() {
|
|||||||
Settings *settings = qApp->settings();
|
Settings *settings = qApp->settings();
|
||||||
|
|
||||||
// Iterate all categories and save their expand statuses.
|
// Iterate all categories and save their expand statuses.
|
||||||
foreach (FeedsModelCategory *category, sourceModel()->allCategories().values()) {
|
foreach (Category *category, sourceModel()->allCategories().values()) {
|
||||||
settings->setValue(GROUP(Categories),
|
settings->setValue(GROUP(Categories),
|
||||||
QString::number(category->id()),
|
QString::number(category->id()),
|
||||||
isExpanded(model()->mapFromSource(sourceModel()->indexForItem(category))));
|
isExpanded(model()->mapFromSource(sourceModel()->indexForItem(category))));
|
||||||
@ -159,7 +159,7 @@ void FeedsView::loadExpandedStates() {
|
|||||||
Settings *settings = qApp->settings();
|
Settings *settings = qApp->settings();
|
||||||
|
|
||||||
// Iterate all categories and save their expand statuses.
|
// Iterate all categories and save their expand statuses.
|
||||||
foreach (FeedsModelCategory *category, sourceModel()->allCategories().values()) {
|
foreach (Category *category, sourceModel()->allCategories().values()) {
|
||||||
setExpanded(model()->mapFromSource(sourceModel()->indexForItem(category)),
|
setExpanded(model()->mapFromSource(sourceModel()->indexForItem(category)),
|
||||||
settings->value(GROUP(Categories), QString::number(category->id()), true).toBool());
|
settings->value(GROUP(Categories), QString::number(category->id()), true).toBool());
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ void FeedsView::executeNextAutoUpdate() {
|
|||||||
|
|
||||||
// Pass needed interval data and lets the model decide which feeds
|
// Pass needed interval data and lets the model decide which feeds
|
||||||
// should be updated in this pass.
|
// should be updated in this pass.
|
||||||
QList<FeedsModelFeed*> feeds_for_update = m_sourceModel->feedsForScheduledUpdate(m_globalAutoUpdateEnabled &&
|
QList<Feed*> feeds_for_update = m_sourceModel->feedsForScheduledUpdate(m_globalAutoUpdateEnabled &&
|
||||||
m_globalAutoUpdateRemainingInterval == 0);
|
m_globalAutoUpdateRemainingInterval == 0);
|
||||||
|
|
||||||
if (feeds_for_update.isEmpty()) {
|
if (feeds_for_update.isEmpty()) {
|
||||||
@ -266,7 +266,7 @@ void FeedsView::addNewCategory() {
|
|||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::editCategory(FeedsModelCategory *category) {
|
void FeedsView::editCategory(Category *category) {
|
||||||
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(category, NULL);
|
form_pointer.data()->exec(category, NULL);
|
||||||
@ -295,7 +295,7 @@ void FeedsView::addNewFeed() {
|
|||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::editFeed(FeedsModelFeed *feed) {
|
void FeedsView::editFeed(Feed *feed) {
|
||||||
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(feed, NULL);
|
form_pointer.data()->exec(feed, NULL);
|
||||||
@ -354,8 +354,8 @@ void FeedsView::editSelectedItem() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedsModelCategory *category;
|
Category *category;
|
||||||
FeedsModelFeed *feed;
|
Feed *feed;
|
||||||
|
|
||||||
if ((category = selectedCategory()) != NULL) {
|
if ((category = selectedCategory()) != NULL) {
|
||||||
editCategory(category);
|
editCategory(category);
|
||||||
@ -472,7 +472,7 @@ void FeedsView::restoreRecycleBin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) {
|
void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) {
|
||||||
foreach (FeedsModelFeed *feed, selectedFeeds()) {
|
foreach (Feed *feed, selectedFeeds()) {
|
||||||
feed->updateCounts(update_total_too);
|
feed->updateCounts(update_total_too);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ void FeedsView::updateCountsOfRecycleBin(bool update_total_too) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::updateCountsOfAllFeeds(bool update_total_too) {
|
void FeedsView::updateCountsOfAllFeeds(bool update_total_too) {
|
||||||
foreach (FeedsModelFeed *feed, allFeeds()) {
|
foreach (Feed *feed, allFeeds()) {
|
||||||
feed->updateCounts(update_total_too);
|
feed->updateCounts(update_total_too);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ void FeedsView::updateCountsOfAllFeeds(bool update_total_too) {
|
|||||||
notifyWithCounts();
|
notifyWithCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::updateCountsOfParticularFeed(FeedsModelFeed *feed, bool update_total_too) {
|
void FeedsView::updateCountsOfParticularFeed(Feed *feed, bool update_total_too) {
|
||||||
QModelIndex index = m_sourceModel->indexForItem(feed);
|
QModelIndex index = m_sourceModel->indexForItem(feed);
|
||||||
|
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
@ -620,7 +620,7 @@ void FeedsView::setupAppearance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) {
|
void FeedsView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) {
|
||||||
FeedsModelRootItem *selected_item = selectedItem();
|
RootItem *selected_item = selectedItem();
|
||||||
|
|
||||||
m_proxyModel->setSelectedItem(selected_item);
|
m_proxyModel->setSelectedItem(selected_item);
|
||||||
QTreeView::selectionChanged(selected, deselected);
|
QTreeView::selectionChanged(selected, deselected);
|
||||||
@ -641,9 +641,9 @@ void FeedsView::contextMenuEvent(QContextMenuEvent *event) {
|
|||||||
|
|
||||||
if (clicked_index.isValid()) {
|
if (clicked_index.isValid()) {
|
||||||
QModelIndex mapped_index = model()->mapToSource(clicked_index);
|
QModelIndex mapped_index = model()->mapToSource(clicked_index);
|
||||||
FeedsModelRootItem *clicked_item = sourceModel()->itemForIndex(mapped_index);
|
RootItem *clicked_item = sourceModel()->itemForIndex(mapped_index);
|
||||||
|
|
||||||
if (clicked_item->kind() == FeedsModelRootItem::Category || clicked_item->kind() == FeedsModelRootItem::Feed) {
|
if (clicked_item->kind() == RootItem::Cattegory || clicked_item->kind() == RootItem::Feeed) {
|
||||||
// Display context menu for categories.
|
// Display context menu for categories.
|
||||||
if (m_contextMenuCategoriesFeeds == NULL) {
|
if (m_contextMenuCategoriesFeeds == NULL) {
|
||||||
// Context menu is not initialized, initialize.
|
// Context menu is not initialized, initialize.
|
||||||
@ -652,7 +652,7 @@ void FeedsView::contextMenuEvent(QContextMenuEvent *event) {
|
|||||||
|
|
||||||
m_contextMenuCategoriesFeeds->exec(event->globalPos());
|
m_contextMenuCategoriesFeeds->exec(event->globalPos());
|
||||||
}
|
}
|
||||||
else if (clicked_item->kind() == FeedsModelRootItem::RecycleBin) {
|
else if (clicked_item->kind() == RootItem::Bin) {
|
||||||
// Display context menu for recycle bin.
|
// Display context menu for recycle bin.
|
||||||
if (m_contextMenuRecycleBin == NULL) {
|
if (m_contextMenuRecycleBin == NULL) {
|
||||||
initializeContextMenuRecycleBin();
|
initializeContextMenuRecycleBin();
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
|
|
||||||
class FeedsProxyModel;
|
class FeedsProxyModel;
|
||||||
class FeedsModelFeed;
|
class Feed;
|
||||||
class FeedsModelCategory;
|
class Category;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|
||||||
class FeedsView : public QTreeView {
|
class FeedsView : public QTreeView {
|
||||||
@ -60,15 +60,15 @@ class FeedsView : public QTreeView {
|
|||||||
|
|
||||||
// Returns list of selected/all feeds.
|
// Returns list of selected/all feeds.
|
||||||
// NOTE: This is recursive method which returns all descendants.
|
// NOTE: This is recursive method which returns all descendants.
|
||||||
QList<FeedsModelFeed*> selectedFeeds() const;
|
QList<Feed*> selectedFeeds() const;
|
||||||
QList<FeedsModelFeed*> allFeeds() const;
|
QList<Feed*> allFeeds() const;
|
||||||
|
|
||||||
// Returns pointers to selected feed/category if they are really
|
// Returns pointers to selected feed/category if they are really
|
||||||
// selected.
|
// selected.
|
||||||
FeedsModelRootItem *selectedItem() const;
|
RootItem *selectedItem() const;
|
||||||
FeedsModelCategory *selectedCategory() const;
|
Category *selectedCategory() const;
|
||||||
FeedsModelFeed *selectedFeed() const;
|
Feed *selectedFeed() const;
|
||||||
FeedsModelRecycleBin *selectedRecycleBin() const;
|
RecycleBin *selectedRecycleBin() const;
|
||||||
|
|
||||||
// Saves/loads expand states of all nodes (feeds/categories) of the list to/from settings.
|
// Saves/loads expand states of all nodes (feeds/categories) of the list to/from settings.
|
||||||
void saveExpandedStates();
|
void saveExpandedStates();
|
||||||
@ -112,11 +112,11 @@ class FeedsView : public QTreeView {
|
|||||||
|
|
||||||
// Standard category manipulators.
|
// Standard category manipulators.
|
||||||
void addNewCategory();
|
void addNewCategory();
|
||||||
void editCategory(FeedsModelCategory *category);
|
void editCategory(Category *category);
|
||||||
|
|
||||||
// Standard feed manipulators.
|
// Standard feed manipulators.
|
||||||
void addNewFeed();
|
void addNewFeed();
|
||||||
void editFeed(FeedsModelFeed *feed);
|
void editFeed(Feed *feed);
|
||||||
|
|
||||||
// Is called when counts of messages are changed externally,
|
// Is called when counts of messages are changed externally,
|
||||||
// typically from message view.
|
// typically from message view.
|
||||||
@ -132,7 +132,7 @@ class FeedsView : public QTreeView {
|
|||||||
void updateCountsOfAllFeeds(bool update_total_too);
|
void updateCountsOfAllFeeds(bool update_total_too);
|
||||||
|
|
||||||
// Reloads counts for particular feed.
|
// Reloads counts for particular feed.
|
||||||
void updateCountsOfParticularFeed(FeedsModelFeed *feed, bool update_total_too);
|
void updateCountsOfParticularFeed(Feed *feed, bool update_total_too);
|
||||||
|
|
||||||
// Notifies other components about messages
|
// Notifies other components about messages
|
||||||
// counts.
|
// counts.
|
||||||
@ -175,7 +175,7 @@ class FeedsView : public QTreeView {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Emitted if user/application requested updating of some feeds.
|
// Emitted if user/application requested updating of some feeds.
|
||||||
void feedsUpdateRequested(const QList<FeedsModelFeed*> feeds);
|
void feedsUpdateRequested(const QList<Feed*> feeds);
|
||||||
|
|
||||||
// Emitted if counts of messages are changed.
|
// Emitted if counts of messages are changed.
|
||||||
void messageCountsChanged(int unread_messages, int total_messages, bool any_feed_has_unread_messages);
|
void messageCountsChanged(int unread_messages, int total_messages, bool any_feed_has_unread_messages);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user