Mercurial > minori
annotate src/services/services.cc @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | 80f49f623d30 |
children | c130f47f6f48 |
rev | line source |
---|---|
15 | 1 #include "services/services.h" |
10 | 2 #include "core/session.h" |
63 | 3 #include "gui/dialog/settings.h" |
10 | 4 #include "services/anilist.h" |
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
44
diff
changeset
|
5 #include <QMessageBox> |
10 | 6 |
7 namespace Services { | |
8 | |
9 void Synchronize() { | |
10 switch (session.config.service) { | |
11 case Anime::Services::ANILIST: AniList::GetAnimeList(); break; | |
112
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
12 default: break; |
10 | 13 } |
14 } | |
15 | |
52
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
16 void UpdateAnimeEntry(int id) { |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
17 switch (session.config.service) { |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
18 case Anime::Services::ANILIST: AniList::UpdateAnimeEntry(id); break; |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
19 default: break; |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
20 } |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
21 } |
0c4138de2ea7
anime list: we are finally read-write
Paper <mrpapersonic@gmail.com>
parents:
47
diff
changeset
|
22 |
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
23 bool Authorize() { |
10 | 24 switch (session.config.service) { |
63 | 25 case Anime::Services::ANILIST: return AniList::AuthorizeUser(); |
26 default: return true; | |
10 | 27 } |
28 } | |
29 | |
44
619cbd6e69f9
filesystem: fix CreateDirectories function
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
30 }; // namespace Services |