Merge lp:~ken-vandine/content-hub/quiet_logging into lp:content-hub
- quiet_logging
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 139 |
Merged at revision: | 77 |
Proposed branch: | lp:~ken-vandine/content-hub/quiet_logging |
Merge into: | lp:content-hub |
Prerequisite: | lp:~michael-sheldon/content-hub/peer_picker_ui |
Diff against target: |
2281 lines (+378/-245) 32 files modified
CMakeLists.txt (+2/-0) debian/changelog (+10/-0) import/Ubuntu/Content/CMakeLists.txt (+1/-0) import/Ubuntu/Content/contenthandler.cpp (+2/-3) import/Ubuntu/Content/contenthub.cpp (+18/-12) import/Ubuntu/Content/contenthubplugin.cpp (+4/-3) import/Ubuntu/Content/contenticonprovider.cpp (+4/-5) import/Ubuntu/Content/contentitem.cpp (+8/-9) import/Ubuntu/Content/contentpeer.cpp (+16/-16) import/Ubuntu/Content/contentpeermodel.cpp (+9/-10) import/Ubuntu/Content/contentscope.cpp (+3/-4) import/Ubuntu/Content/contentstore.cpp (+8/-9) import/Ubuntu/Content/contenttransfer.cpp (+21/-22) import/Ubuntu/Content/contenttype.cpp (+3/-4) import/Ubuntu/Content/qmlimportexporthandler.cpp (+5/-6) src/com/ubuntu/content/CMakeLists.txt (+1/-0) src/com/ubuntu/content/debug.cpp (+26/-0) src/com/ubuntu/content/debug.h (+53/-0) src/com/ubuntu/content/detail/app_manager.cpp (+3/-3) src/com/ubuntu/content/detail/handler.cpp (+9/-9) src/com/ubuntu/content/detail/service.cpp (+63/-55) src/com/ubuntu/content/detail/transfer.cpp (+21/-22) src/com/ubuntu/content/hub.cpp (+17/-6) src/com/ubuntu/content/peer.cpp (+4/-4) src/com/ubuntu/content/service/CMakeLists.txt (+1/-0) src/com/ubuntu/content/service/helper.cpp (+12/-1) src/com/ubuntu/content/service/hook.cpp (+7/-7) src/com/ubuntu/content/service/main.cpp (+15/-4) src/com/ubuntu/content/service/registry.cpp (+21/-20) src/com/ubuntu/content/service/registry.h (+0/-1) src/com/ubuntu/content/transfer.cpp (+1/-1) src/com/ubuntu/content/utils.cpp (+10/-9) |
To merge this branch: | bzr merge lp:~ken-vandine/content-hub/quiet_logging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Sheldon (community) | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+211556@code.launchpad.net |
Commit message
Make debugging output optional based on CONTENT_
Description of the change
Make debugging output optional based on CONTENT_
PS Jenkins bot (ps-jenkins) wrote : | # |
Ken VanDine (ken-vandine) wrote : | # |
Are there any related MPs required for this MP to build/function as expected?
* No (besides the prerequisite branch included)
Is your branch in sync with latest trunk
* Yes
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
* Yes
Did you successfully run all tests found in your component's Test Plan (https:/
* Yes
If you changed the UI, was the change specified/approved by design?
* No UI changes
If you changed the packaging (debian), did you subscribe a core-dev to this MP?
* No packaging changes
- 139. By Ken VanDine
-
merged trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:139
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Sheldon (michael-sheldon) wrote : | # |
Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
* Yes, based on https:/
Did CI run pass? If not, please explain why.
* Yes
Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
* Yes
- 140. By Ken VanDine
-
merged peer_picker_ui
- 141. By Ken VanDine
-
merged fix_pending_check
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-03-21 00:29:33 +0000 | |||
3 | +++ CMakeLists.txt 2014-03-21 00:29:34 +0000 | |||
4 | @@ -67,6 +67,8 @@ | |||
5 | 67 | pkg_check_modules(NIH_DBUS REQUIRED libnih-dbus) | 67 | pkg_check_modules(NIH_DBUS REQUIRED libnih-dbus) |
6 | 68 | pkg_check_modules(DBUS REQUIRED dbus-1) | 68 | pkg_check_modules(DBUS REQUIRED dbus-1) |
7 | 69 | 69 | ||
8 | 70 | add_definitions( -DDEBUG_ENABLED ) | ||
9 | 71 | |||
10 | 70 | set(CONTENT_HUB_VERSION_MAJOR 0) | 72 | set(CONTENT_HUB_VERSION_MAJOR 0) |
11 | 71 | set(CONTENT_HUB_VERSION_MINOR 0) | 73 | set(CONTENT_HUB_VERSION_MINOR 0) |
12 | 72 | set(CONTENT_HUB_VERSION_PATCH 1) | 74 | set(CONTENT_HUB_VERSION_PATCH 1) |
13 | 73 | 75 | ||
14 | === modified file 'debian/changelog' | |||
15 | --- debian/changelog 2014-03-07 06:59:44 +0000 | |||
16 | +++ debian/changelog 2014-03-21 00:29:34 +0000 | |||
17 | @@ -16,6 +16,16 @@ | |||
18 | 16 | 16 | ||
19 | 17 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 06 Mar 2014 16:50:24 +0000 | 17 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 06 Mar 2014 16:50:24 +0000 |
20 | 18 | 18 | ||
21 | 19 | content-hub (0.0+14.04.20140304-0preview1) trusty; urgency=medium | ||
22 | 20 | |||
23 | 21 | * Support for more handler types, including sharing | ||
24 | 22 | * Marshal peer details like name and icon from the service, so confined apps | ||
25 | 23 | can show them. | ||
26 | 24 | * Improved QML bindings | ||
27 | 25 | * New ContentPeerPicker QML component | ||
28 | 26 | |||
29 | 27 | -- Ken VanDine <ken.vandine@canonical.com> Mon, 27 Jan 2014 14:09:38 -0500 | ||
30 | 28 | |||
31 | 19 | content-hub (0.0+14.04.20131209.1-0ubuntu1) trusty; urgency=low | 29 | content-hub (0.0+14.04.20131209.1-0ubuntu1) trusty; urgency=low |
32 | 20 | 30 | ||
33 | 21 | [ Ken VanDine ] | 31 | [ Ken VanDine ] |
34 | 22 | 32 | ||
35 | === modified file 'import/Ubuntu/Content/CMakeLists.txt' | |||
36 | --- import/Ubuntu/Content/CMakeLists.txt 2014-03-21 00:29:33 +0000 | |||
37 | +++ import/Ubuntu/Content/CMakeLists.txt 2014-03-21 00:29:34 +0000 | |||
38 | @@ -63,6 +63,7 @@ | |||
39 | 63 | contenttransfer.cpp | 63 | contenttransfer.cpp |
40 | 64 | contenttype.cpp | 64 | contenttype.cpp |
41 | 65 | qmlimportexporthandler.cpp | 65 | qmlimportexporthandler.cpp |
42 | 66 | ../../../src/com/ubuntu/content/debug.cpp | ||
43 | 66 | ) | 67 | ) |
44 | 67 | 68 | ||
45 | 68 | add_library(${PLUGIN} MODULE ${PLUGIN_SRC} ${PLUGIN_HDRS}) | 69 | add_library(${PLUGIN} MODULE ${PLUGIN_SRC} ${PLUGIN_HDRS}) |
46 | 69 | 70 | ||
47 | === modified file 'import/Ubuntu/Content/contenthandler.cpp' | |||
48 | --- import/Ubuntu/Content/contenthandler.cpp 2014-03-21 00:29:33 +0000 | |||
49 | +++ import/Ubuntu/Content/contenthandler.cpp 2014-03-21 00:29:34 +0000 | |||
50 | @@ -14,10 +14,9 @@ | |||
51 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
52 | 15 | */ | 15 | */ |
53 | 16 | 16 | ||
54 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
55 | 17 | #include "contenthandler.h" | 18 | #include "contenthandler.h" |
56 | 18 | 19 | ||
57 | 19 | #include <QDebug> | ||
58 | 20 | |||
59 | 21 | /*! | 20 | /*! |
60 | 22 | \qmltype ContentHandler | 21 | \qmltype ContentHandler |
61 | 23 | \instantiates ContentHandler | 22 | \instantiates ContentHandler |
62 | @@ -41,5 +40,5 @@ | |||
63 | 41 | ContentHandler::ContentHandler(QObject *parent) | 40 | ContentHandler::ContentHandler(QObject *parent) |
64 | 42 | : QObject(parent) | 41 | : QObject(parent) |
65 | 43 | { | 42 | { |
67 | 44 | qDebug() << Q_FUNC_INFO; | 43 | TRACE() << Q_FUNC_INFO; |
68 | 45 | } | 44 | } |
69 | 46 | 45 | ||
70 | === modified file 'import/Ubuntu/Content/contenthub.cpp' | |||
71 | --- import/Ubuntu/Content/contenthub.cpp 2014-03-21 00:29:33 +0000 | |||
72 | +++ import/Ubuntu/Content/contenthub.cpp 2014-03-21 00:29:34 +0000 | |||
73 | @@ -14,6 +14,7 @@ | |||
74 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
75 | 15 | */ | 15 | */ |
76 | 16 | 16 | ||
77 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
78 | 17 | #include "contenthub.h" | 18 | #include "contenthub.h" |
79 | 18 | #include "contentpeer.h" | 19 | #include "contentpeer.h" |
80 | 19 | #include "contentstore.h" | 20 | #include "contentstore.h" |
81 | @@ -26,7 +27,6 @@ | |||
82 | 26 | #include <com/ubuntu/content/type.h> | 27 | #include <com/ubuntu/content/type.h> |
83 | 27 | 28 | ||
84 | 28 | #include <QStringList> | 29 | #include <QStringList> |
85 | 29 | #include <QDebug> | ||
86 | 30 | 30 | ||
87 | 31 | /*! | 31 | /*! |
88 | 32 | * \qmltype ContentHub | 32 | * \qmltype ContentHub |
89 | @@ -117,7 +117,7 @@ | |||
90 | 117 | : QObject(parent), | 117 | : QObject(parent), |
91 | 118 | m_hub(0) | 118 | m_hub(0) |
92 | 119 | { | 119 | { |
94 | 120 | qDebug() << Q_FUNC_INFO; | 120 | TRACE() << Q_FUNC_INFO; |
95 | 121 | m_hub = cuc::Hub::Client::instance(); | 121 | m_hub = cuc::Hub::Client::instance(); |
96 | 122 | m_handler = new QmlImportExportHandler(this); | 122 | m_handler = new QmlImportExportHandler(this); |
97 | 123 | m_hub->register_import_export_handler(m_handler); | 123 | m_hub->register_import_export_handler(m_handler); |
98 | @@ -132,7 +132,7 @@ | |||
99 | 132 | 132 | ||
100 | 133 | ContentHub *ContentHub::instance() | 133 | ContentHub *ContentHub::instance() |
101 | 134 | { | 134 | { |
103 | 135 | qDebug() << Q_FUNC_INFO; | 135 | TRACE() << Q_FUNC_INFO; |
104 | 136 | static ContentHub *contentHub = new ContentHub(nullptr); | 136 | static ContentHub *contentHub = new ContentHub(nullptr); |
105 | 137 | return contentHub; | 137 | return contentHub; |
106 | 138 | } | 138 | } |
107 | @@ -145,7 +145,7 @@ | |||
108 | 145 | */ | 145 | */ |
109 | 146 | ContentTransfer* ContentHub::importContent(cuc::Peer peer) | 146 | ContentTransfer* ContentHub::importContent(cuc::Peer peer) |
110 | 147 | { | 147 | { |
112 | 148 | qDebug() << Q_FUNC_INFO; | 148 | TRACE() << Q_FUNC_INFO; |
113 | 149 | 149 | ||
114 | 150 | cuc::Transfer *hubTransfer = m_hub->create_import_from_peer(peer); | 150 | cuc::Transfer *hubTransfer = m_hub->create_import_from_peer(peer); |
115 | 151 | ContentTransfer *qmlTransfer = new ContentTransfer(this); | 151 | ContentTransfer *qmlTransfer = new ContentTransfer(this); |
116 | @@ -162,7 +162,7 @@ | |||
117 | 162 | */ | 162 | */ |
118 | 163 | ContentTransfer* ContentHub::exportContent(cuc::Peer peer) | 163 | ContentTransfer* ContentHub::exportContent(cuc::Peer peer) |
119 | 164 | { | 164 | { |
121 | 165 | qDebug() << Q_FUNC_INFO; | 165 | TRACE() << Q_FUNC_INFO; |
122 | 166 | 166 | ||
123 | 167 | cuc::Transfer *hubTransfer = m_hub->create_export_to_peer(peer); | 167 | cuc::Transfer *hubTransfer = m_hub->create_export_to_peer(peer); |
124 | 168 | ContentTransfer *qmlTransfer = new ContentTransfer(this); | 168 | ContentTransfer *qmlTransfer = new ContentTransfer(this); |
125 | @@ -179,7 +179,7 @@ | |||
126 | 179 | */ | 179 | */ |
127 | 180 | ContentTransfer* ContentHub::shareContent(cuc::Peer peer) | 180 | ContentTransfer* ContentHub::shareContent(cuc::Peer peer) |
128 | 181 | { | 181 | { |
130 | 182 | qDebug() << Q_FUNC_INFO; | 182 | TRACE() << Q_FUNC_INFO; |
131 | 183 | 183 | ||
132 | 184 | cuc::Transfer *hubTransfer = m_hub->create_share_to_peer(peer); | 184 | cuc::Transfer *hubTransfer = m_hub->create_share_to_peer(peer); |
133 | 185 | ContentTransfer *qmlTransfer = new ContentTransfer(this); | 185 | ContentTransfer *qmlTransfer = new ContentTransfer(this); |
134 | @@ -194,7 +194,7 @@ | |||
135 | 194 | */ | 194 | */ |
136 | 195 | void ContentHub::restoreImports() | 195 | void ContentHub::restoreImports() |
137 | 196 | { | 196 | { |
139 | 197 | qDebug() << Q_FUNC_INFO; | 197 | TRACE() << Q_FUNC_INFO; |
140 | 198 | } | 198 | } |
141 | 199 | 199 | ||
142 | 200 | /*! | 200 | /*! |
143 | @@ -203,7 +203,7 @@ | |||
144 | 203 | */ | 203 | */ |
145 | 204 | QQmlListProperty<ContentTransfer> ContentHub::finishedImports() | 204 | QQmlListProperty<ContentTransfer> ContentHub::finishedImports() |
146 | 205 | { | 205 | { |
148 | 206 | qDebug() << Q_FUNC_INFO; | 206 | TRACE() << Q_FUNC_INFO; |
149 | 207 | return QQmlListProperty<ContentTransfer>(this, m_finishedImports); | 207 | return QQmlListProperty<ContentTransfer>(this, m_finishedImports); |
150 | 208 | } | 208 | } |
151 | 209 | 209 | ||
152 | @@ -213,7 +213,7 @@ | |||
153 | 213 | */ | 213 | */ |
154 | 214 | void ContentHub::handleImport(com::ubuntu::content::Transfer *transfer) | 214 | void ContentHub::handleImport(com::ubuntu::content::Transfer *transfer) |
155 | 215 | { | 215 | { |
157 | 216 | qDebug() << Q_FUNC_INFO; | 216 | TRACE() << Q_FUNC_INFO; |
158 | 217 | ContentTransfer *qmlTransfer = nullptr; | 217 | ContentTransfer *qmlTransfer = nullptr; |
159 | 218 | if (m_activeImports.contains(transfer)) { | 218 | if (m_activeImports.contains(transfer)) { |
160 | 219 | qmlTransfer = m_activeImports.take(transfer); | 219 | qmlTransfer = m_activeImports.take(transfer); |
161 | @@ -229,6 +229,12 @@ | |||
162 | 229 | Q_EMIT importRequested(qmlTransfer); | 229 | Q_EMIT importRequested(qmlTransfer); |
163 | 230 | } | 230 | } |
164 | 231 | 231 | ||
165 | 232 | |||
166 | 233 | |||
167 | 234 | // FIXME: maybe we need to emit something else here | ||
168 | 235 | // if (qmlTransfer->state() == ContentTransfer::Charged) | ||
169 | 236 | // Q_EMIT importRequested(qmlTransfer); | ||
170 | 237 | |||
171 | 232 | m_finishedImports.append(qmlTransfer); | 238 | m_finishedImports.append(qmlTransfer); |
172 | 233 | Q_EMIT finishedImportsChanged(); | 239 | Q_EMIT finishedImportsChanged(); |
173 | 234 | } | 240 | } |
174 | @@ -239,7 +245,7 @@ | |||
175 | 239 | */ | 245 | */ |
176 | 240 | void ContentHub::handleExport(com::ubuntu::content::Transfer *transfer) | 246 | void ContentHub::handleExport(com::ubuntu::content::Transfer *transfer) |
177 | 241 | { | 247 | { |
179 | 242 | qDebug() << Q_FUNC_INFO; | 248 | TRACE() << Q_FUNC_INFO; |
180 | 243 | ContentTransfer *qmlTransfer = nullptr; | 249 | ContentTransfer *qmlTransfer = nullptr; |
181 | 244 | if (m_activeImports.contains(transfer)) | 250 | if (m_activeImports.contains(transfer)) |
182 | 245 | qmlTransfer = m_activeImports.take(transfer); | 251 | qmlTransfer = m_activeImports.take(transfer); |
183 | @@ -264,7 +270,7 @@ | |||
184 | 264 | */ | 270 | */ |
185 | 265 | void ContentHub::handleShare(com::ubuntu::content::Transfer *transfer) | 271 | void ContentHub::handleShare(com::ubuntu::content::Transfer *transfer) |
186 | 266 | { | 272 | { |
188 | 267 | qDebug() << Q_FUNC_INFO; | 273 | TRACE() << Q_FUNC_INFO; |
189 | 268 | ContentTransfer *qmlTransfer = nullptr; | 274 | ContentTransfer *qmlTransfer = nullptr; |
190 | 269 | if (m_activeImports.contains(transfer)) | 275 | if (m_activeImports.contains(transfer)) |
191 | 270 | { | 276 | { |
192 | @@ -287,7 +293,7 @@ | |||
193 | 287 | 293 | ||
194 | 288 | void ContentHub::updateState() | 294 | void ContentHub::updateState() |
195 | 289 | { | 295 | { |
197 | 290 | qDebug() << Q_FUNC_INFO; | 296 | TRACE() << Q_FUNC_INFO; |
198 | 291 | } | 297 | } |
199 | 292 | 298 | ||
200 | 293 | /*! | 299 | /*! |
201 | 294 | 300 | ||
202 | === modified file 'import/Ubuntu/Content/contenthubplugin.cpp' | |||
203 | --- import/Ubuntu/Content/contenthubplugin.cpp 2014-03-21 00:29:33 +0000 | |||
204 | +++ import/Ubuntu/Content/contenthubplugin.cpp 2014-03-21 00:29:34 +0000 | |||
205 | @@ -15,6 +15,7 @@ | |||
206 | 15 | */ | 15 | */ |
207 | 16 | 16 | ||
208 | 17 | #include "contenthubplugin.h" | 17 | #include "contenthubplugin.h" |
209 | 18 | #include "../../../src/com/ubuntu/content/debug.h" | ||
210 | 18 | 19 | ||
211 | 19 | #include "contenthandler.h" | 20 | #include "contenthandler.h" |
212 | 20 | #include "contenthub.h" | 21 | #include "contenthub.h" |
213 | @@ -40,7 +41,7 @@ | |||
214 | 40 | { | 41 | { |
215 | 41 | Q_UNUSED(engine) | 42 | Q_UNUSED(engine) |
216 | 42 | Q_UNUSED(scriptEngine) | 43 | Q_UNUSED(scriptEngine) |
218 | 43 | qDebug() << Q_FUNC_INFO; | 44 | TRACE() << Q_FUNC_INFO; |
219 | 44 | return ContentHub::instance(); | 45 | return ContentHub::instance(); |
220 | 45 | } | 46 | } |
221 | 46 | 47 | ||
222 | @@ -50,7 +51,7 @@ | |||
223 | 50 | void ContentHubPlugin::initializeEngine(QQmlEngine * engine, const char * uri) | 51 | void ContentHubPlugin::initializeEngine(QQmlEngine * engine, const char * uri) |
224 | 51 | { | 52 | { |
225 | 52 | Q_UNUSED(uri) | 53 | Q_UNUSED(uri) |
227 | 53 | qDebug() << Q_FUNC_INFO; | 54 | TRACE() << Q_FUNC_INFO; |
228 | 54 | QIcon::setThemeName("ubuntu-mobile"); | 55 | QIcon::setThemeName("ubuntu-mobile"); |
229 | 55 | QIcon::setThemeSearchPaths(QStringList() << ("/usr/share/icons/")); | 56 | QIcon::setThemeSearchPaths(QStringList() << ("/usr/share/icons/")); |
230 | 56 | ContentIconProvider *iconProvider = ContentIconProvider::instance(); | 57 | ContentIconProvider *iconProvider = ContentIconProvider::instance(); |
231 | @@ -62,7 +63,7 @@ | |||
232 | 62 | */ | 63 | */ |
233 | 63 | void ContentHubPlugin::registerTypes(const char *uri) | 64 | void ContentHubPlugin::registerTypes(const char *uri) |
234 | 64 | { | 65 | { |
236 | 65 | qDebug() << Q_FUNC_INFO; | 66 | TRACE() << Q_FUNC_INFO; |
237 | 66 | Q_ASSERT(uri == QLatin1String("Ubuntu.Content")); | 67 | Q_ASSERT(uri == QLatin1String("Ubuntu.Content")); |
238 | 67 | 68 | ||
239 | 68 | const int versionMajor = 0; | 69 | const int versionMajor = 0; |
240 | 69 | 70 | ||
241 | === modified file 'import/Ubuntu/Content/contenticonprovider.cpp' | |||
242 | --- import/Ubuntu/Content/contenticonprovider.cpp 2014-03-21 00:29:33 +0000 | |||
243 | +++ import/Ubuntu/Content/contenticonprovider.cpp 2014-03-21 00:29:34 +0000 | |||
244 | @@ -14,14 +14,13 @@ | |||
245 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
246 | 15 | */ | 15 | */ |
247 | 16 | 16 | ||
248 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
249 | 17 | #include "contenticonprovider.h" | 18 | #include "contenticonprovider.h" |
250 | 18 | 19 | ||
251 | 19 | #include <QDebug> | ||
252 | 20 | |||
253 | 21 | ContentIconProvider::ContentIconProvider() | 20 | ContentIconProvider::ContentIconProvider() |
254 | 22 | : QQuickImageProvider(QQuickImageProvider::Image) | 21 | : QQuickImageProvider(QQuickImageProvider::Image) |
255 | 23 | { | 22 | { |
257 | 24 | qDebug() << Q_FUNC_INFO; | 23 | TRACE() << Q_FUNC_INFO; |
258 | 25 | 24 | ||
259 | 26 | appIdImageMap = new QMap<QString, QImage>(); | 25 | appIdImageMap = new QMap<QString, QImage>(); |
260 | 27 | } | 26 | } |
261 | @@ -39,7 +38,7 @@ | |||
262 | 39 | */ | 38 | */ |
263 | 40 | void ContentIconProvider::addImage(QString appId, QImage image) | 39 | void ContentIconProvider::addImage(QString appId, QImage image) |
264 | 41 | { | 40 | { |
266 | 42 | qDebug() << Q_FUNC_INFO; | 41 | TRACE() << Q_FUNC_INFO; |
267 | 43 | appIdImageMap->insert(appId, image); | 42 | appIdImageMap->insert(appId, image); |
268 | 44 | } | 43 | } |
269 | 45 | 44 | ||
270 | @@ -51,7 +50,7 @@ | |||
271 | 51 | QImage ContentIconProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) | 50 | QImage ContentIconProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) |
272 | 52 | { | 51 | { |
273 | 53 | Q_UNUSED(requestedSize) | 52 | Q_UNUSED(requestedSize) |
275 | 54 | qDebug() << Q_FUNC_INFO; | 53 | TRACE() << Q_FUNC_INFO; |
276 | 55 | 54 | ||
277 | 56 | QImage image = appIdImageMap->value(id); | 55 | QImage image = appIdImageMap->value(id); |
278 | 57 | if(size) { | 56 | if(size) { |
279 | 58 | 57 | ||
280 | === modified file 'import/Ubuntu/Content/contentitem.cpp' | |||
281 | --- import/Ubuntu/Content/contentitem.cpp 2013-11-07 20:12:56 +0000 | |||
282 | +++ import/Ubuntu/Content/contentitem.cpp 2014-03-21 00:29:34 +0000 | |||
283 | @@ -15,8 +15,7 @@ | |||
284 | 15 | */ | 15 | */ |
285 | 16 | 16 | ||
286 | 17 | #include "contentitem.h" | 17 | #include "contentitem.h" |
289 | 18 | 18 | #include "../../../src/com/ubuntu/content/debug.h" | |
288 | 19 | #include <QDebug> | ||
290 | 20 | 19 | ||
291 | 21 | /*! | 20 | /*! |
292 | 22 | * \qmltype ContentItem | 21 | * \qmltype ContentItem |
293 | @@ -34,7 +33,7 @@ | |||
294 | 34 | ContentItem::ContentItem(QObject *parent) | 33 | ContentItem::ContentItem(QObject *parent) |
295 | 35 | : QObject(parent) | 34 | : QObject(parent) |
296 | 36 | { | 35 | { |
298 | 37 | qDebug() << Q_FUNC_INFO; | 36 | TRACE() << Q_FUNC_INFO; |
299 | 38 | } | 37 | } |
300 | 39 | 38 | ||
301 | 40 | /*! | 39 | /*! |
302 | @@ -43,13 +42,13 @@ | |||
303 | 43 | */ | 42 | */ |
304 | 44 | const QString &ContentItem::name() const | 43 | const QString &ContentItem::name() const |
305 | 45 | { | 44 | { |
307 | 46 | qDebug() << Q_FUNC_INFO; | 45 | TRACE() << Q_FUNC_INFO; |
308 | 47 | return m_name; | 46 | return m_name; |
309 | 48 | } | 47 | } |
310 | 49 | 48 | ||
311 | 50 | void ContentItem::setName(const QString &name) | 49 | void ContentItem::setName(const QString &name) |
312 | 51 | { | 50 | { |
314 | 52 | qDebug() << Q_FUNC_INFO; | 51 | TRACE() << Q_FUNC_INFO; |
315 | 53 | if (name == m_name) | 52 | if (name == m_name) |
316 | 54 | return; | 53 | return; |
317 | 55 | 54 | ||
318 | @@ -64,13 +63,13 @@ | |||
319 | 64 | */ | 63 | */ |
320 | 65 | const QUrl &ContentItem::url() const | 64 | const QUrl &ContentItem::url() const |
321 | 66 | { | 65 | { |
323 | 67 | qDebug() << Q_FUNC_INFO; | 66 | TRACE() << Q_FUNC_INFO; |
324 | 68 | return m_item.url(); | 67 | return m_item.url(); |
325 | 69 | } | 68 | } |
326 | 70 | 69 | ||
327 | 71 | void ContentItem::setUrl(const QUrl &url) | 70 | void ContentItem::setUrl(const QUrl &url) |
328 | 72 | { | 71 | { |
330 | 73 | qDebug() << Q_FUNC_INFO; | 72 | TRACE() << Q_FUNC_INFO; |
331 | 74 | if (url == this->url()) | 73 | if (url == this->url()) |
332 | 75 | return; | 74 | return; |
333 | 76 | 75 | ||
334 | @@ -84,7 +83,7 @@ | |||
335 | 84 | */ | 83 | */ |
336 | 85 | const com::ubuntu::content::Item &ContentItem::item() const | 84 | const com::ubuntu::content::Item &ContentItem::item() const |
337 | 86 | { | 85 | { |
339 | 87 | qDebug() << Q_FUNC_INFO; | 86 | TRACE() << Q_FUNC_INFO; |
340 | 88 | return m_item; | 87 | return m_item; |
341 | 89 | } | 88 | } |
342 | 90 | 89 | ||
343 | @@ -94,7 +93,7 @@ | |||
344 | 94 | */ | 93 | */ |
345 | 95 | void ContentItem::setItem(const com::ubuntu::content::Item &item) | 94 | void ContentItem::setItem(const com::ubuntu::content::Item &item) |
346 | 96 | { | 95 | { |
348 | 97 | qDebug() << Q_FUNC_INFO; | 96 | TRACE() << Q_FUNC_INFO; |
349 | 98 | if (item == m_item) | 97 | if (item == m_item) |
350 | 99 | return; | 98 | return; |
351 | 100 | 99 | ||
352 | 101 | 100 | ||
353 | === modified file 'import/Ubuntu/Content/contentpeer.cpp' | |||
354 | --- import/Ubuntu/Content/contentpeer.cpp 2014-03-21 00:29:33 +0000 | |||
355 | +++ import/Ubuntu/Content/contentpeer.cpp 2014-03-21 00:29:34 +0000 | |||
356 | @@ -14,6 +14,7 @@ | |||
357 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
358 | 15 | */ | 15 | */ |
359 | 16 | 16 | ||
360 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
361 | 17 | #include "contenthandler.h" | 18 | #include "contenthandler.h" |
362 | 18 | #include "contenthub.h" | 19 | #include "contenthub.h" |
363 | 19 | #include "contenticonprovider.h" | 20 | #include "contenticonprovider.h" |
364 | @@ -21,7 +22,6 @@ | |||
365 | 21 | #include "contenttype.h" | 22 | #include "contenttype.h" |
366 | 22 | 23 | ||
367 | 23 | #include <com/ubuntu/content/peer.h> | 24 | #include <com/ubuntu/content/peer.h> |
368 | 24 | #include <QDebug> | ||
369 | 25 | #include <QIcon> | 25 | #include <QIcon> |
370 | 26 | 26 | ||
371 | 27 | /*! | 27 | /*! |
372 | @@ -46,7 +46,7 @@ | |||
373 | 46 | m_selectionType(ContentTransfer::Single), | 46 | m_selectionType(ContentTransfer::Single), |
374 | 47 | m_explicit_peer(false) | 47 | m_explicit_peer(false) |
375 | 48 | { | 48 | { |
377 | 49 | qDebug() << Q_FUNC_INFO; | 49 | TRACE() << Q_FUNC_INFO; |
378 | 50 | 50 | ||
379 | 51 | m_hub = cuc::Hub::Client::instance(); | 51 | m_hub = cuc::Hub::Client::instance(); |
380 | 52 | } | 52 | } |
381 | @@ -58,7 +58,7 @@ | |||
382 | 58 | */ | 58 | */ |
383 | 59 | QString ContentPeer::name() | 59 | QString ContentPeer::name() |
384 | 60 | { | 60 | { |
386 | 61 | qDebug() << Q_FUNC_INFO; | 61 | TRACE() << Q_FUNC_INFO; |
387 | 62 | return m_peer.name(); | 62 | return m_peer.name(); |
388 | 63 | } | 63 | } |
389 | 64 | 64 | ||
390 | @@ -68,7 +68,7 @@ | |||
391 | 68 | */ | 68 | */ |
392 | 69 | const QString &ContentPeer::appId() const | 69 | const QString &ContentPeer::appId() const |
393 | 70 | { | 70 | { |
395 | 71 | qDebug() << Q_FUNC_INFO; | 71 | TRACE() << Q_FUNC_INFO; |
396 | 72 | return m_peer.id(); | 72 | return m_peer.id(); |
397 | 73 | } | 73 | } |
398 | 74 | 74 | ||
399 | @@ -79,13 +79,13 @@ | |||
400 | 79 | */ | 79 | */ |
401 | 80 | void ContentPeer::setAppId(const QString& appId) | 80 | void ContentPeer::setAppId(const QString& appId) |
402 | 81 | { | 81 | { |
404 | 82 | qDebug() << Q_FUNC_INFO << appId; | 82 | TRACE() << Q_FUNC_INFO << appId; |
405 | 83 | this->setPeer(cuc::Peer{appId}); | 83 | this->setPeer(cuc::Peer{appId}); |
406 | 84 | } | 84 | } |
407 | 85 | 85 | ||
408 | 86 | QImage &ContentPeer::icon() | 86 | QImage &ContentPeer::icon() |
409 | 87 | { | 87 | { |
411 | 88 | qDebug() << Q_FUNC_INFO; | 88 | TRACE() << Q_FUNC_INFO; |
412 | 89 | return m_icon; | 89 | return m_icon; |
413 | 90 | } | 90 | } |
414 | 91 | 91 | ||
415 | @@ -104,7 +104,7 @@ | |||
416 | 104 | */ | 104 | */ |
417 | 105 | void ContentPeer::setPeer(const cuc::Peer &peer, bool explicitPeer) | 105 | void ContentPeer::setPeer(const cuc::Peer &peer, bool explicitPeer) |
418 | 106 | { | 106 | { |
420 | 107 | qDebug() << Q_FUNC_INFO; | 107 | TRACE() << Q_FUNC_INFO; |
421 | 108 | m_peer = peer; | 108 | m_peer = peer; |
422 | 109 | m_explicit_peer = explicitPeer; | 109 | m_explicit_peer = explicitPeer; |
423 | 110 | if (peer.iconData().isEmpty()) | 110 | if (peer.iconData().isEmpty()) |
424 | @@ -126,7 +126,7 @@ | |||
425 | 126 | */ | 126 | */ |
426 | 127 | ContentHandler::Handler ContentPeer::handler() | 127 | ContentHandler::Handler ContentPeer::handler() |
427 | 128 | { | 128 | { |
429 | 129 | qDebug() << Q_FUNC_INFO; | 129 | TRACE() << Q_FUNC_INFO; |
430 | 130 | return m_handler; | 130 | return m_handler; |
431 | 131 | } | 131 | } |
432 | 132 | 132 | ||
433 | @@ -136,7 +136,7 @@ | |||
434 | 136 | */ | 136 | */ |
435 | 137 | void ContentPeer::setHandler(ContentHandler::Handler handler) | 137 | void ContentPeer::setHandler(ContentHandler::Handler handler) |
436 | 138 | { | 138 | { |
438 | 139 | qDebug() << Q_FUNC_INFO; | 139 | TRACE() << Q_FUNC_INFO; |
439 | 140 | m_handler = handler; | 140 | m_handler = handler; |
440 | 141 | 141 | ||
441 | 142 | Q_EMIT handlerChanged(); | 142 | Q_EMIT handlerChanged(); |
442 | @@ -148,7 +148,7 @@ | |||
443 | 148 | */ | 148 | */ |
444 | 149 | ContentType::Type ContentPeer::contentType() | 149 | ContentType::Type ContentPeer::contentType() |
445 | 150 | { | 150 | { |
447 | 151 | qDebug() << Q_FUNC_INFO; | 151 | TRACE() << Q_FUNC_INFO; |
448 | 152 | return m_contentType; | 152 | return m_contentType; |
449 | 153 | } | 153 | } |
450 | 154 | 154 | ||
451 | @@ -158,7 +158,7 @@ | |||
452 | 158 | */ | 158 | */ |
453 | 159 | void ContentPeer::setContentType(ContentType::Type contentType) | 159 | void ContentPeer::setContentType(ContentType::Type contentType) |
454 | 160 | { | 160 | { |
456 | 161 | qDebug() << Q_FUNC_INFO; | 161 | TRACE() << Q_FUNC_INFO; |
457 | 162 | m_contentType = contentType; | 162 | m_contentType = contentType; |
458 | 163 | 163 | ||
459 | 164 | if(!m_explicit_peer) { | 164 | if(!m_explicit_peer) { |
460 | @@ -175,7 +175,7 @@ | |||
461 | 175 | */ | 175 | */ |
462 | 176 | ContentTransfer::SelectionType ContentPeer::selectionType() | 176 | ContentTransfer::SelectionType ContentPeer::selectionType() |
463 | 177 | { | 177 | { |
465 | 178 | qDebug() << Q_FUNC_INFO; | 178 | TRACE() << Q_FUNC_INFO; |
466 | 179 | return m_selectionType; | 179 | return m_selectionType; |
467 | 180 | } | 180 | } |
468 | 181 | 181 | ||
469 | @@ -185,7 +185,7 @@ | |||
470 | 185 | */ | 185 | */ |
471 | 186 | void ContentPeer::setSelectionType(ContentTransfer::SelectionType selectionType) | 186 | void ContentPeer::setSelectionType(ContentTransfer::SelectionType selectionType) |
472 | 187 | { | 187 | { |
474 | 188 | qDebug() << Q_FUNC_INFO; | 188 | TRACE() << Q_FUNC_INFO; |
475 | 189 | m_selectionType = selectionType; | 189 | m_selectionType = selectionType; |
476 | 190 | 190 | ||
477 | 191 | Q_EMIT selectionTypeChanged(); | 191 | Q_EMIT selectionTypeChanged(); |
478 | @@ -197,7 +197,7 @@ | |||
479 | 197 | */ | 197 | */ |
480 | 198 | bool ContentPeer::isDefaultPeer() | 198 | bool ContentPeer::isDefaultPeer() |
481 | 199 | { | 199 | { |
483 | 200 | qDebug() << Q_FUNC_INFO; | 200 | TRACE() << Q_FUNC_INFO; |
484 | 201 | return m_peer.isDefaultPeer(); | 201 | return m_peer.isDefaultPeer(); |
485 | 202 | } | 202 | } |
486 | 203 | 203 | ||
487 | @@ -208,7 +208,7 @@ | |||
488 | 208 | */ | 208 | */ |
489 | 209 | ContentTransfer *ContentPeer::request() | 209 | ContentTransfer *ContentPeer::request() |
490 | 210 | { | 210 | { |
492 | 211 | qDebug() << Q_FUNC_INFO; | 211 | TRACE() << Q_FUNC_INFO; |
493 | 212 | return request(nullptr); | 212 | return request(nullptr); |
494 | 213 | } | 213 | } |
495 | 214 | 214 | ||
496 | @@ -220,7 +220,7 @@ | |||
497 | 220 | */ | 220 | */ |
498 | 221 | ContentTransfer *ContentPeer::request(ContentStore *store) | 221 | ContentTransfer *ContentPeer::request(ContentStore *store) |
499 | 222 | { | 222 | { |
501 | 223 | qDebug() << Q_FUNC_INFO; | 223 | TRACE() << Q_FUNC_INFO; |
502 | 224 | 224 | ||
503 | 225 | ContentHub *contentHub = ContentHub::instance(); | 225 | ContentHub *contentHub = ContentHub::instance(); |
504 | 226 | ContentTransfer *qmlTransfer = NULL; | 226 | ContentTransfer *qmlTransfer = NULL; |
505 | 227 | 227 | ||
506 | === modified file 'import/Ubuntu/Content/contentpeermodel.cpp' | |||
507 | --- import/Ubuntu/Content/contentpeermodel.cpp 2014-03-21 00:29:33 +0000 | |||
508 | +++ import/Ubuntu/Content/contentpeermodel.cpp 2014-03-21 00:29:34 +0000 | |||
509 | @@ -14,11 +14,10 @@ | |||
510 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
511 | 15 | */ | 15 | */ |
512 | 16 | 16 | ||
513 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
514 | 17 | #include "contentpeermodel.h" | 18 | #include "contentpeermodel.h" |
515 | 18 | #include <stdio.h> | 19 | #include <stdio.h> |
516 | 19 | 20 | ||
517 | 20 | #include <QDebug> | ||
518 | 21 | |||
519 | 22 | namespace cuc = com::ubuntu::content; | 21 | namespace cuc = com::ubuntu::content; |
520 | 23 | 22 | ||
521 | 24 | /*! | 23 | /*! |
522 | @@ -39,7 +38,7 @@ | |||
523 | 39 | m_handler(ContentHandler::Source), | 38 | m_handler(ContentHandler::Source), |
524 | 40 | m_complete(false) | 39 | m_complete(false) |
525 | 41 | { | 40 | { |
527 | 42 | qDebug() << Q_FUNC_INFO; | 41 | TRACE() << Q_FUNC_INFO; |
528 | 43 | m_hub = cuc::Hub::Client::instance(); | 42 | m_hub = cuc::Hub::Client::instance(); |
529 | 44 | } | 43 | } |
530 | 45 | 44 | ||
531 | @@ -69,7 +68,7 @@ | |||
532 | 69 | */ | 68 | */ |
533 | 70 | ContentType::Type ContentPeerModel::contentType() | 69 | ContentType::Type ContentPeerModel::contentType() |
534 | 71 | { | 70 | { |
536 | 72 | qDebug() << Q_FUNC_INFO; | 71 | TRACE() << Q_FUNC_INFO; |
537 | 73 | return m_contentType; | 72 | return m_contentType; |
538 | 74 | } | 73 | } |
539 | 75 | 74 | ||
540 | @@ -79,7 +78,7 @@ | |||
541 | 79 | */ | 78 | */ |
542 | 80 | void ContentPeerModel::setContentType(ContentType::Type contentType) | 79 | void ContentPeerModel::setContentType(ContentType::Type contentType) |
543 | 81 | { | 80 | { |
545 | 82 | qDebug() << Q_FUNC_INFO; | 81 | TRACE() << Q_FUNC_INFO; |
546 | 83 | m_contentType = contentType; | 82 | m_contentType = contentType; |
547 | 84 | if (m_complete) { | 83 | if (m_complete) { |
548 | 85 | findPeers(); | 84 | findPeers(); |
549 | @@ -92,7 +91,7 @@ | |||
550 | 92 | * \internal | 91 | * \internal |
551 | 93 | */ | 92 | */ |
552 | 94 | void ContentPeerModel::findPeers() { | 93 | void ContentPeerModel::findPeers() { |
554 | 95 | qDebug() << Q_FUNC_INFO; | 94 | TRACE() << Q_FUNC_INFO; |
555 | 96 | m_peers.clear(); | 95 | m_peers.clear(); |
556 | 97 | QCoreApplication::processEvents(); | 96 | QCoreApplication::processEvents(); |
557 | 98 | if(m_contentType == ContentType::All) { | 97 | if(m_contentType == ContentType::All) { |
558 | @@ -113,7 +112,7 @@ | |||
559 | 113 | */ | 112 | */ |
560 | 114 | void ContentPeerModel::appendPeersForContentType(ContentType::Type contentType) | 113 | void ContentPeerModel::appendPeersForContentType(ContentType::Type contentType) |
561 | 115 | { | 114 | { |
563 | 116 | qDebug() << Q_FUNC_INFO; | 115 | TRACE() << Q_FUNC_INFO; |
564 | 117 | const cuc::Type &hubType = ContentType::contentType2HubType(contentType); | 116 | const cuc::Type &hubType = ContentType::contentType2HubType(contentType); |
565 | 118 | QVector<cuc::Peer> hubPeers; | 117 | QVector<cuc::Peer> hubPeers; |
566 | 119 | if (m_handler == ContentHandler::Destination) { | 118 | if (m_handler == ContentHandler::Destination) { |
567 | @@ -151,7 +150,7 @@ | |||
568 | 151 | */ | 150 | */ |
569 | 152 | ContentHandler::Handler ContentPeerModel::handler() | 151 | ContentHandler::Handler ContentPeerModel::handler() |
570 | 153 | { | 152 | { |
572 | 154 | qDebug() << Q_FUNC_INFO; | 153 | TRACE() << Q_FUNC_INFO; |
573 | 155 | return m_handler; | 154 | return m_handler; |
574 | 156 | } | 155 | } |
575 | 157 | 156 | ||
576 | @@ -161,7 +160,7 @@ | |||
577 | 161 | */ | 160 | */ |
578 | 162 | void ContentPeerModel::setHandler(ContentHandler::Handler handler) | 161 | void ContentPeerModel::setHandler(ContentHandler::Handler handler) |
579 | 163 | { | 162 | { |
581 | 164 | qDebug() << Q_FUNC_INFO; | 163 | TRACE() << Q_FUNC_INFO; |
582 | 165 | m_handler = handler; | 164 | m_handler = handler; |
583 | 166 | if (m_complete) { | 165 | if (m_complete) { |
584 | 167 | findPeers(); | 166 | findPeers(); |
585 | @@ -176,7 +175,7 @@ | |||
586 | 176 | */ | 175 | */ |
587 | 177 | QQmlListProperty<ContentPeer> ContentPeerModel::peers() | 176 | QQmlListProperty<ContentPeer> ContentPeerModel::peers() |
588 | 178 | { | 177 | { |
590 | 179 | qDebug() << Q_FUNC_INFO; | 178 | TRACE() << Q_FUNC_INFO; |
591 | 180 | return QQmlListProperty<ContentPeer>(this, m_peers); | 179 | return QQmlListProperty<ContentPeer>(this, m_peers); |
592 | 181 | } | 180 | } |
593 | 182 | 181 | ||
594 | 183 | 182 | ||
595 | === modified file 'import/Ubuntu/Content/contentscope.cpp' | |||
596 | --- import/Ubuntu/Content/contentscope.cpp 2014-03-21 00:29:33 +0000 | |||
597 | +++ import/Ubuntu/Content/contentscope.cpp 2014-03-21 00:29:34 +0000 | |||
598 | @@ -14,10 +14,9 @@ | |||
599 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
600 | 15 | */ | 15 | */ |
601 | 16 | 16 | ||
602 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
603 | 17 | #include "contentscope.h" | 18 | #include "contentscope.h" |
604 | 18 | 19 | ||
605 | 19 | #include <QDebug> | ||
606 | 20 | |||
607 | 21 | /*! | 20 | /*! |
608 | 22 | \qmltype ContentScope | 21 | \qmltype ContentScope |
609 | 23 | \instantiates ContentScope | 22 | \instantiates ContentScope |
610 | @@ -41,7 +40,7 @@ | |||
611 | 41 | ContentScope::ContentScope(QObject *parent) | 40 | ContentScope::ContentScope(QObject *parent) |
612 | 42 | : QObject(parent) | 41 | : QObject(parent) |
613 | 43 | { | 42 | { |
615 | 44 | qDebug() << Q_FUNC_INFO; | 43 | TRACE() << Q_FUNC_INFO; |
616 | 45 | } | 44 | } |
617 | 46 | 45 | ||
618 | 47 | /*! | 46 | /*! |
619 | @@ -52,7 +51,7 @@ | |||
620 | 52 | com::ubuntu::content::Scope ContentScope::contentScope2HubScope(int scope) | 51 | com::ubuntu::content::Scope ContentScope::contentScope2HubScope(int scope) |
621 | 53 | { | 52 | { |
622 | 54 | Scope cscope = static_cast<Scope>(scope); | 53 | Scope cscope = static_cast<Scope>(scope); |
624 | 55 | qDebug() << Q_FUNC_INFO << cscope; | 54 | TRACE() << Q_FUNC_INFO << cscope; |
625 | 56 | return contentScope2HubScope(cscope); | 55 | return contentScope2HubScope(cscope); |
626 | 57 | } | 56 | } |
627 | 58 | 57 | ||
628 | 59 | 58 | ||
629 | === modified file 'import/Ubuntu/Content/contentstore.cpp' | |||
630 | --- import/Ubuntu/Content/contentstore.cpp 2014-03-21 00:29:33 +0000 | |||
631 | +++ import/Ubuntu/Content/contentstore.cpp 2014-03-21 00:29:34 +0000 | |||
632 | @@ -14,12 +14,11 @@ | |||
633 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
634 | 15 | */ | 15 | */ |
635 | 16 | 16 | ||
636 | 17 | #include "../../../src/com/ubuntu/content/debug.h" | ||
637 | 17 | #include "contentpeer.h" | 18 | #include "contentpeer.h" |
638 | 18 | #include "contentstore.h" | 19 | #include "contentstore.h" |
639 | 19 | #include "contenttype.h" | 20 | #include "contenttype.h" |
640 | 20 | 21 | ||
641 | 21 | #include <QDebug> | ||
642 | 22 | |||
643 | 23 | /*! | 22 | /*! |
644 | 24 | * \qmltype ContentStore | 23 | * \qmltype ContentStore |
645 | 25 | * \instantiates ContentStore | 24 | * \instantiates ContentStore |
646 | @@ -37,7 +36,7 @@ | |||
647 | 37 | m_store(0), | 36 | m_store(0), |
648 | 38 | m_scope(ContentScope::System) | 37 | m_scope(ContentScope::System) |
649 | 39 | { | 38 | { |
651 | 40 | qDebug() << Q_FUNC_INFO; | 39 | TRACE() << Q_FUNC_INFO; |
652 | 41 | m_hub = cuc::Hub::Client::instance(); | 40 | m_hub = cuc::Hub::Client::instance(); |
653 | 42 | } | 41 | } |
654 | 43 | 42 | ||
655 | @@ -50,7 +49,7 @@ | |||
656 | 50 | { | 49 | { |
657 | 51 | static const QString __empty; | 50 | static const QString __empty; |
658 | 52 | 51 | ||
660 | 53 | qDebug() << Q_FUNC_INFO; | 52 | TRACE() << Q_FUNC_INFO; |
661 | 54 | 53 | ||
662 | 55 | if ( ! m_store) { | 54 | if ( ! m_store) { |
663 | 56 | qWarning() << "Accessing ContentStore uri with NULL internal store"; | 55 | qWarning() << "Accessing ContentStore uri with NULL internal store"; |
664 | @@ -65,7 +64,7 @@ | |||
665 | 65 | */ | 64 | */ |
666 | 66 | const com::ubuntu::content::Store *ContentStore::store() const | 65 | const com::ubuntu::content::Store *ContentStore::store() const |
667 | 67 | { | 66 | { |
669 | 68 | qDebug() << Q_FUNC_INFO; | 67 | TRACE() << Q_FUNC_INFO; |
670 | 69 | return m_store; | 68 | return m_store; |
671 | 70 | } | 69 | } |
672 | 71 | 70 | ||
673 | @@ -75,7 +74,7 @@ | |||
674 | 75 | */ | 74 | */ |
675 | 76 | void ContentStore::setStore(const com::ubuntu::content::Store *store) | 75 | void ContentStore::setStore(const com::ubuntu::content::Store *store) |
676 | 77 | { | 76 | { |
678 | 78 | qDebug() << Q_FUNC_INFO; | 77 | TRACE() << Q_FUNC_INFO; |
679 | 79 | m_store = store; | 78 | m_store = store; |
680 | 80 | Q_EMIT uriChanged(); | 79 | Q_EMIT uriChanged(); |
681 | 81 | } | 80 | } |
682 | @@ -87,7 +86,7 @@ | |||
683 | 87 | */ | 86 | */ |
684 | 88 | ContentScope::Scope ContentStore::scope() | 87 | ContentScope::Scope ContentStore::scope() |
685 | 89 | { | 88 | { |
687 | 90 | qDebug() << Q_FUNC_INFO; | 89 | TRACE() << Q_FUNC_INFO; |
688 | 91 | return m_scope; | 90 | return m_scope; |
689 | 92 | } | 91 | } |
690 | 93 | 92 | ||
691 | @@ -97,7 +96,7 @@ | |||
692 | 97 | */ | 96 | */ |
693 | 98 | void ContentStore::setScope(ContentScope::Scope scope) | 97 | void ContentStore::setScope(ContentScope::Scope scope) |
694 | 99 | { | 98 | { |
696 | 100 | qDebug() << Q_FUNC_INFO; | 99 | TRACE() << Q_FUNC_INFO; |
697 | 101 | m_scope = scope; | 100 | m_scope = scope; |
698 | 102 | 101 | ||
699 | 103 | Q_EMIT scopeChanged(); | 102 | Q_EMIT scopeChanged(); |
700 | @@ -109,7 +108,7 @@ | |||
701 | 109 | */ | 108 | */ |
702 | 110 | void ContentStore::updateStore(ContentType::Type contentType) | 109 | void ContentStore::updateStore(ContentType::Type contentType) |
703 | 111 | { | 110 | { |
705 | 112 | qDebug() << Q_FUNC_INFO; | 111 | TRACE() << Q_FUNC_INFO; |
706 | 113 | 112 | ||
707 | 114 | com::ubuntu::content::Scope hubScope = ContentScope::contentScope2HubScope(m_scope); | 113 | com::ubuntu::content::Scope hubScope = ContentScope::contentScope2HubScope(m_scope); |
708 | 115 | const com::ubuntu::content::Type &hubType = ContentType::contentType2HubType(contentType); | 114 | const com::ubuntu::content::Type &hubType = ContentType::contentType2HubType(contentType); |
709 | 116 | 115 | ||
710 | === modified file 'import/Ubuntu/Content/contenttransfer.cpp' | |||
711 | --- import/Ubuntu/Content/contenttransfer.cpp 2014-03-21 00:29:33 +0000 | |||
712 | +++ import/Ubuntu/Content/contenttransfer.cpp 2014-03-21 00:29:34 +0000 | |||
713 | @@ -16,11 +16,10 @@ | |||
714 | 16 | 16 | ||
715 | 17 | #include "contenttransfer.h" | 17 | #include "contenttransfer.h" |
716 | 18 | #include "contentitem.h" | 18 | #include "contentitem.h" |
717 | 19 | #include "../../../src/com/ubuntu/content/debug.h" | ||
718 | 19 | 20 | ||
719 | 20 | #include <com/ubuntu/content/item.h> | 21 | #include <com/ubuntu/content/item.h> |
720 | 21 | 22 | ||
721 | 22 | #include <QDebug> | ||
722 | 23 | |||
723 | 24 | /*! | 23 | /*! |
724 | 25 | * \qmltype ContentTransfer | 24 | * \qmltype ContentTransfer |
725 | 26 | * \instantiates ContentTransfer | 25 | * \instantiates ContentTransfer |
726 | @@ -39,7 +38,7 @@ | |||
727 | 39 | m_selectionType(Single), | 38 | m_selectionType(Single), |
728 | 40 | m_store(0) | 39 | m_store(0) |
729 | 41 | { | 40 | { |
731 | 42 | qDebug() << Q_FUNC_INFO; | 41 | TRACE() << Q_FUNC_INFO; |
732 | 43 | } | 42 | } |
733 | 44 | 43 | ||
734 | 45 | /*! | 44 | /*! |
735 | @@ -76,18 +75,18 @@ | |||
736 | 76 | */ | 75 | */ |
737 | 77 | ContentTransfer::State ContentTransfer::state() const | 76 | ContentTransfer::State ContentTransfer::state() const |
738 | 78 | { | 77 | { |
740 | 79 | qDebug() << Q_FUNC_INFO; | 78 | TRACE() << Q_FUNC_INFO; |
741 | 80 | return m_state; | 79 | return m_state; |
742 | 81 | } | 80 | } |
743 | 82 | 81 | ||
744 | 83 | void ContentTransfer::setState(ContentTransfer::State state) | 82 | void ContentTransfer::setState(ContentTransfer::State state) |
745 | 84 | { | 83 | { |
747 | 85 | qDebug() << Q_FUNC_INFO << state; | 84 | TRACE() << Q_FUNC_INFO << state; |
748 | 86 | if (!m_transfer) | 85 | if (!m_transfer) |
749 | 87 | return; | 86 | return; |
750 | 88 | 87 | ||
751 | 89 | if (state == Charged && m_state == InProgress) { | 88 | if (state == Charged && m_state == InProgress) { |
753 | 90 | qDebug() << Q_FUNC_INFO << "Charged"; | 89 | TRACE() << Q_FUNC_INFO << "Charged"; |
754 | 91 | QVector<cuc::Item> hubItems; | 90 | QVector<cuc::Item> hubItems; |
755 | 92 | hubItems.reserve(m_items.size()); | 91 | hubItems.reserve(m_items.size()); |
756 | 93 | Q_FOREACH (const ContentItem *citem, m_items) { | 92 | Q_FOREACH (const ContentItem *citem, m_items) { |
757 | @@ -96,7 +95,7 @@ | |||
758 | 96 | m_transfer->charge(hubItems); | 95 | m_transfer->charge(hubItems); |
759 | 97 | return; | 96 | return; |
760 | 98 | } else if (state == Aborted) { | 97 | } else if (state == Aborted) { |
762 | 99 | qDebug() << Q_FUNC_INFO << "Aborted"; | 98 | TRACE() << Q_FUNC_INFO << "Aborted"; |
763 | 100 | m_transfer->abort(); | 99 | m_transfer->abort(); |
764 | 101 | } else | 100 | } else |
765 | 102 | updateState(); | 101 | updateState(); |
766 | @@ -153,7 +152,7 @@ | |||
767 | 153 | 152 | ||
768 | 154 | void ContentTransfer::setSelectionType(ContentTransfer::SelectionType type) | 153 | void ContentTransfer::setSelectionType(ContentTransfer::SelectionType type) |
769 | 155 | { | 154 | { |
771 | 156 | qDebug() << Q_FUNC_INFO << type; | 155 | TRACE() << Q_FUNC_INFO << type; |
772 | 157 | if (!m_transfer) | 156 | if (!m_transfer) |
773 | 158 | return; | 157 | return; |
774 | 159 | 158 | ||
775 | @@ -169,7 +168,7 @@ | |||
776 | 169 | */ | 168 | */ |
777 | 170 | QQmlListProperty<ContentItem> ContentTransfer::items() | 169 | QQmlListProperty<ContentItem> ContentTransfer::items() |
778 | 171 | { | 170 | { |
780 | 172 | qDebug() << Q_FUNC_INFO; | 171 | TRACE() << Q_FUNC_INFO; |
781 | 173 | if (m_state == Charged) { | 172 | if (m_state == Charged) { |
782 | 174 | collectItems(); | 173 | collectItems(); |
783 | 175 | } | 174 | } |
784 | @@ -183,7 +182,7 @@ | |||
785 | 183 | */ | 182 | */ |
786 | 184 | bool ContentTransfer::start() | 183 | bool ContentTransfer::start() |
787 | 185 | { | 184 | { |
789 | 186 | qDebug() << Q_FUNC_INFO << m_transfer->id() << ":" << m_state; | 185 | TRACE() << Q_FUNC_INFO << m_transfer->id() << ":" << m_state; |
790 | 187 | if (m_state == Created) { | 186 | if (m_state == Created) { |
791 | 188 | return m_transfer->start(); | 187 | return m_transfer->start(); |
792 | 189 | } else { | 188 | } else { |
793 | @@ -199,7 +198,7 @@ | |||
794 | 199 | */ | 198 | */ |
795 | 200 | bool ContentTransfer::finalize() | 199 | bool ContentTransfer::finalize() |
796 | 201 | { | 200 | { |
798 | 202 | qDebug() << Q_FUNC_INFO; | 201 | TRACE() << Q_FUNC_INFO; |
799 | 203 | return m_transfer->finalize(); | 202 | return m_transfer->finalize(); |
800 | 204 | } | 203 | } |
801 | 205 | 204 | ||
802 | @@ -209,13 +208,13 @@ | |||
803 | 209 | */ | 208 | */ |
804 | 210 | const QString ContentTransfer::store() const | 209 | const QString ContentTransfer::store() const |
805 | 211 | { | 210 | { |
807 | 212 | qDebug() << Q_FUNC_INFO; | 211 | TRACE() << Q_FUNC_INFO; |
808 | 213 | return m_transfer->store().uri(); | 212 | return m_transfer->store().uri(); |
809 | 214 | } | 213 | } |
810 | 215 | 214 | ||
811 | 216 | void ContentTransfer::setStore(ContentStore* contentStore) | 215 | void ContentTransfer::setStore(ContentStore* contentStore) |
812 | 217 | { | 216 | { |
814 | 218 | qDebug() << Q_FUNC_INFO; | 217 | TRACE() << Q_FUNC_INFO; |
815 | 219 | 218 | ||
816 | 220 | if (!m_transfer) | 219 | if (!m_transfer) |
817 | 221 | { | 220 | { |
818 | @@ -234,7 +233,7 @@ | |||
819 | 234 | */ | 233 | */ |
820 | 235 | com::ubuntu::content::Transfer *ContentTransfer::transfer() const | 234 | com::ubuntu::content::Transfer *ContentTransfer::transfer() const |
821 | 236 | { | 235 | { |
823 | 237 | qDebug() << Q_FUNC_INFO; | 236 | TRACE() << Q_FUNC_INFO; |
824 | 238 | return m_transfer; | 237 | return m_transfer; |
825 | 239 | } | 238 | } |
826 | 240 | 239 | ||
827 | @@ -256,7 +255,7 @@ | |||
828 | 256 | 255 | ||
829 | 257 | m_transfer = transfer; | 256 | m_transfer = transfer; |
830 | 258 | m_direction = static_cast<ContentTransfer::Direction>(transfer->direction()); | 257 | m_direction = static_cast<ContentTransfer::Direction>(transfer->direction()); |
832 | 259 | qDebug() << Q_FUNC_INFO << "Direction:" << m_direction; | 258 | TRACE() << Q_FUNC_INFO << "Direction:" << m_direction; |
833 | 260 | 259 | ||
834 | 261 | connect(m_transfer, SIGNAL(selectionTypeChanged()), this, SLOT(updateSelectionType())); | 260 | connect(m_transfer, SIGNAL(selectionTypeChanged()), this, SLOT(updateSelectionType())); |
835 | 262 | connect(m_transfer, SIGNAL(storeChanged()), this, SLOT(updateStore())); | 261 | connect(m_transfer, SIGNAL(storeChanged()), this, SLOT(updateStore())); |
836 | @@ -273,7 +272,7 @@ | |||
837 | 273 | */ | 272 | */ |
838 | 274 | void ContentTransfer::collectItems() | 273 | void ContentTransfer::collectItems() |
839 | 275 | { | 274 | { |
841 | 276 | qDebug() << Q_FUNC_INFO; | 275 | TRACE() << Q_FUNC_INFO; |
842 | 277 | if (m_state != Charged) | 276 | if (m_state != Charged) |
843 | 278 | return; | 277 | return; |
844 | 279 | 278 | ||
845 | @@ -295,11 +294,11 @@ | |||
846 | 295 | */ | 294 | */ |
847 | 296 | void ContentTransfer::updateState() | 295 | void ContentTransfer::updateState() |
848 | 297 | { | 296 | { |
850 | 298 | qDebug() << Q_FUNC_INFO << m_transfer->state(); | 297 | TRACE() << Q_FUNC_INFO << m_transfer->state(); |
851 | 299 | 298 | ||
852 | 300 | if (!m_transfer) | 299 | if (!m_transfer) |
853 | 301 | { | 300 | { |
855 | 302 | qWarning() << Q_FUNC_INFO << "Invalid transfer"; | 301 | TRACE() << Q_FUNC_INFO << "Invalid transfer"; |
856 | 303 | return; | 302 | return; |
857 | 304 | } | 303 | } |
858 | 305 | 304 | ||
859 | @@ -313,10 +312,10 @@ | |||
860 | 313 | */ | 312 | */ |
861 | 314 | void ContentTransfer::updateSelectionType() | 313 | void ContentTransfer::updateSelectionType() |
862 | 315 | { | 314 | { |
864 | 316 | qDebug() << Q_FUNC_INFO; | 315 | TRACE() << Q_FUNC_INFO; |
865 | 317 | if (!m_transfer) | 316 | if (!m_transfer) |
866 | 318 | { | 317 | { |
868 | 319 | qWarning() << Q_FUNC_INFO << "Invalid transfer"; | 318 | TRACE() << Q_FUNC_INFO << "Invalid transfer"; |
869 | 320 | return; | 319 | return; |
870 | 321 | } | 320 | } |
871 | 322 | 321 | ||
872 | @@ -331,10 +330,10 @@ | |||
873 | 331 | */ | 330 | */ |
874 | 332 | void ContentTransfer::updateStore() | 331 | void ContentTransfer::updateStore() |
875 | 333 | { | 332 | { |
877 | 334 | qDebug() << Q_FUNC_INFO; | 333 | TRACE() << Q_FUNC_INFO; |
878 | 335 | if (!m_transfer) | 334 | if (!m_transfer) |
879 | 336 | { | 335 | { |
881 | 337 | qWarning() << Q_FUNC_INFO << "Invalid transfer"; | 336 | TRACE() << Q_FUNC_INFO << "Invalid transfer"; |
882 | 338 | return; | 337 | return; |
883 | 339 | } | 338 | } |
884 | 340 | 339 | ||
885 | 341 | 340 | ||
886 | === modified file 'import/Ubuntu/Content/contenttype.cpp' | |||
887 | --- import/Ubuntu/Content/contenttype.cpp 2014-03-21 00:29:33 +0000 | |||
888 | +++ import/Ubuntu/Content/contenttype.cpp 2014-03-21 00:29:34 +0000 | |||
889 | @@ -15,8 +15,7 @@ | |||
890 | 15 | */ | 15 | */ |
891 | 16 | 16 | ||
892 | 17 | #include "contenttype.h" | 17 | #include "contenttype.h" |
895 | 18 | 18 | #include "../../../src/com/ubuntu/content/debug.h" | |
894 | 19 | #include <QDebug> | ||
896 | 20 | 19 | ||
897 | 21 | /*! | 20 | /*! |
898 | 22 | \qmltype ContentType | 21 | \qmltype ContentType |
899 | @@ -57,7 +56,7 @@ | |||
900 | 57 | ContentType::ContentType(QObject *parent) | 56 | ContentType::ContentType(QObject *parent) |
901 | 58 | : QObject(parent) | 57 | : QObject(parent) |
902 | 59 | { | 58 | { |
904 | 60 | qDebug() << Q_FUNC_INFO; | 59 | TRACE() << Q_FUNC_INFO; |
905 | 61 | } | 60 | } |
906 | 62 | 61 | ||
907 | 63 | 62 | ||
908 | @@ -69,7 +68,7 @@ | |||
909 | 69 | const com::ubuntu::content::Type &ContentType::contentType2HubType(int type) | 68 | const com::ubuntu::content::Type &ContentType::contentType2HubType(int type) |
910 | 70 | { | 69 | { |
911 | 71 | Type ctype = static_cast<Type>(type); | 70 | Type ctype = static_cast<Type>(type); |
913 | 72 | qDebug() << Q_FUNC_INFO << ctype; | 71 | TRACE() << Q_FUNC_INFO << ctype; |
914 | 73 | return contentType2HubType(ctype); | 72 | return contentType2HubType(ctype); |
915 | 74 | } | 73 | } |
916 | 75 | 74 | ||
917 | 76 | 75 | ||
918 | === modified file 'import/Ubuntu/Content/qmlimportexporthandler.cpp' | |||
919 | --- import/Ubuntu/Content/qmlimportexporthandler.cpp 2014-03-21 00:29:33 +0000 | |||
920 | +++ import/Ubuntu/Content/qmlimportexporthandler.cpp 2014-03-21 00:29:34 +0000 | |||
921 | @@ -15,11 +15,10 @@ | |||
922 | 15 | */ | 15 | */ |
923 | 16 | 16 | ||
924 | 17 | #include "qmlimportexporthandler.h" | 17 | #include "qmlimportexporthandler.h" |
925 | 18 | #include "../../../src/com/ubuntu/content/debug.h" | ||
926 | 18 | 19 | ||
927 | 19 | #include <com/ubuntu/content/transfer.h> | 20 | #include <com/ubuntu/content/transfer.h> |
928 | 20 | 21 | ||
929 | 21 | #include <QDebug> | ||
930 | 22 | |||
931 | 23 | namespace cuc = com::ubuntu::content; | 22 | namespace cuc = com::ubuntu::content; |
932 | 24 | 23 | ||
933 | 25 | /*! | 24 | /*! |
934 | @@ -29,7 +28,7 @@ | |||
935 | 29 | QmlImportExportHandler::QmlImportExportHandler(QObject *parent) | 28 | QmlImportExportHandler::QmlImportExportHandler(QObject *parent) |
936 | 30 | : cuc::ImportExportHandler(parent) | 29 | : cuc::ImportExportHandler(parent) |
937 | 31 | { | 30 | { |
939 | 32 | qDebug() << Q_FUNC_INFO; | 31 | TRACE() << Q_FUNC_INFO; |
940 | 33 | } | 32 | } |
941 | 34 | 33 | ||
942 | 35 | /*! | 34 | /*! |
943 | @@ -37,7 +36,7 @@ | |||
944 | 37 | */ | 36 | */ |
945 | 38 | void QmlImportExportHandler::handle_import(com::ubuntu::content::Transfer *transfer) | 37 | void QmlImportExportHandler::handle_import(com::ubuntu::content::Transfer *transfer) |
946 | 39 | { | 38 | { |
948 | 40 | qDebug() << Q_FUNC_INFO; | 39 | TRACE() << Q_FUNC_INFO; |
949 | 41 | Q_EMIT importRequested(transfer); | 40 | Q_EMIT importRequested(transfer); |
950 | 42 | } | 41 | } |
951 | 43 | 42 | ||
952 | @@ -46,7 +45,7 @@ | |||
953 | 46 | */ | 45 | */ |
954 | 47 | void QmlImportExportHandler::handle_export(com::ubuntu::content::Transfer *transfer) | 46 | void QmlImportExportHandler::handle_export(com::ubuntu::content::Transfer *transfer) |
955 | 48 | { | 47 | { |
957 | 49 | qDebug() << Q_FUNC_INFO; | 48 | TRACE() << Q_FUNC_INFO; |
958 | 50 | Q_EMIT exportRequested(transfer); | 49 | Q_EMIT exportRequested(transfer); |
959 | 51 | } | 50 | } |
960 | 52 | 51 | ||
961 | @@ -55,6 +54,6 @@ | |||
962 | 55 | */ | 54 | */ |
963 | 56 | void QmlImportExportHandler::handle_share(com::ubuntu::content::Transfer *transfer) | 55 | void QmlImportExportHandler::handle_share(com::ubuntu::content::Transfer *transfer) |
964 | 57 | { | 56 | { |
966 | 58 | qDebug() << Q_FUNC_INFO; | 57 | TRACE() << Q_FUNC_INFO; |
967 | 59 | Q_EMIT shareRequested(transfer); | 58 | Q_EMIT shareRequested(transfer); |
968 | 60 | } | 59 | } |
969 | 61 | 60 | ||
970 | === modified file 'src/com/ubuntu/content/CMakeLists.txt' | |||
971 | --- src/com/ubuntu/content/CMakeLists.txt 2014-03-21 00:29:33 +0000 | |||
972 | +++ src/com/ubuntu/content/CMakeLists.txt 2014-03-21 00:29:34 +0000 | |||
973 | @@ -68,6 +68,7 @@ | |||
974 | 68 | transfer.cpp | 68 | transfer.cpp |
975 | 69 | type.cpp | 69 | type.cpp |
976 | 70 | utils.cpp | 70 | utils.cpp |
977 | 71 | debug.cpp | ||
978 | 71 | 72 | ||
979 | 72 | detail/app_manager.cpp | 73 | detail/app_manager.cpp |
980 | 73 | detail/service.cpp | 74 | detail/service.cpp |
981 | 74 | 75 | ||
982 | === added file 'src/com/ubuntu/content/debug.cpp' | |||
983 | --- src/com/ubuntu/content/debug.cpp 1970-01-01 00:00:00 +0000 | |||
984 | +++ src/com/ubuntu/content/debug.cpp 2014-03-21 00:29:34 +0000 | |||
985 | @@ -0,0 +1,26 @@ | |||
986 | 1 | /* | ||
987 | 2 | * Copyright © 2014 Canonical Ltd. | ||
988 | 3 | * | ||
989 | 4 | * This program is free software: you can redistribute it and/or modify | ||
990 | 5 | * it under the terms of the GNU Lesser General Public License version 3 as | ||
991 | 6 | * published by the Free Software Foundation. | ||
992 | 7 | * | ||
993 | 8 | * This program is distributed in the hope that it will be useful, | ||
994 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
995 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
996 | 11 | * GNU Lesser General Public License for more details. | ||
997 | 12 | * | ||
998 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
999 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1000 | 15 | */ | ||
1001 | 16 | |||
1002 | 17 | |||
1003 | 18 | #include "debug.h" | ||
1004 | 19 | |||
1005 | 20 | int appLoggingLevel = 1; // criticals | ||
1006 | 21 | |||
1007 | 22 | void setLoggingLevel(int level) | ||
1008 | 23 | { | ||
1009 | 24 | appLoggingLevel = level; | ||
1010 | 25 | } | ||
1011 | 26 | |||
1012 | 0 | 27 | ||
1013 | === added file 'src/com/ubuntu/content/debug.h' | |||
1014 | --- src/com/ubuntu/content/debug.h 1970-01-01 00:00:00 +0000 | |||
1015 | +++ src/com/ubuntu/content/debug.h 2014-03-21 00:29:34 +0000 | |||
1016 | @@ -0,0 +1,53 @@ | |||
1017 | 1 | /* | ||
1018 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1019 | 3 | * | ||
1020 | 4 | * This program is free software: you can redistribute it and/or modify | ||
1021 | 5 | * it under the terms of the GNU Lesser General Public License version 3 as | ||
1022 | 6 | * published by the Free Software Foundation. | ||
1023 | 7 | * | ||
1024 | 8 | * This program is distributed in the hope that it will be useful, | ||
1025 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1026 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1027 | 11 | * GNU Lesser General Public License for more details. | ||
1028 | 12 | * | ||
1029 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1030 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1031 | 15 | */ | ||
1032 | 16 | |||
1033 | 17 | #ifndef DEBUG_H | ||
1034 | 18 | #define DEBUG_H | ||
1035 | 19 | |||
1036 | 20 | #include <QDebug> | ||
1037 | 21 | |||
1038 | 22 | /* 0 - fatal, 1 - critical(default), 2 - info/debug */ | ||
1039 | 23 | extern int appLoggingLevel; | ||
1040 | 24 | |||
1041 | 25 | static inline bool debugEnabled() | ||
1042 | 26 | { | ||
1043 | 27 | return appLoggingLevel >= 2; | ||
1044 | 28 | } | ||
1045 | 29 | |||
1046 | 30 | static inline bool criticalsEnabled() | ||
1047 | 31 | { | ||
1048 | 32 | return appLoggingLevel >= 1; | ||
1049 | 33 | } | ||
1050 | 34 | |||
1051 | 35 | static inline int loggingLevel() | ||
1052 | 36 | { | ||
1053 | 37 | return appLoggingLevel; | ||
1054 | 38 | } | ||
1055 | 39 | |||
1056 | 40 | void setLoggingLevel(int level); | ||
1057 | 41 | |||
1058 | 42 | #ifdef DEBUG_ENABLED | ||
1059 | 43 | #define TRACE() \ | ||
1060 | 44 | if (debugEnabled()) qDebug() << __FILE__ << __LINE__ << __func__ | ||
1061 | 45 | #define BLAME() \ | ||
1062 | 46 | if (criticalsEnabled()) qCritical() << __FILE__ << __LINE__ << __func__ | ||
1063 | 47 | #else | ||
1064 | 48 | #define TRACE() while (0) qDebug() | ||
1065 | 49 | #define BLAME() while (0) qDebug() | ||
1066 | 50 | #endif | ||
1067 | 51 | |||
1068 | 52 | #endif // DEBUG_H | ||
1069 | 53 | |||
1070 | 0 | 54 | ||
1071 | === modified file 'src/com/ubuntu/content/detail/app_manager.cpp' | |||
1072 | --- src/com/ubuntu/content/detail/app_manager.cpp 2014-03-21 00:29:33 +0000 | |||
1073 | +++ src/com/ubuntu/content/detail/app_manager.cpp 2014-03-21 00:29:34 +0000 | |||
1074 | @@ -15,9 +15,9 @@ | |||
1075 | 15 | */ | 15 | */ |
1076 | 16 | 16 | ||
1077 | 17 | #include "app_manager.h" | 17 | #include "app_manager.h" |
1078 | 18 | #include "debug.h" | ||
1079 | 18 | 19 | ||
1080 | 19 | #include <upstart-app-launch.h> | 20 | #include <upstart-app-launch.h> |
1081 | 20 | #include <QDebug> | ||
1082 | 21 | 21 | ||
1083 | 22 | namespace cucd = com::ubuntu::content::detail; | 22 | namespace cucd = com::ubuntu::content::detail; |
1084 | 23 | 23 | ||
1085 | @@ -27,7 +27,7 @@ | |||
1086 | 27 | 27 | ||
1087 | 28 | bool cucd::AppManager::invoke_application(const std::string &app_id) | 28 | bool cucd::AppManager::invoke_application(const std::string &app_id) |
1088 | 29 | { | 29 | { |
1090 | 30 | qDebug() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | 30 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); |
1091 | 31 | gchar ** uris = NULL; | 31 | gchar ** uris = NULL; |
1092 | 32 | gboolean ok = upstart_app_launch_start_application(app_id.c_str(), (const gchar * const *)uris); | 32 | gboolean ok = upstart_app_launch_start_application(app_id.c_str(), (const gchar * const *)uris); |
1093 | 33 | return static_cast<bool>(ok); | 33 | return static_cast<bool>(ok); |
1094 | @@ -38,7 +38,7 @@ | |||
1095 | 38 | */ | 38 | */ |
1096 | 39 | bool cucd::AppManager::stop_application(const std::string &app_id) | 39 | bool cucd::AppManager::stop_application(const std::string &app_id) |
1097 | 40 | { | 40 | { |
1099 | 41 | qDebug() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | 41 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); |
1100 | 42 | 42 | ||
1101 | 43 | gboolean ok = upstart_app_launch_stop_application(app_id.c_str()); | 43 | gboolean ok = upstart_app_launch_stop_application(app_id.c_str()); |
1102 | 44 | return static_cast<bool>(ok); | 44 | return static_cast<bool>(ok); |
1103 | 45 | 45 | ||
1104 | === modified file 'src/com/ubuntu/content/detail/handler.cpp' | |||
1105 | --- src/com/ubuntu/content/detail/handler.cpp 2014-03-21 00:29:33 +0000 | |||
1106 | +++ src/com/ubuntu/content/detail/handler.cpp 2014-03-21 00:29:34 +0000 | |||
1107 | @@ -19,9 +19,9 @@ | |||
1108 | 19 | #include "transfer_p.h" | 19 | #include "transfer_p.h" |
1109 | 20 | #include "handler.h" | 20 | #include "handler.h" |
1110 | 21 | #include "utils.cpp" | 21 | #include "utils.cpp" |
1111 | 22 | #include "debug.h" | ||
1112 | 22 | 23 | ||
1113 | 23 | #include <QObject> | 24 | #include <QObject> |
1114 | 24 | #include <QDebug> | ||
1115 | 25 | 25 | ||
1116 | 26 | namespace cucd = com::ubuntu::content::detail; | 26 | namespace cucd = com::ubuntu::content::detail; |
1117 | 27 | namespace cuc = com::ubuntu::content; | 27 | namespace cuc = com::ubuntu::content; |
1118 | @@ -35,7 +35,7 @@ | |||
1119 | 35 | connection(connection), | 35 | connection(connection), |
1120 | 36 | peer_id(peer_id) | 36 | peer_id(peer_id) |
1121 | 37 | { | 37 | { |
1123 | 38 | qDebug() << Q_FUNC_INFO; | 38 | TRACE() << Q_FUNC_INFO; |
1124 | 39 | } | 39 | } |
1125 | 40 | 40 | ||
1126 | 41 | QDBusConnection connection; | 41 | QDBusConnection connection; |
1127 | @@ -45,7 +45,7 @@ | |||
1128 | 45 | cucd::Handler::Handler(QDBusConnection connection, const QString& peer_id, cuc::ImportExportHandler* handler) | 45 | cucd::Handler::Handler(QDBusConnection connection, const QString& peer_id, cuc::ImportExportHandler* handler) |
1129 | 46 | : d(new Private{connection, peer_id, this}) | 46 | : d(new Private{connection, peer_id, this}) |
1130 | 47 | { | 47 | { |
1132 | 48 | qDebug() << Q_FUNC_INFO; | 48 | TRACE() << Q_FUNC_INFO; |
1133 | 49 | m_handler = handler; | 49 | m_handler = handler; |
1134 | 50 | } | 50 | } |
1135 | 51 | 51 | ||
1136 | @@ -55,20 +55,20 @@ | |||
1137 | 55 | 55 | ||
1138 | 56 | void cucd::Handler::HandleImport(const QDBusObjectPath& transfer) | 56 | void cucd::Handler::HandleImport(const QDBusObjectPath& transfer) |
1139 | 57 | { | 57 | { |
1141 | 58 | qDebug() << Q_FUNC_INFO << transfer.path(); | 58 | TRACE() << Q_FUNC_INFO << transfer.path(); |
1142 | 59 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); | 59 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); |
1143 | 60 | 60 | ||
1145 | 61 | qDebug() << Q_FUNC_INFO << "State:" << t->state(); | 61 | TRACE() << Q_FUNC_INFO << "State:" << t->state(); |
1146 | 62 | if (t->state() == cuc::Transfer::charged) | 62 | if (t->state() == cuc::Transfer::charged) |
1147 | 63 | m_handler->handle_import(t); | 63 | m_handler->handle_import(t); |
1148 | 64 | } | 64 | } |
1149 | 65 | 65 | ||
1150 | 66 | void cucd::Handler::HandleExport(const QDBusObjectPath& transfer) | 66 | void cucd::Handler::HandleExport(const QDBusObjectPath& transfer) |
1151 | 67 | { | 67 | { |
1153 | 68 | qDebug() << Q_FUNC_INFO << transfer.path(); | 68 | TRACE() << Q_FUNC_INFO << transfer.path(); |
1154 | 69 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); | 69 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); |
1155 | 70 | 70 | ||
1157 | 71 | qDebug() << Q_FUNC_INFO << "State:" << t->state(); | 71 | TRACE() << Q_FUNC_INFO << "State:" << t->state(); |
1158 | 72 | if (t->state() == cuc::Transfer::initiated) | 72 | if (t->state() == cuc::Transfer::initiated) |
1159 | 73 | { | 73 | { |
1160 | 74 | t->d->handled(); | 74 | t->d->handled(); |
1161 | @@ -78,10 +78,10 @@ | |||
1162 | 78 | 78 | ||
1163 | 79 | void cucd::Handler::HandleShare(const QDBusObjectPath& transfer) | 79 | void cucd::Handler::HandleShare(const QDBusObjectPath& transfer) |
1164 | 80 | { | 80 | { |
1166 | 81 | qDebug() << Q_FUNC_INFO; | 81 | TRACE() << Q_FUNC_INFO; |
1167 | 82 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); | 82 | cuc::Transfer* t = cuc::Transfer::Private::make_transfer(transfer, this); |
1168 | 83 | 83 | ||
1170 | 84 | qDebug() << Q_FUNC_INFO << "State:" << t->state(); | 84 | TRACE() << Q_FUNC_INFO << "State:" << t->state(); |
1171 | 85 | if (t->state() == cuc::Transfer::charged) | 85 | if (t->state() == cuc::Transfer::charged) |
1172 | 86 | { | 86 | { |
1173 | 87 | m_handler->handle_share(t); | 87 | m_handler->handle_share(t); |
1174 | 88 | 88 | ||
1175 | === modified file 'src/com/ubuntu/content/detail/service.cpp' | |||
1176 | --- src/com/ubuntu/content/detail/service.cpp 2014-03-21 00:29:33 +0000 | |||
1177 | +++ src/com/ubuntu/content/detail/service.cpp 2014-03-21 00:29:34 +0000 | |||
1178 | @@ -16,8 +16,8 @@ | |||
1179 | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> |
1180 | 17 | */ | 17 | */ |
1181 | 18 | 18 | ||
1182 | 19 | #include "debug.h" | ||
1183 | 19 | #include "service.h" | 20 | #include "service.h" |
1184 | 20 | |||
1185 | 21 | #include "peer_registry.h" | 21 | #include "peer_registry.h" |
1186 | 22 | #include "transfer.h" | 22 | #include "transfer.h" |
1187 | 23 | #include "transferadaptor.h" | 23 | #include "transferadaptor.h" |
1188 | @@ -94,10 +94,10 @@ | |||
1189 | 94 | 94 | ||
1190 | 95 | cucd::Service::~Service() | 95 | cucd::Service::~Service() |
1191 | 96 | { | 96 | { |
1193 | 97 | qDebug() << Q_FUNC_INFO; | 97 | TRACE() << Q_FUNC_INFO; |
1194 | 98 | Q_FOREACH (cucd::Transfer *t, d->active_transfers) | 98 | Q_FOREACH (cucd::Transfer *t, d->active_transfers) |
1195 | 99 | { | 99 | { |
1197 | 100 | qDebug() << Q_FUNC_INFO << "Destroying transfer:" << t->Id(); | 100 | TRACE() << Q_FUNC_INFO << "Destroying transfer:" << t->Id(); |
1198 | 101 | delete t; | 101 | delete t; |
1199 | 102 | } | 102 | } |
1200 | 103 | } | 103 | } |
1201 | @@ -158,11 +158,11 @@ | |||
1202 | 158 | 158 | ||
1203 | 159 | QDBusObjectPath cucd::Service::CreateImportFromPeer(const QString& peer_id, const QString& app_id) | 159 | QDBusObjectPath cucd::Service::CreateImportFromPeer(const QString& peer_id, const QString& app_id) |
1204 | 160 | { | 160 | { |
1206 | 161 | qDebug() << Q_FUNC_INFO; | 161 | TRACE() << Q_FUNC_INFO; |
1207 | 162 | QString dest_id = app_id; | 162 | QString dest_id = app_id; |
1208 | 163 | if (dest_id.isEmpty()) | 163 | if (dest_id.isEmpty()) |
1209 | 164 | { | 164 | { |
1211 | 165 | qDebug() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; | 165 | TRACE() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; |
1212 | 166 | dest_id = aa_profile(this->message().service()); | 166 | dest_id = aa_profile(this->message().service()); |
1213 | 167 | } | 167 | } |
1214 | 168 | return CreateTransfer(dest_id, peer_id, cuc::Transfer::Import); | 168 | return CreateTransfer(dest_id, peer_id, cuc::Transfer::Import); |
1215 | @@ -170,7 +170,7 @@ | |||
1216 | 170 | 170 | ||
1217 | 171 | bool cucd::Service::should_cancel (int st) | 171 | bool cucd::Service::should_cancel (int st) |
1218 | 172 | { | 172 | { |
1220 | 173 | qDebug() << Q_FUNC_INFO << "State:" << st; | 173 | TRACE() << Q_FUNC_INFO << "State:" << st; |
1221 | 174 | 174 | ||
1222 | 175 | return (st != cuc::Transfer::finalized | 175 | return (st != cuc::Transfer::finalized |
1223 | 176 | && st != cuc::Transfer::collected | 176 | && st != cuc::Transfer::collected |
1224 | @@ -179,11 +179,11 @@ | |||
1225 | 179 | 179 | ||
1226 | 180 | QDBusObjectPath cucd::Service::CreateExportToPeer(const QString& peer_id, const QString& app_id) | 180 | QDBusObjectPath cucd::Service::CreateExportToPeer(const QString& peer_id, const QString& app_id) |
1227 | 181 | { | 181 | { |
1229 | 182 | qDebug() << Q_FUNC_INFO; | 182 | TRACE() << Q_FUNC_INFO; |
1230 | 183 | QString src_id = app_id; | 183 | QString src_id = app_id; |
1231 | 184 | if (src_id.isEmpty()) | 184 | if (src_id.isEmpty()) |
1232 | 185 | { | 185 | { |
1234 | 186 | qDebug() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; | 186 | TRACE() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; |
1235 | 187 | src_id = aa_profile(this->message().service()); | 187 | src_id = aa_profile(this->message().service()); |
1236 | 188 | } | 188 | } |
1237 | 189 | return CreateTransfer(peer_id, src_id, cuc::Transfer::Export); | 189 | return CreateTransfer(peer_id, src_id, cuc::Transfer::Export); |
1238 | @@ -191,11 +191,11 @@ | |||
1239 | 191 | 191 | ||
1240 | 192 | QDBusObjectPath cucd::Service::CreateShareToPeer(const QString& peer_id, const QString& app_id) | 192 | QDBusObjectPath cucd::Service::CreateShareToPeer(const QString& peer_id, const QString& app_id) |
1241 | 193 | { | 193 | { |
1243 | 194 | qDebug() << Q_FUNC_INFO; | 194 | TRACE() << Q_FUNC_INFO; |
1244 | 195 | QString src_id = app_id; | 195 | QString src_id = app_id; |
1245 | 196 | if (src_id.isEmpty()) | 196 | if (src_id.isEmpty()) |
1246 | 197 | { | 197 | { |
1248 | 198 | qDebug() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; | 198 | TRACE() << Q_FUNC_INFO << "APP_ID isnt' set, attempting to get it from AppArmor"; |
1249 | 199 | src_id = aa_profile(this->message().service()); | 199 | src_id = aa_profile(this->message().service()); |
1250 | 200 | } | 200 | } |
1251 | 201 | return CreateTransfer(peer_id, src_id, cuc::Transfer::Share); | 201 | return CreateTransfer(peer_id, src_id, cuc::Transfer::Share); |
1252 | @@ -203,7 +203,7 @@ | |||
1253 | 203 | 203 | ||
1254 | 204 | QDBusObjectPath cucd::Service::CreateTransfer(const QString& dest_id, const QString& src_id, int dir) | 204 | QDBusObjectPath cucd::Service::CreateTransfer(const QString& dest_id, const QString& src_id, int dir) |
1255 | 205 | { | 205 | { |
1257 | 206 | qDebug() << Q_FUNC_INFO << "DEST:" << dest_id << "SRC:" << src_id << "DIRECTION:" << dir; | 206 | TRACE() << Q_FUNC_INFO << "DEST:" << dest_id << "SRC:" << src_id << "DIRECTION:" << dir; |
1258 | 207 | 207 | ||
1259 | 208 | static size_t import_counter{0}; import_counter++; | 208 | static size_t import_counter{0}; import_counter++; |
1260 | 209 | 209 | ||
1261 | @@ -213,10 +213,10 @@ | |||
1262 | 213 | { | 213 | { |
1263 | 214 | if (t->destination() == dest_id || t->source() == src_id) | 214 | if (t->destination() == dest_id || t->source() == src_id) |
1264 | 215 | { | 215 | { |
1266 | 216 | qDebug() << Q_FUNC_INFO << "Found transfer for peer_id:" << src_id; | 216 | TRACE() << Q_FUNC_INFO << "Found transfer for peer_id:" << src_id; |
1267 | 217 | if (should_cancel(t->State())) | 217 | if (should_cancel(t->State())) |
1268 | 218 | { | 218 | { |
1270 | 219 | qDebug() << Q_FUNC_INFO << "Aborting active transfer:" << t->Id(); | 219 | TRACE() << Q_FUNC_INFO << "Aborting active transfer:" << t->Id(); |
1271 | 220 | t->Abort(); | 220 | t->Abort(); |
1272 | 221 | } | 221 | } |
1273 | 222 | } | 222 | } |
1274 | @@ -229,10 +229,10 @@ | |||
1275 | 229 | auto destination = transfer->import_path(); | 229 | auto destination = transfer->import_path(); |
1276 | 230 | auto source = transfer->export_path(); | 230 | auto source = transfer->export_path(); |
1277 | 231 | if (not d->connection.registerObject(source, transfer)) | 231 | if (not d->connection.registerObject(source, transfer)) |
1279 | 232 | qDebug() << "Problem registering object for path: " << source; | 232 | TRACE() << "Problem registering object for path: " << source; |
1280 | 233 | d->connection.registerObject(destination, transfer); | 233 | d->connection.registerObject(destination, transfer); |
1281 | 234 | 234 | ||
1283 | 235 | qDebug() << "Created transfer " << source << " -> " << destination; | 235 | TRACE() << "Created transfer " << source << " -> " << destination; |
1284 | 236 | 236 | ||
1285 | 237 | // Content flow is different for import | 237 | // Content flow is different for import |
1286 | 238 | if (dir == cuc::Transfer::Import) | 238 | if (dir == cuc::Transfer::Import) |
1287 | @@ -247,13 +247,13 @@ | |||
1288 | 247 | 247 | ||
1289 | 248 | void cucd::Service::handle_imports(int state) | 248 | void cucd::Service::handle_imports(int state) |
1290 | 249 | { | 249 | { |
1292 | 250 | qDebug() << Q_FUNC_INFO << state; | 250 | TRACE() << Q_FUNC_INFO << state; |
1293 | 251 | cucd::Transfer *transfer = static_cast<cucd::Transfer*>(sender()); | 251 | cucd::Transfer *transfer = static_cast<cucd::Transfer*>(sender()); |
1295 | 252 | qDebug() << Q_FUNC_INFO << "State: " << transfer->State() << "Id:" << transfer->Id(); | 252 | TRACE() << Q_FUNC_INFO << "State: " << transfer->State() << "Id:" << transfer->Id(); |
1296 | 253 | 253 | ||
1297 | 254 | if (state == cuc::Transfer::initiated) | 254 | if (state == cuc::Transfer::initiated) |
1298 | 255 | { | 255 | { |
1300 | 256 | qDebug() << Q_FUNC_INFO << "initiated"; | 256 | TRACE() << Q_FUNC_INFO << "initiated"; |
1301 | 257 | if (d->app_manager->is_application_started(transfer->source().toStdString())) | 257 | if (d->app_manager->is_application_started(transfer->source().toStdString())) |
1302 | 258 | transfer->SetSourceStartedByContentHub(false); | 258 | transfer->SetSourceStartedByContentHub(false); |
1303 | 259 | else | 259 | else |
1304 | @@ -261,14 +261,14 @@ | |||
1305 | 261 | 261 | ||
1306 | 262 | Q_FOREACH (RegHandler *r, d->handlers) | 262 | Q_FOREACH (RegHandler *r, d->handlers) |
1307 | 263 | { | 263 | { |
1309 | 264 | qDebug() << Q_FUNC_INFO << "ID:" << r->id << "Handler: " << r->service << "Transfer: " << transfer->source(); | 264 | TRACE() << Q_FUNC_INFO << "ID:" << r->id << "Handler: " << r->service << "Transfer: " << transfer->source(); |
1310 | 265 | if (r->id == transfer->source()) | 265 | if (r->id == transfer->source()) |
1311 | 266 | { | 266 | { |
1313 | 267 | qDebug() << Q_FUNC_INFO << "Found handler for initiated transfer" << r->id; | 267 | TRACE() << Q_FUNC_INFO << "Found handler for initiated transfer" << r->id; |
1314 | 268 | if (r->handler->isValid()) | 268 | if (r->handler->isValid()) |
1315 | 269 | r->handler->HandleExport(QDBusObjectPath{transfer->export_path()}); | 269 | r->handler->HandleExport(QDBusObjectPath{transfer->export_path()}); |
1316 | 270 | else | 270 | else |
1318 | 271 | qDebug() << Q_FUNC_INFO << "Handler invalid"; | 271 | TRACE() << Q_FUNC_INFO << "Handler invalid"; |
1319 | 272 | } | 272 | } |
1320 | 273 | } | 273 | } |
1321 | 274 | 274 | ||
1322 | @@ -277,7 +277,7 @@ | |||
1323 | 277 | 277 | ||
1324 | 278 | if (state == cuc::Transfer::charged) | 278 | if (state == cuc::Transfer::charged) |
1325 | 279 | { | 279 | { |
1327 | 280 | qDebug() << Q_FUNC_INFO << "Charged"; | 280 | TRACE() << Q_FUNC_INFO << "Charged"; |
1328 | 281 | if (transfer->WasSourceStartedByContentHub()) | 281 | if (transfer->WasSourceStartedByContentHub()) |
1329 | 282 | d->app_manager->stop_application(transfer->source().toStdString()); | 282 | d->app_manager->stop_application(transfer->source().toStdString()); |
1330 | 283 | 283 | ||
1331 | @@ -285,10 +285,10 @@ | |||
1332 | 285 | 285 | ||
1333 | 286 | Q_FOREACH (RegHandler *r, d->handlers) | 286 | Q_FOREACH (RegHandler *r, d->handlers) |
1334 | 287 | { | 287 | { |
1336 | 288 | qDebug() << Q_FUNC_INFO << "ID:" << r->id << "Handler: " << r->service << "Transfer: " << transfer->destination(); | 288 | TRACE() << Q_FUNC_INFO << "ID:" << r->id << "Handler: " << r->service << "Transfer: " << transfer->destination(); |
1337 | 289 | if (r->id == transfer->destination()) | 289 | if (r->id == transfer->destination()) |
1338 | 290 | { | 290 | { |
1340 | 291 | qDebug() << Q_FUNC_INFO << "Found handler for charged transfer" << r->id; | 291 | TRACE() << Q_FUNC_INFO << "Found handler for charged transfer" << r->id; |
1341 | 292 | if (r->handler->isValid()) | 292 | if (r->handler->isValid()) |
1342 | 293 | r->handler->HandleImport(QDBusObjectPath{transfer->import_path()}); | 293 | r->handler->HandleImport(QDBusObjectPath{transfer->import_path()}); |
1343 | 294 | } | 294 | } |
1344 | @@ -304,39 +304,43 @@ | |||
1345 | 304 | { | 304 | { |
1346 | 305 | if (t->Id() != transfer->Id()) | 305 | if (t->Id() != transfer->Id()) |
1347 | 306 | { | 306 | { |
1349 | 307 | if ((t->source() == transfer->source()) || (t->destination() == transfer->destination())) | 307 | if ((t->source() == transfer->source()) && (t->State() == cuc::Transfer::in_progress)) |
1350 | 308 | { | 308 | { |
1352 | 309 | qDebug() << Q_FUNC_INFO << "Peer has pending transfers:" << t->Id(); | 309 | TRACE() << Q_FUNC_INFO << "Source has pending transfers:" << t->Id(); |
1353 | 310 | shouldStop = false; | 310 | shouldStop = false; |
1354 | 311 | } | 311 | } |
1355 | 312 | if (t->destination() == transfer->destination()) | ||
1356 | 313 | { | ||
1357 | 314 | qDebug() << Q_FUNC_INFO << "Destination has pending transfers:" << t->Id(); | ||
1358 | 315 | if (should_cancel(t->State())) | ||
1359 | 316 | shouldStop = false; | ||
1360 | 317 | } | ||
1361 | 312 | } | 318 | } |
1362 | 313 | } | 319 | } |
1363 | 314 | if (shouldStop) | 320 | if (shouldStop) |
1368 | 315 | { | 321 | d->app_manager->stop_application(transfer->source().toStdString()); |
1365 | 316 | d->app_manager->stop_application(transfer->source().toStdString()); | ||
1366 | 317 | d->app_manager->invoke_application(transfer->destination().toStdString()); | ||
1367 | 318 | } | ||
1369 | 319 | } | 322 | } |
1370 | 323 | d->app_manager->invoke_application(transfer->destination().toStdString()); | ||
1371 | 320 | } | 324 | } |
1372 | 321 | } | 325 | } |
1373 | 322 | 326 | ||
1374 | 323 | void cucd::Service::handle_exports(int state) | 327 | void cucd::Service::handle_exports(int state) |
1375 | 324 | { | 328 | { |
1377 | 325 | qDebug() << Q_FUNC_INFO; | 329 | TRACE() << Q_FUNC_INFO; |
1378 | 326 | cucd::Transfer *transfer = static_cast<cucd::Transfer*>(sender()); | 330 | cucd::Transfer *transfer = static_cast<cucd::Transfer*>(sender()); |
1379 | 327 | 331 | ||
1381 | 328 | qDebug() << Q_FUNC_INFO << "STATE:" << transfer->State(); | 332 | TRACE() << Q_FUNC_INFO << "STATE:" << transfer->State(); |
1382 | 329 | 333 | ||
1383 | 330 | 334 | ||
1384 | 331 | if (state == cuc::Transfer::initiated) | 335 | if (state == cuc::Transfer::initiated) |
1385 | 332 | { | 336 | { |
1387 | 333 | qDebug() << Q_FUNC_INFO << "Initiated"; | 337 | TRACE() << Q_FUNC_INFO << "Initiated"; |
1388 | 334 | transfer->Handled(); | 338 | transfer->Handled(); |
1389 | 335 | } | 339 | } |
1390 | 336 | 340 | ||
1391 | 337 | if (state == cuc::Transfer::charged) | 341 | if (state == cuc::Transfer::charged) |
1392 | 338 | { | 342 | { |
1394 | 339 | qDebug() << Q_FUNC_INFO << "Charged"; | 343 | TRACE() << Q_FUNC_INFO << "Charged"; |
1395 | 340 | if (d->app_manager->is_application_started(transfer->destination().toStdString())) | 344 | if (d->app_manager->is_application_started(transfer->destination().toStdString())) |
1396 | 341 | transfer->SetSourceStartedByContentHub(false); | 345 | transfer->SetSourceStartedByContentHub(false); |
1397 | 342 | else | 346 | else |
1398 | @@ -346,10 +350,10 @@ | |||
1399 | 346 | 350 | ||
1400 | 347 | Q_FOREACH (RegHandler *r, d->handlers) | 351 | Q_FOREACH (RegHandler *r, d->handlers) |
1401 | 348 | { | 352 | { |
1403 | 349 | qDebug() << "Handler: " << r->service << "Transfer: " << transfer->destination(); | 353 | TRACE() << "Handler: " << r->service << "Transfer: " << transfer->destination(); |
1404 | 350 | if (r->id == transfer->destination()) | 354 | if (r->id == transfer->destination()) |
1405 | 351 | { | 355 | { |
1407 | 352 | qDebug() << "Found handler for charged transfer" << r->id; | 356 | TRACE() << "Found handler for charged transfer" << r->id; |
1408 | 353 | if (transfer->Direction() == cuc::Transfer::Share && r->handler->isValid()) | 357 | if (transfer->Direction() == cuc::Transfer::Share && r->handler->isValid()) |
1409 | 354 | r->handler->HandleShare(QDBusObjectPath{transfer->import_path()}); | 358 | r->handler->HandleShare(QDBusObjectPath{transfer->import_path()}); |
1410 | 355 | else if (r->handler->isValid()) | 359 | else if (r->handler->isValid()) |
1411 | @@ -360,7 +364,7 @@ | |||
1412 | 360 | 364 | ||
1413 | 361 | if (state == cuc::Transfer::finalized) | 365 | if (state == cuc::Transfer::finalized) |
1414 | 362 | { | 366 | { |
1416 | 363 | qDebug() << Q_FUNC_INFO << "Finalized"; | 367 | TRACE() << Q_FUNC_INFO << "Finalized"; |
1417 | 364 | if (transfer->WasSourceStartedByContentHub()) | 368 | if (transfer->WasSourceStartedByContentHub()) |
1418 | 365 | d->app_manager->stop_application(transfer->destination().toStdString()); | 369 | d->app_manager->stop_application(transfer->destination().toStdString()); |
1419 | 366 | 370 | ||
1420 | @@ -369,7 +373,7 @@ | |||
1421 | 369 | 373 | ||
1422 | 370 | if (state == cuc::Transfer::aborted) | 374 | if (state == cuc::Transfer::aborted) |
1423 | 371 | { | 375 | { |
1425 | 372 | qDebug() << Q_FUNC_INFO << "Aborted"; | 376 | TRACE() << Q_FUNC_INFO << "Aborted"; |
1426 | 373 | if (transfer->WasSourceStartedByContentHub()) | 377 | if (transfer->WasSourceStartedByContentHub()) |
1427 | 374 | { | 378 | { |
1428 | 375 | bool shouldStop = true; | 379 | bool shouldStop = true; |
1429 | @@ -377,35 +381,39 @@ | |||
1430 | 377 | { | 381 | { |
1431 | 378 | if (t->Id() != transfer->Id()) | 382 | if (t->Id() != transfer->Id()) |
1432 | 379 | { | 383 | { |
1434 | 380 | if ((t->source() == transfer->source()) || (t->destination() == transfer->destination())) | 384 | if ((t->source() == transfer->source()) && (t->State() == cuc::Transfer::in_progress)) |
1435 | 381 | { | 385 | { |
1437 | 382 | qDebug() << Q_FUNC_INFO << "Peer has pending transfers:" << t->Id(); | 386 | TRACE() << Q_FUNC_INFO << "Source has pending transfers:" << t->Id(); |
1438 | 383 | shouldStop = false; | 387 | shouldStop = false; |
1439 | 384 | } | 388 | } |
1440 | 389 | if (t->destination() == transfer->destination()) | ||
1441 | 390 | { | ||
1442 | 391 | qDebug() << Q_FUNC_INFO << "Destination has pending transfers:" << t->Id(); | ||
1443 | 392 | if (should_cancel(t->State())) | ||
1444 | 393 | shouldStop = false; | ||
1445 | 394 | } | ||
1446 | 385 | } | 395 | } |
1447 | 386 | } | 396 | } |
1448 | 387 | if (shouldStop) | 397 | if (shouldStop) |
1449 | 388 | { | ||
1450 | 389 | d->app_manager->stop_application(transfer->destination().toStdString()); | 398 | d->app_manager->stop_application(transfer->destination().toStdString()); |
1451 | 390 | d->app_manager->invoke_application(transfer->source().toStdString()); | ||
1452 | 391 | } | ||
1453 | 392 | } | 399 | } |
1454 | 400 | d->app_manager->invoke_application(transfer->source().toStdString()); | ||
1455 | 393 | } | 401 | } |
1456 | 394 | } | 402 | } |
1457 | 395 | 403 | ||
1458 | 396 | void cucd::Service::handler_unregistered(const QString& s) | 404 | void cucd::Service::handler_unregistered(const QString& s) |
1459 | 397 | { | 405 | { |
1461 | 398 | qDebug() << Q_FUNC_INFO << s; | 406 | TRACE() << Q_FUNC_INFO << s; |
1462 | 399 | 407 | ||
1463 | 400 | if (d->handlers.isEmpty()) | 408 | if (d->handlers.isEmpty()) |
1464 | 401 | return; | 409 | return; |
1465 | 402 | 410 | ||
1466 | 403 | Q_FOREACH (RegHandler *r, d->handlers) | 411 | Q_FOREACH (RegHandler *r, d->handlers) |
1467 | 404 | { | 412 | { |
1469 | 405 | qDebug() << "Handler: " << r->id; | 413 | TRACE() << "Handler: " << r->id; |
1470 | 406 | if (r->service == s) | 414 | if (r->service == s) |
1471 | 407 | { | 415 | { |
1473 | 408 | qDebug() << "Found match for " << r->id; | 416 | TRACE() << "Found match for " << r->id; |
1474 | 409 | d->handlers.remove(r); | 417 | d->handlers.remove(r); |
1475 | 410 | m_watcher->removeWatchedService(s); | 418 | m_watcher->removeWatchedService(s); |
1476 | 411 | delete r; | 419 | delete r; |
1477 | @@ -415,15 +423,15 @@ | |||
1478 | 415 | 423 | ||
1479 | 416 | void cucd::Service::RegisterImportExportHandler(const QString& peer_id, const QDBusObjectPath& handler) | 424 | void cucd::Service::RegisterImportExportHandler(const QString& peer_id, const QDBusObjectPath& handler) |
1480 | 417 | { | 425 | { |
1482 | 418 | qDebug() << Q_FUNC_INFO << peer_id; | 426 | TRACE() << Q_FUNC_INFO << peer_id; |
1483 | 419 | bool exists = false; | 427 | bool exists = false; |
1484 | 420 | RegHandler* r; | 428 | RegHandler* r; |
1485 | 421 | Q_FOREACH (RegHandler *rh, d->handlers) | 429 | Q_FOREACH (RegHandler *rh, d->handlers) |
1486 | 422 | { | 430 | { |
1488 | 423 | qDebug() << "Handler: " << rh->id; | 431 | TRACE() << "Handler: " << rh->id; |
1489 | 424 | if (rh->id == peer_id) | 432 | if (rh->id == peer_id) |
1490 | 425 | { | 433 | { |
1492 | 426 | qDebug() << "Found existing handler for " << rh->id; | 434 | TRACE() << "Found existing handler for " << rh->id; |
1493 | 427 | exists = true; | 435 | exists = true; |
1494 | 428 | r = rh; | 436 | r = rh; |
1495 | 429 | } | 437 | } |
1496 | @@ -442,14 +450,14 @@ | |||
1497 | 442 | m_watcher->addWatchedService(r->service); | 450 | m_watcher->addWatchedService(r->service); |
1498 | 443 | } | 451 | } |
1499 | 444 | 452 | ||
1501 | 445 | qDebug() << Q_FUNC_INFO << r->id; | 453 | TRACE() << Q_FUNC_INFO << r->id; |
1502 | 446 | 454 | ||
1503 | 447 | Q_FOREACH (cucd::Transfer *t, d->active_transfers) | 455 | Q_FOREACH (cucd::Transfer *t, d->active_transfers) |
1504 | 448 | { | 456 | { |
1506 | 449 | qDebug() << Q_FUNC_INFO << "SOURCE: " << t->source() << "DEST:" << t->destination() << "STATE:" << t->State(); | 457 | TRACE() << Q_FUNC_INFO << "SOURCE: " << t->source() << "DEST:" << t->destination() << "STATE:" << t->State(); |
1507 | 450 | if ((t->source() == peer_id) && (t->State() == cuc::Transfer::initiated)) | 458 | if ((t->source() == peer_id) && (t->State() == cuc::Transfer::initiated)) |
1508 | 451 | { | 459 | { |
1510 | 452 | qDebug() << Q_FUNC_INFO << "Found source:" << peer_id << "Direction:" << t->Direction(); | 460 | TRACE() << Q_FUNC_INFO << "Found source:" << peer_id << "Direction:" << t->Direction(); |
1511 | 453 | if (t->Direction() == cuc::Transfer::Import) | 461 | if (t->Direction() == cuc::Transfer::Import) |
1512 | 454 | { | 462 | { |
1513 | 455 | if (r->handler->isValid()) | 463 | if (r->handler->isValid()) |
1514 | @@ -458,15 +466,15 @@ | |||
1515 | 458 | } | 466 | } |
1516 | 459 | else if ((t->destination() == peer_id) && (t->State() == cuc::Transfer::charged)) | 467 | else if ((t->destination() == peer_id) && (t->State() == cuc::Transfer::charged)) |
1517 | 460 | { | 468 | { |
1519 | 461 | qDebug() << Q_FUNC_INFO << "Found destination:" << peer_id << "Direction:" << t->Direction(); | 469 | TRACE() << Q_FUNC_INFO << "Found destination:" << peer_id << "Direction:" << t->Direction(); |
1520 | 462 | if (t->Direction() == cuc::Transfer::Export) | 470 | if (t->Direction() == cuc::Transfer::Export) |
1521 | 463 | { | 471 | { |
1523 | 464 | qDebug() << Q_FUNC_INFO << "Found import, calling HandleImport"; | 472 | TRACE() << Q_FUNC_INFO << "Found import, calling HandleImport"; |
1524 | 465 | if (r->handler->isValid()) | 473 | if (r->handler->isValid()) |
1525 | 466 | r->handler->HandleImport(QDBusObjectPath{t->import_path()}); | 474 | r->handler->HandleImport(QDBusObjectPath{t->import_path()}); |
1526 | 467 | } else if (t->Direction() == cuc::Transfer::Share) | 475 | } else if (t->Direction() == cuc::Transfer::Share) |
1527 | 468 | { | 476 | { |
1529 | 469 | qDebug() << Q_FUNC_INFO << "Found share, calling HandleShare"; | 477 | TRACE() << Q_FUNC_INFO << "Found share, calling HandleShare"; |
1530 | 470 | if (r->handler->isValid()) | 478 | if (r->handler->isValid()) |
1531 | 471 | r->handler->HandleShare(QDBusObjectPath{t->import_path()}); | 479 | r->handler->HandleShare(QDBusObjectPath{t->import_path()}); |
1532 | 472 | } | 480 | } |
1533 | 473 | 481 | ||
1534 | === modified file 'src/com/ubuntu/content/detail/transfer.cpp' | |||
1535 | --- src/com/ubuntu/content/detail/transfer.cpp 2014-03-21 00:29:33 +0000 | |||
1536 | +++ src/com/ubuntu/content/detail/transfer.cpp 2014-03-21 00:29:34 +0000 | |||
1537 | @@ -16,6 +16,7 @@ | |||
1538 | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> |
1539 | 17 | */ | 17 | */ |
1540 | 18 | 18 | ||
1541 | 19 | #include "debug.h" | ||
1542 | 19 | #include "transfer.h" | 20 | #include "transfer.h" |
1543 | 20 | #include "utils.cpp" | 21 | #include "utils.cpp" |
1544 | 21 | 22 | ||
1545 | @@ -23,8 +24,6 @@ | |||
1546 | 23 | #include <com/ubuntu/content/store.h> | 24 | #include <com/ubuntu/content/store.h> |
1547 | 24 | #include <com/ubuntu/content/transfer.h> | 25 | #include <com/ubuntu/content/transfer.h> |
1548 | 25 | 26 | ||
1549 | 26 | #include <QDebug> | ||
1550 | 27 | |||
1551 | 28 | namespace cuc = com::ubuntu::content; | 27 | namespace cuc = com::ubuntu::content; |
1552 | 29 | namespace cucd = com::ubuntu::content::detail; | 28 | namespace cucd = com::ubuntu::content::detail; |
1553 | 30 | 29 | ||
1554 | @@ -62,51 +61,51 @@ | |||
1555 | 62 | QObject* parent) : | 61 | QObject* parent) : |
1556 | 63 | QObject(parent), d(new Private(id, source, destination, direction)) | 62 | QObject(parent), d(new Private(id, source, destination, direction)) |
1557 | 64 | { | 63 | { |
1559 | 65 | qDebug() << __PRETTY_FUNCTION__; | 64 | TRACE() << __PRETTY_FUNCTION__; |
1560 | 66 | } | 65 | } |
1561 | 67 | 66 | ||
1562 | 68 | cucd::Transfer::~Transfer() | 67 | cucd::Transfer::~Transfer() |
1563 | 69 | { | 68 | { |
1565 | 70 | qDebug() << __PRETTY_FUNCTION__; | 69 | TRACE() << __PRETTY_FUNCTION__; |
1566 | 71 | purge_store_cache(d->store); | 70 | purge_store_cache(d->store); |
1567 | 72 | } | 71 | } |
1568 | 73 | 72 | ||
1569 | 74 | /* unique id of the transfer */ | 73 | /* unique id of the transfer */ |
1570 | 75 | int cucd::Transfer::Id() | 74 | int cucd::Transfer::Id() |
1571 | 76 | { | 75 | { |
1573 | 77 | qDebug() << __PRETTY_FUNCTION__; | 76 | TRACE() << __PRETTY_FUNCTION__; |
1574 | 78 | return d->id; | 77 | return d->id; |
1575 | 79 | } | 78 | } |
1576 | 80 | 79 | ||
1577 | 81 | /* returns the peer_id of the requested export handler */ | 80 | /* returns the peer_id of the requested export handler */ |
1578 | 82 | QString cucd::Transfer::source() | 81 | QString cucd::Transfer::source() |
1579 | 83 | { | 82 | { |
1581 | 84 | qDebug() << __PRETTY_FUNCTION__; | 83 | TRACE() << __PRETTY_FUNCTION__; |
1582 | 85 | return d->source; | 84 | return d->source; |
1583 | 86 | } | 85 | } |
1584 | 87 | 86 | ||
1585 | 88 | /* returns the peer_id of the application requesting the import */ | 87 | /* returns the peer_id of the application requesting the import */ |
1586 | 89 | QString cucd::Transfer::destination() | 88 | QString cucd::Transfer::destination() |
1587 | 90 | { | 89 | { |
1589 | 91 | qDebug() << __PRETTY_FUNCTION__; | 90 | TRACE() << __PRETTY_FUNCTION__; |
1590 | 92 | return d->destination; | 91 | return d->destination; |
1591 | 93 | } | 92 | } |
1592 | 94 | 93 | ||
1593 | 95 | int cucd::Transfer::Direction() | 94 | int cucd::Transfer::Direction() |
1594 | 96 | { | 95 | { |
1596 | 97 | qDebug() << __PRETTY_FUNCTION__; | 96 | TRACE() << __PRETTY_FUNCTION__; |
1597 | 98 | return d->direction; | 97 | return d->direction; |
1598 | 99 | } | 98 | } |
1599 | 100 | 99 | ||
1600 | 101 | int cucd::Transfer::State() | 100 | int cucd::Transfer::State() |
1601 | 102 | { | 101 | { |
1603 | 103 | qDebug() << __PRETTY_FUNCTION__; | 102 | TRACE() << __PRETTY_FUNCTION__; |
1604 | 104 | return d->state; | 103 | return d->state; |
1605 | 105 | } | 104 | } |
1606 | 106 | 105 | ||
1607 | 107 | void cucd::Transfer::Abort() | 106 | void cucd::Transfer::Abort() |
1608 | 108 | { | 107 | { |
1610 | 109 | qDebug() << __PRETTY_FUNCTION__; | 108 | TRACE() << __PRETTY_FUNCTION__; |
1611 | 110 | 109 | ||
1612 | 111 | if (d->state == cuc::Transfer::aborted) | 110 | if (d->state == cuc::Transfer::aborted) |
1613 | 112 | return; | 111 | return; |
1614 | @@ -119,7 +118,7 @@ | |||
1615 | 119 | 118 | ||
1616 | 120 | void cucd::Transfer::Start() | 119 | void cucd::Transfer::Start() |
1617 | 121 | { | 120 | { |
1619 | 122 | qDebug() << __PRETTY_FUNCTION__; | 121 | TRACE() << __PRETTY_FUNCTION__; |
1620 | 123 | 122 | ||
1621 | 124 | if (d->state == cuc::Transfer::initiated) | 123 | if (d->state == cuc::Transfer::initiated) |
1622 | 125 | return; | 124 | return; |
1623 | @@ -130,7 +129,7 @@ | |||
1624 | 130 | 129 | ||
1625 | 131 | void cucd::Transfer::Handled() | 130 | void cucd::Transfer::Handled() |
1626 | 132 | { | 131 | { |
1628 | 133 | qDebug() << __PRETTY_FUNCTION__; | 132 | TRACE() << __PRETTY_FUNCTION__; |
1629 | 134 | 133 | ||
1630 | 135 | if (d->state == cuc::Transfer::in_progress) | 134 | if (d->state == cuc::Transfer::in_progress) |
1631 | 136 | return; | 135 | return; |
1632 | @@ -141,7 +140,7 @@ | |||
1633 | 141 | 140 | ||
1634 | 142 | void cucd::Transfer::Charge(const QStringList& items) | 141 | void cucd::Transfer::Charge(const QStringList& items) |
1635 | 143 | { | 142 | { |
1637 | 144 | qDebug() << __PRETTY_FUNCTION__; | 143 | TRACE() << __PRETTY_FUNCTION__; |
1638 | 145 | 144 | ||
1639 | 146 | if (d->state == cuc::Transfer::charged) | 145 | if (d->state == cuc::Transfer::charged) |
1640 | 147 | return; | 146 | return; |
1641 | @@ -151,7 +150,7 @@ | |||
1642 | 151 | ret.append(copy_to_store(i, d->store)); | 150 | ret.append(copy_to_store(i, d->store)); |
1643 | 152 | 151 | ||
1644 | 153 | Q_FOREACH(QString f, ret) | 152 | Q_FOREACH(QString f, ret) |
1646 | 154 | qDebug() << Q_FUNC_INFO << "Item:" << f; | 153 | TRACE() << Q_FUNC_INFO << "Item:" << f; |
1647 | 155 | 154 | ||
1648 | 156 | if (ret.count() <= 0) | 155 | if (ret.count() <= 0) |
1649 | 157 | { | 156 | { |
1650 | @@ -168,7 +167,7 @@ | |||
1651 | 168 | 167 | ||
1652 | 169 | QStringList cucd::Transfer::Collect() | 168 | QStringList cucd::Transfer::Collect() |
1653 | 170 | { | 169 | { |
1655 | 171 | qDebug() << __PRETTY_FUNCTION__; | 170 | TRACE() << __PRETTY_FUNCTION__; |
1656 | 172 | 171 | ||
1657 | 173 | if (d->state != cuc::Transfer::collected) | 172 | if (d->state != cuc::Transfer::collected) |
1658 | 174 | { | 173 | { |
1659 | @@ -181,7 +180,7 @@ | |||
1660 | 181 | 180 | ||
1661 | 182 | void cucd::Transfer::Finalize() | 181 | void cucd::Transfer::Finalize() |
1662 | 183 | { | 182 | { |
1664 | 184 | qDebug() << __PRETTY_FUNCTION__; | 183 | TRACE() << __PRETTY_FUNCTION__; |
1665 | 185 | 184 | ||
1666 | 186 | if (d->state == cuc::Transfer::finalized) | 185 | if (d->state == cuc::Transfer::finalized) |
1667 | 187 | return; | 186 | return; |
1668 | @@ -194,13 +193,13 @@ | |||
1669 | 194 | 193 | ||
1670 | 195 | QString cucd::Transfer::Store() | 194 | QString cucd::Transfer::Store() |
1671 | 196 | { | 195 | { |
1673 | 197 | qDebug() << __PRETTY_FUNCTION__; | 196 | TRACE() << __PRETTY_FUNCTION__; |
1674 | 198 | return d->store; | 197 | return d->store; |
1675 | 199 | } | 198 | } |
1676 | 200 | 199 | ||
1677 | 201 | void cucd::Transfer::SetStore(QString uri) | 200 | void cucd::Transfer::SetStore(QString uri) |
1678 | 202 | { | 201 | { |
1680 | 203 | qDebug() << Q_FUNC_INFO; | 202 | TRACE() << Q_FUNC_INFO; |
1681 | 204 | 203 | ||
1682 | 205 | if (d->store == uri) | 204 | if (d->store == uri) |
1683 | 206 | return; | 205 | return; |
1684 | @@ -211,13 +210,13 @@ | |||
1685 | 211 | 210 | ||
1686 | 212 | int cucd::Transfer::SelectionType() | 211 | int cucd::Transfer::SelectionType() |
1687 | 213 | { | 212 | { |
1689 | 214 | qDebug() << __PRETTY_FUNCTION__; | 213 | TRACE() << __PRETTY_FUNCTION__; |
1690 | 215 | return d->selection_type; | 214 | return d->selection_type; |
1691 | 216 | } | 215 | } |
1692 | 217 | 216 | ||
1693 | 218 | void cucd::Transfer::SetSelectionType(int type) | 217 | void cucd::Transfer::SetSelectionType(int type) |
1694 | 219 | { | 218 | { |
1696 | 220 | qDebug() << Q_FUNC_INFO; | 219 | TRACE() << Q_FUNC_INFO; |
1697 | 221 | if (d->state != cuc::Transfer::created) | 220 | if (d->state != cuc::Transfer::created) |
1698 | 222 | return; | 221 | return; |
1699 | 223 | if (d->selection_type == type) | 222 | if (d->selection_type == type) |
1700 | @@ -230,7 +229,7 @@ | |||
1701 | 230 | /* returns the object path for the export */ | 229 | /* returns the object path for the export */ |
1702 | 231 | QString cucd::Transfer::export_path() | 230 | QString cucd::Transfer::export_path() |
1703 | 232 | { | 231 | { |
1705 | 233 | qDebug() << Q_FUNC_INFO << "source:" << d->source; | 232 | TRACE() << Q_FUNC_INFO << "source:" << d->source; |
1706 | 234 | static const QString exporter_path_pattern{"/transfers/%1/export/%2"}; | 233 | static const QString exporter_path_pattern{"/transfers/%1/export/%2"}; |
1707 | 235 | QString source = exporter_path_pattern | 234 | QString source = exporter_path_pattern |
1708 | 236 | .arg(sanitize_id(d->source)) | 235 | .arg(sanitize_id(d->source)) |
1709 | @@ -241,7 +240,7 @@ | |||
1710 | 241 | /* returns the object path for the import */ | 240 | /* returns the object path for the import */ |
1711 | 242 | QString cucd::Transfer::import_path() | 241 | QString cucd::Transfer::import_path() |
1712 | 243 | { | 242 | { |
1714 | 244 | qDebug() << Q_FUNC_INFO << "destination:" << d->destination; | 243 | TRACE() << Q_FUNC_INFO << "destination:" << d->destination; |
1715 | 245 | static const QString importer_path_pattern{"/transfers/%1/import/%2"}; | 244 | static const QString importer_path_pattern{"/transfers/%1/import/%2"}; |
1716 | 246 | QString destination = importer_path_pattern | 245 | QString destination = importer_path_pattern |
1717 | 247 | .arg(sanitize_id(d->destination)) | 246 | .arg(sanitize_id(d->destination)) |
1718 | 248 | 247 | ||
1719 | === modified file 'src/com/ubuntu/content/hub.cpp' | |||
1720 | --- src/com/ubuntu/content/hub.cpp 2014-03-21 00:29:33 +0000 | |||
1721 | +++ src/com/ubuntu/content/hub.cpp 2014-03-21 00:29:34 +0000 | |||
1722 | @@ -17,6 +17,7 @@ | |||
1723 | 17 | */ | 17 | */ |
1724 | 18 | 18 | ||
1725 | 19 | #include "common.h" | 19 | #include "common.h" |
1726 | 20 | #include "debug.h" | ||
1727 | 20 | #include "ContentServiceInterface.h" | 21 | #include "ContentServiceInterface.h" |
1728 | 21 | #include "ContentHandlerInterface.h" | 22 | #include "ContentHandlerInterface.h" |
1729 | 22 | #include "handleradaptor.h" | 23 | #include "handleradaptor.h" |
1730 | @@ -31,6 +32,7 @@ | |||
1731 | 31 | #include <com/ubuntu/content/type.h> | 32 | #include <com/ubuntu/content/type.h> |
1732 | 32 | 33 | ||
1733 | 33 | #include <QStandardPaths> | 34 | #include <QStandardPaths> |
1734 | 35 | #include <QProcessEnvironment> | ||
1735 | 34 | #include <map> | 36 | #include <map> |
1736 | 35 | 37 | ||
1737 | 36 | namespace cuc = com::ubuntu::content; | 38 | namespace cuc = com::ubuntu::content; |
1738 | @@ -51,6 +53,15 @@ | |||
1739 | 51 | 53 | ||
1740 | 52 | cuc::Hub::Hub(QObject* parent) : QObject(parent), d{new cuc::Hub::Private{this}} | 54 | cuc::Hub::Hub(QObject* parent) : QObject(parent), d{new cuc::Hub::Private{this}} |
1741 | 53 | { | 55 | { |
1742 | 56 | /* read environment variables */ | ||
1743 | 57 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | ||
1744 | 58 | if (environment.contains(QLatin1String("CONTENT_HUB_LOGGING_LEVEL"))) { | ||
1745 | 59 | bool isOk; | ||
1746 | 60 | int value = environment.value( | ||
1747 | 61 | QLatin1String("CONTENT_HUB_LOGGING_LEVEL")).toInt(&isOk); | ||
1748 | 62 | if (isOk) | ||
1749 | 63 | setLoggingLevel(value); | ||
1750 | 64 | } | ||
1751 | 54 | } | 65 | } |
1752 | 55 | 66 | ||
1753 | 56 | cuc::Hub::~Hub() | 67 | cuc::Hub::~Hub() |
1754 | @@ -65,7 +76,7 @@ | |||
1755 | 65 | 76 | ||
1756 | 66 | void cuc::Hub::register_import_export_handler(cuc::ImportExportHandler* handler) | 77 | void cuc::Hub::register_import_export_handler(cuc::ImportExportHandler* handler) |
1757 | 67 | { | 78 | { |
1759 | 68 | qDebug() << Q_FUNC_INFO; | 79 | TRACE() << Q_FUNC_INFO; |
1760 | 69 | QString id = app_id(); | 80 | QString id = app_id(); |
1761 | 70 | 81 | ||
1762 | 71 | if (id.isEmpty()) | 82 | if (id.isEmpty()) |
1763 | @@ -116,7 +127,7 @@ | |||
1764 | 116 | 127 | ||
1765 | 117 | cuc::Peer cuc::Hub::default_source_for_type(cuc::Type t) | 128 | cuc::Peer cuc::Hub::default_source_for_type(cuc::Type t) |
1766 | 118 | { | 129 | { |
1768 | 119 | qDebug() << Q_FUNC_INFO; | 130 | TRACE() << Q_FUNC_INFO; |
1769 | 120 | auto reply = d->service->DefaultSourceForType(t.id()); | 131 | auto reply = d->service->DefaultSourceForType(t.id()); |
1770 | 121 | reply.waitForFinished(); | 132 | reply.waitForFinished(); |
1771 | 122 | 133 | ||
1772 | @@ -215,9 +226,9 @@ | |||
1773 | 215 | cuc::Transfer *transfer = cuc::Transfer::Private::make_transfer(reply.value(), this); | 226 | cuc::Transfer *transfer = cuc::Transfer::Private::make_transfer(reply.value(), this); |
1774 | 216 | 227 | ||
1775 | 217 | QString peerName = peer.id().split("_")[0]; | 228 | QString peerName = peer.id().split("_")[0]; |
1777 | 218 | qDebug() << Q_FUNC_INFO << "peerName: " << peerName; | 229 | TRACE() << Q_FUNC_INFO << "peerName: " << peerName; |
1778 | 219 | const cuc::Store *store = new cuc::Store{QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/" + peerName + "/HubIncoming/" + QString::number(transfer->id()), this}; | 230 | const cuc::Store *store = new cuc::Store{QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/" + peerName + "/HubIncoming/" + QString::number(transfer->id()), this}; |
1780 | 220 | qDebug() << Q_FUNC_INFO << "STORE:" << store->uri(); | 231 | TRACE() << Q_FUNC_INFO << "STORE:" << store->uri(); |
1781 | 221 | transfer->setStore(store); | 232 | transfer->setStore(store); |
1782 | 222 | transfer->start(); | 233 | transfer->start(); |
1783 | 223 | return transfer; | 234 | return transfer; |
1784 | @@ -236,9 +247,9 @@ | |||
1785 | 236 | 247 | ||
1786 | 237 | cuc::Transfer *transfer = cuc::Transfer::Private::make_transfer(reply.value(), this); | 248 | cuc::Transfer *transfer = cuc::Transfer::Private::make_transfer(reply.value(), this); |
1787 | 238 | QString peerName = peer.id().split("_")[0]; | 249 | QString peerName = peer.id().split("_")[0]; |
1789 | 239 | qDebug() << Q_FUNC_INFO << "peerName: " << peerName; | 250 | TRACE() << Q_FUNC_INFO << "peerName: " << peerName; |
1790 | 240 | const cuc::Store *store = new cuc::Store{QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/" + peerName + "/HubIncoming/" + QString::number(transfer->id()), this}; | 251 | const cuc::Store *store = new cuc::Store{QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/" + peerName + "/HubIncoming/" + QString::number(transfer->id()), this}; |
1792 | 241 | qDebug() << Q_FUNC_INFO << "STORE:" << store->uri(); | 252 | TRACE() << Q_FUNC_INFO << "STORE:" << store->uri(); |
1793 | 242 | transfer->setStore(store); | 253 | transfer->setStore(store); |
1794 | 243 | transfer->start(); | 254 | transfer->start(); |
1795 | 244 | return transfer; | 255 | return transfer; |
1796 | 245 | 256 | ||
1797 | === modified file 'src/com/ubuntu/content/peer.cpp' | |||
1798 | --- src/com/ubuntu/content/peer.cpp 2014-03-21 00:29:33 +0000 | |||
1799 | +++ src/com/ubuntu/content/peer.cpp 2014-03-21 00:29:34 +0000 | |||
1800 | @@ -16,10 +16,10 @@ | |||
1801 | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> |
1802 | 17 | */ | 17 | */ |
1803 | 18 | 18 | ||
1804 | 19 | |||
1805 | 20 | #include <gio/gdesktopappinfo.h> | 19 | #include <gio/gdesktopappinfo.h> |
1806 | 21 | #include <com/ubuntu/content/peer.h> | 20 | #include <com/ubuntu/content/peer.h> |
1807 | 22 | #include <QMetaType> | 21 | #include <QMetaType> |
1808 | 22 | #include "debug.h" | ||
1809 | 23 | 23 | ||
1810 | 24 | namespace cuc = com::ubuntu::content; | 24 | namespace cuc = com::ubuntu::content; |
1811 | 25 | 25 | ||
1812 | @@ -27,7 +27,7 @@ | |||
1813 | 27 | { | 27 | { |
1814 | 28 | Private (QString id, bool isDefaultPeer) : id(id), isDefaultPeer(isDefaultPeer) | 28 | Private (QString id, bool isDefaultPeer) : id(id), isDefaultPeer(isDefaultPeer) |
1815 | 29 | { | 29 | { |
1817 | 30 | qDebug() << Q_FUNC_INFO << id; | 30 | TRACE() << Q_FUNC_INFO << id; |
1818 | 31 | if (name.isEmpty()) | 31 | if (name.isEmpty()) |
1819 | 32 | { | 32 | { |
1820 | 33 | QString desktop_id(id + ".desktop"); | 33 | QString desktop_id(id + ".desktop"); |
1821 | @@ -69,7 +69,7 @@ | |||
1822 | 69 | 69 | ||
1823 | 70 | cuc::Peer::Peer(const QString& id, bool isDefaultPeer, QObject* parent) : QObject(parent), d(new cuc::Peer::Private{id, isDefaultPeer}) | 70 | cuc::Peer::Peer(const QString& id, bool isDefaultPeer, QObject* parent) : QObject(parent), d(new cuc::Peer::Private{id, isDefaultPeer}) |
1824 | 71 | { | 71 | { |
1826 | 72 | qDebug() << Q_FUNC_INFO; | 72 | TRACE() << Q_FUNC_INFO; |
1827 | 73 | } | 73 | } |
1828 | 74 | 74 | ||
1829 | 75 | cuc::Peer::Peer(const cuc::Peer& rhs) : QObject(rhs.parent()), d(rhs.d) | 75 | cuc::Peer::Peer(const cuc::Peer& rhs) : QObject(rhs.parent()), d(rhs.d) |
1830 | @@ -147,7 +147,7 @@ | |||
1831 | 147 | 147 | ||
1832 | 148 | const QDBusArgument &operator>>(const QDBusArgument &argument, cuc::Peer &peer) | 148 | const QDBusArgument &operator>>(const QDBusArgument &argument, cuc::Peer &peer) |
1833 | 149 | { | 149 | { |
1835 | 150 | qDebug() << Q_FUNC_INFO; | 150 | TRACE() << Q_FUNC_INFO; |
1836 | 151 | QString id; | 151 | QString id; |
1837 | 152 | QString name; | 152 | QString name; |
1838 | 153 | QByteArray ic; | 153 | QByteArray ic; |
1839 | 154 | 154 | ||
1840 | === modified file 'src/com/ubuntu/content/service/CMakeLists.txt' | |||
1841 | --- src/com/ubuntu/content/service/CMakeLists.txt 2014-03-21 00:29:33 +0000 | |||
1842 | +++ src/com/ubuntu/content/service/CMakeLists.txt 2014-03-21 00:29:34 +0000 | |||
1843 | @@ -32,6 +32,7 @@ | |||
1844 | 32 | 32 | ||
1845 | 33 | main.cpp | 33 | main.cpp |
1846 | 34 | registry.cpp | 34 | registry.cpp |
1847 | 35 | ../debug.cpp | ||
1848 | 35 | ${CONTENT_SERVICE_SKELETON} | 36 | ${CONTENT_SERVICE_SKELETON} |
1849 | 36 | ) | 37 | ) |
1850 | 37 | 38 | ||
1851 | 38 | 39 | ||
1852 | === modified file 'src/com/ubuntu/content/service/helper.cpp' | |||
1853 | --- src/com/ubuntu/content/service/helper.cpp 2014-03-21 00:29:33 +0000 | |||
1854 | +++ src/com/ubuntu/content/service/helper.cpp 2014-03-21 00:29:34 +0000 | |||
1855 | @@ -19,6 +19,7 @@ | |||
1856 | 19 | #include <QCoreApplication> | 19 | #include <QCoreApplication> |
1857 | 20 | 20 | ||
1858 | 21 | #include "hook.h" | 21 | #include "hook.h" |
1859 | 22 | #include "debug.h" | ||
1860 | 22 | 23 | ||
1861 | 23 | namespace cuc = com::ubuntu::content; | 24 | namespace cuc = com::ubuntu::content; |
1862 | 24 | 25 | ||
1863 | @@ -26,7 +27,7 @@ | |||
1864 | 26 | { | 27 | { |
1865 | 27 | QCoreApplication app(argc, argv); | 28 | QCoreApplication app(argc, argv); |
1866 | 28 | 29 | ||
1868 | 29 | qDebug() << Q_FUNC_INFO; | 30 | TRACE() << Q_FUNC_INFO; |
1869 | 30 | 31 | ||
1870 | 31 | if (app.arguments().count() > 1) | 32 | if (app.arguments().count() > 1) |
1871 | 32 | { | 33 | { |
1872 | @@ -34,6 +35,16 @@ | |||
1873 | 34 | return 1; | 35 | return 1; |
1874 | 35 | } | 36 | } |
1875 | 36 | 37 | ||
1876 | 38 | /* read environment variables */ | ||
1877 | 39 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | ||
1878 | 40 | if (environment.contains(QLatin1String("CONTENT_HUB_LOGGING_LEVEL"))) { | ||
1879 | 41 | bool isOk; | ||
1880 | 42 | int value = environment.value( | ||
1881 | 43 | QLatin1String("CONTENT_HUB_LOGGING_LEVEL")).toInt(&isOk); | ||
1882 | 44 | if (isOk) | ||
1883 | 45 | setLoggingLevel(value); | ||
1884 | 46 | } | ||
1885 | 47 | |||
1886 | 37 | new cuc::detail::Hook(); | 48 | new cuc::detail::Hook(); |
1887 | 38 | 49 | ||
1888 | 39 | app.exec(); | 50 | app.exec(); |
1889 | 40 | 51 | ||
1890 | === modified file 'src/com/ubuntu/content/service/hook.cpp' | |||
1891 | --- src/com/ubuntu/content/service/hook.cpp 2014-03-21 00:29:33 +0000 | |||
1892 | +++ src/com/ubuntu/content/service/hook.cpp 2014-03-21 00:29:34 +0000 | |||
1893 | @@ -22,10 +22,10 @@ | |||
1894 | 22 | #include <QFile> | 22 | #include <QFile> |
1895 | 23 | #include <QDir> | 23 | #include <QDir> |
1896 | 24 | #include <QStandardPaths> | 24 | #include <QStandardPaths> |
1897 | 25 | #include <QDebug> | ||
1898 | 26 | #include <QTimer> | 25 | #include <QTimer> |
1899 | 27 | #include <com/ubuntu/content/peer.h> | 26 | #include <com/ubuntu/content/peer.h> |
1900 | 28 | 27 | ||
1901 | 28 | #include "debug.h" | ||
1902 | 29 | #include "hook.h" | 29 | #include "hook.h" |
1903 | 30 | 30 | ||
1904 | 31 | namespace cucd = com::ubuntu::content::detail; | 31 | namespace cucd = com::ubuntu::content::detail; |
1905 | @@ -45,7 +45,7 @@ | |||
1906 | 45 | 45 | ||
1907 | 46 | void cucd::Hook::run() | 46 | void cucd::Hook::run() |
1908 | 47 | { | 47 | { |
1910 | 48 | qDebug() << Q_FUNC_INFO; | 48 | TRACE() << Q_FUNC_INFO; |
1911 | 49 | /* Looks for files in ${HOME}/.local/share/content-hub/${id} installed | 49 | /* Looks for files in ${HOME}/.local/share/content-hub/${id} installed |
1912 | 50 | * by click packages. These files are JSON, for example: | 50 | * by click packages. These files are JSON, for example: |
1913 | 51 | * | 51 | * |
1914 | @@ -76,7 +76,7 @@ | |||
1915 | 76 | 76 | ||
1916 | 77 | Q_FOREACH(QString p, all_peers) | 77 | Q_FOREACH(QString p, all_peers) |
1917 | 78 | { | 78 | { |
1919 | 79 | qDebug() << Q_FUNC_INFO << "Looking for" << p; | 79 | TRACE() << Q_FUNC_INFO << "Looking for" << p; |
1920 | 80 | QStringList pp = contentDir.entryList(QStringList("*"+ p)); | 80 | QStringList pp = contentDir.entryList(QStringList("*"+ p)); |
1921 | 81 | if (pp.isEmpty()) | 81 | if (pp.isEmpty()) |
1922 | 82 | registry->remove_peer(com::ubuntu::content::Peer{p}); | 82 | registry->remove_peer(com::ubuntu::content::Peer{p}); |
1923 | @@ -90,7 +90,7 @@ | |||
1924 | 90 | 90 | ||
1925 | 91 | bool cucd::Hook::add_peer(QFileInfo result) | 91 | bool cucd::Hook::add_peer(QFileInfo result) |
1926 | 92 | { | 92 | { |
1928 | 93 | qDebug() << Q_FUNC_INFO << "Hook:" << result.filePath(); | 93 | TRACE() << Q_FUNC_INFO << "Hook:" << result.filePath(); |
1929 | 94 | 94 | ||
1930 | 95 | QStringList knownTypes; | 95 | QStringList knownTypes; |
1931 | 96 | knownTypes << "pictures" << "music" << "contacts" << "documents"; | 96 | knownTypes << "pictures" << "music" << "contacts" << "documents"; |
1932 | @@ -117,7 +117,7 @@ | |||
1933 | 117 | if (knownTypes.contains(k)) | 117 | if (knownTypes.contains(k)) |
1934 | 118 | { | 118 | { |
1935 | 119 | if (registry->install_source_for_type(cuc::Type{k}, peer)) | 119 | if (registry->install_source_for_type(cuc::Type{k}, peer)) |
1937 | 120 | qDebug() << "Installed source:" << peer.id() << "for type:" << k; | 120 | TRACE() << "Installed source:" << peer.id() << "for type:" << k; |
1938 | 121 | } | 121 | } |
1939 | 122 | else | 122 | else |
1940 | 123 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; | 123 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; |
1941 | @@ -129,7 +129,7 @@ | |||
1942 | 129 | if (knownTypes.contains(k)) | 129 | if (knownTypes.contains(k)) |
1943 | 130 | { | 130 | { |
1944 | 131 | if (registry->install_destination_for_type(cuc::Type{k}, peer)) | 131 | if (registry->install_destination_for_type(cuc::Type{k}, peer)) |
1946 | 132 | qDebug() << "Installed destination:" << peer.id() << "for type:" << k; | 132 | TRACE() << "Installed destination:" << peer.id() << "for type:" << k; |
1947 | 133 | } | 133 | } |
1948 | 134 | else | 134 | else |
1949 | 135 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; | 135 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; |
1950 | @@ -141,7 +141,7 @@ | |||
1951 | 141 | if (knownTypes.contains(k)) | 141 | if (knownTypes.contains(k)) |
1952 | 142 | { | 142 | { |
1953 | 143 | if (registry->install_share_for_type(cuc::Type{k}, peer)) | 143 | if (registry->install_share_for_type(cuc::Type{k}, peer)) |
1955 | 144 | qDebug() << "Installed share:" << peer.id() << "for type:" << k; | 144 | TRACE() << "Installed share:" << peer.id() << "for type:" << k; |
1956 | 145 | } | 145 | } |
1957 | 146 | else | 146 | else |
1958 | 147 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; | 147 | qWarning() << "Failed to install" << peer.id() << "unknown type:" << k; |
1959 | 148 | 148 | ||
1960 | === modified file 'src/com/ubuntu/content/service/main.cpp' | |||
1961 | --- src/com/ubuntu/content/service/main.cpp 2014-03-21 00:29:33 +0000 | |||
1962 | +++ src/com/ubuntu/content/service/main.cpp 2014-03-21 00:29:34 +0000 | |||
1963 | @@ -17,10 +17,11 @@ | |||
1964 | 17 | */ | 17 | */ |
1965 | 18 | 18 | ||
1966 | 19 | #include <QCoreApplication> | 19 | #include <QCoreApplication> |
1968 | 20 | #include <QDebug> | 20 | #include <QProcessEnvironment> |
1969 | 21 | #include <csignal> | 21 | #include <csignal> |
1970 | 22 | 22 | ||
1971 | 23 | #include "detail/app_manager.h" | 23 | #include "detail/app_manager.h" |
1972 | 24 | #include "debug.h" | ||
1973 | 24 | #include "common.h" | 25 | #include "common.h" |
1974 | 25 | #include "registry.h" | 26 | #include "registry.h" |
1975 | 26 | #include "detail/service.h" | 27 | #include "detail/service.h" |
1976 | @@ -44,13 +45,13 @@ | |||
1977 | 44 | }); | 45 | }); |
1978 | 45 | 46 | ||
1979 | 46 | foreach (QString r, result) { | 47 | foreach (QString r, result) { |
1981 | 47 | qDebug() << "PEER: " << r; | 48 | TRACE() << "PEER: " << r; |
1982 | 48 | } | 49 | } |
1983 | 49 | } | 50 | } |
1984 | 50 | 51 | ||
1985 | 51 | void shutdown(int sig) | 52 | void shutdown(int sig) |
1986 | 52 | { | 53 | { |
1988 | 53 | qDebug() << Q_FUNC_INFO << sig; | 54 | TRACE() << Q_FUNC_INFO << sig; |
1989 | 54 | QCoreApplication::instance()->quit(); | 55 | QCoreApplication::instance()->quit(); |
1990 | 55 | } | 56 | } |
1991 | 56 | } | 57 | } |
1992 | @@ -60,6 +61,16 @@ | |||
1993 | 60 | int ret = 0; | 61 | int ret = 0; |
1994 | 61 | QCoreApplication *app = new QCoreApplication(argc, argv); | 62 | QCoreApplication *app = new QCoreApplication(argc, argv); |
1995 | 62 | 63 | ||
1996 | 64 | /* read environment variables */ | ||
1997 | 65 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | ||
1998 | 66 | if (environment.contains(QLatin1String("CONTENT_HUB_LOGGING_LEVEL"))) { | ||
1999 | 67 | bool isOk; | ||
2000 | 68 | int value = environment.value( | ||
2001 | 69 | QLatin1String("CONTENT_HUB_LOGGING_LEVEL")).toInt(&isOk); | ||
2002 | 70 | if (isOk) | ||
2003 | 71 | setLoggingLevel(value); | ||
2004 | 72 | } | ||
2005 | 73 | |||
2006 | 63 | auto connection = QDBusConnection::sessionBus(); | 74 | auto connection = QDBusConnection::sessionBus(); |
2007 | 64 | 75 | ||
2008 | 65 | auto registry = QSharedPointer<cucd::PeerRegistry>(new Registry()); | 76 | auto registry = QSharedPointer<cucd::PeerRegistry>(new Registry()); |
2009 | @@ -96,7 +107,7 @@ | |||
2010 | 96 | ret = app->exec(); | 107 | ret = app->exec(); |
2011 | 97 | } | 108 | } |
2012 | 98 | 109 | ||
2014 | 99 | qDebug() << "Server exiting, cleaning up"; | 110 | TRACE() << "Server exiting, cleaning up"; |
2015 | 100 | delete server; | 111 | delete server; |
2016 | 101 | return ret; | 112 | return ret; |
2017 | 102 | } | 113 | } |
2018 | 103 | 114 | ||
2019 | === modified file 'src/com/ubuntu/content/service/registry.cpp' | |||
2020 | --- src/com/ubuntu/content/service/registry.cpp 2014-03-21 00:29:33 +0000 | |||
2021 | +++ src/com/ubuntu/content/service/registry.cpp 2014-03-21 00:29:34 +0000 | |||
2022 | @@ -16,6 +16,7 @@ | |||
2023 | 16 | * Authored by: Ken VanDine <ken.vandine@canonical.com> | 16 | * Authored by: Ken VanDine <ken.vandine@canonical.com> |
2024 | 17 | */ | 17 | */ |
2025 | 18 | 18 | ||
2026 | 19 | #include "debug.h" | ||
2027 | 19 | #include "registry.h" | 20 | #include "registry.h" |
2028 | 20 | #include "utils.cpp" | 21 | #include "utils.cpp" |
2029 | 21 | #include <upstart-app-launch.h> | 22 | #include <upstart-app-launch.h> |
2030 | @@ -54,7 +55,7 @@ | |||
2031 | 54 | 55 | ||
2032 | 55 | cuc::Peer Registry::default_source_for_type(cuc::Type type) | 56 | cuc::Peer Registry::default_source_for_type(cuc::Type type) |
2033 | 56 | { | 57 | { |
2035 | 57 | qDebug() << Q_FUNC_INFO << type.id(); | 58 | TRACE() << Q_FUNC_INFO << type.id(); |
2036 | 58 | if (m_defaultSources->keys().contains(type.id())) | 59 | if (m_defaultSources->keys().contains(type.id())) |
2037 | 59 | { | 60 | { |
2038 | 60 | QStringList as(m_defaultSources->get(type.id()).toStringList()); | 61 | QStringList as(m_defaultSources->get(type.id()).toStringList()); |
2039 | @@ -72,32 +73,32 @@ | |||
2040 | 72 | 73 | ||
2041 | 73 | void Registry::enumerate_known_peers(const std::function<void(const cuc::Peer&)>&for_each) | 74 | void Registry::enumerate_known_peers(const std::function<void(const cuc::Peer&)>&for_each) |
2042 | 74 | { | 75 | { |
2044 | 75 | qDebug() << Q_FUNC_INFO; | 76 | TRACE() << Q_FUNC_INFO; |
2045 | 76 | 77 | ||
2046 | 77 | Q_FOREACH (QString type_id, m_sources->keys()) | 78 | Q_FOREACH (QString type_id, m_sources->keys()) |
2047 | 78 | { | 79 | { |
2049 | 79 | qDebug() << Q_FUNC_INFO << type_id; | 80 | TRACE() << Q_FUNC_INFO << type_id; |
2050 | 80 | Q_FOREACH (QString k, m_sources->get(type_id).toStringList()) | 81 | Q_FOREACH (QString k, m_sources->get(type_id).toStringList()) |
2051 | 81 | { | 82 | { |
2053 | 82 | qDebug() << Q_FUNC_INFO << k; | 83 | TRACE() << Q_FUNC_INFO << k; |
2054 | 83 | for_each(cuc::Peer{k}); | 84 | for_each(cuc::Peer{k}); |
2055 | 84 | } | 85 | } |
2056 | 85 | } | 86 | } |
2057 | 86 | Q_FOREACH (QString type_id, m_dests->keys()) | 87 | Q_FOREACH (QString type_id, m_dests->keys()) |
2058 | 87 | { | 88 | { |
2060 | 88 | qDebug() << Q_FUNC_INFO << type_id; | 89 | TRACE() << Q_FUNC_INFO << type_id; |
2061 | 89 | Q_FOREACH (QString k, m_dests->get(type_id).toStringList()) | 90 | Q_FOREACH (QString k, m_dests->get(type_id).toStringList()) |
2062 | 90 | { | 91 | { |
2064 | 91 | qDebug() << Q_FUNC_INFO << k; | 92 | TRACE() << Q_FUNC_INFO << k; |
2065 | 92 | for_each(cuc::Peer{k}); | 93 | for_each(cuc::Peer{k}); |
2066 | 93 | } | 94 | } |
2067 | 94 | } | 95 | } |
2068 | 95 | Q_FOREACH (QString type_id, m_shares->keys()) | 96 | Q_FOREACH (QString type_id, m_shares->keys()) |
2069 | 96 | { | 97 | { |
2071 | 97 | qDebug() << Q_FUNC_INFO << type_id; | 98 | TRACE() << Q_FUNC_INFO << type_id; |
2072 | 98 | Q_FOREACH (QString k, m_shares->get(type_id).toStringList()) | 99 | Q_FOREACH (QString k, m_shares->get(type_id).toStringList()) |
2073 | 99 | { | 100 | { |
2075 | 100 | qDebug() << Q_FUNC_INFO << k; | 101 | TRACE() << Q_FUNC_INFO << k; |
2076 | 101 | for_each(cuc::Peer{k}); | 102 | for_each(cuc::Peer{k}); |
2077 | 102 | } | 103 | } |
2078 | 103 | } | 104 | } |
2079 | @@ -105,14 +106,14 @@ | |||
2080 | 105 | 106 | ||
2081 | 106 | void Registry::enumerate_known_sources_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) | 107 | void Registry::enumerate_known_sources_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) |
2082 | 107 | { | 108 | { |
2084 | 108 | qDebug() << Q_FUNC_INFO << type.id(); | 109 | TRACE() << Q_FUNC_INFO << type.id(); |
2085 | 109 | 110 | ||
2086 | 110 | if (type == cuc::Type::unknown()) | 111 | if (type == cuc::Type::unknown()) |
2087 | 111 | return; | 112 | return; |
2088 | 112 | 113 | ||
2089 | 113 | Q_FOREACH (QString k, m_sources->get(type.id()).toStringList()) | 114 | Q_FOREACH (QString k, m_sources->get(type.id()).toStringList()) |
2090 | 114 | { | 115 | { |
2092 | 115 | qDebug() << Q_FUNC_INFO << k; | 116 | TRACE() << Q_FUNC_INFO << k; |
2093 | 116 | bool defaultPeer = false; | 117 | bool defaultPeer = false; |
2094 | 117 | QStringList as(m_defaultSources->get(type.id()).toStringList()); | 118 | QStringList as(m_defaultSources->get(type.id()).toStringList()); |
2095 | 118 | if (!as.isEmpty()) | 119 | if (!as.isEmpty()) |
2096 | @@ -128,31 +129,31 @@ | |||
2097 | 128 | 129 | ||
2098 | 129 | void Registry::enumerate_known_destinations_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) | 130 | void Registry::enumerate_known_destinations_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) |
2099 | 130 | { | 131 | { |
2101 | 131 | qDebug() << Q_FUNC_INFO << type.id(); | 132 | TRACE() << Q_FUNC_INFO << type.id(); |
2102 | 132 | Q_FOREACH (QString k, m_dests->get(type.id()).toStringList()) | 133 | Q_FOREACH (QString k, m_dests->get(type.id()).toStringList()) |
2103 | 133 | { | 134 | { |
2105 | 134 | qDebug() << Q_FUNC_INFO << k; | 135 | TRACE() << Q_FUNC_INFO << k; |
2106 | 135 | for_each(cuc::Peer{k}); | 136 | for_each(cuc::Peer{k}); |
2107 | 136 | } | 137 | } |
2108 | 137 | } | 138 | } |
2109 | 138 | 139 | ||
2110 | 139 | void Registry::enumerate_known_shares_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) | 140 | void Registry::enumerate_known_shares_for_type(cuc::Type type, const std::function<void(const cuc::Peer&)>&for_each) |
2111 | 140 | { | 141 | { |
2113 | 141 | qDebug() << Q_FUNC_INFO << type.id(); | 142 | TRACE() << Q_FUNC_INFO << type.id(); |
2114 | 142 | 143 | ||
2115 | 143 | Q_FOREACH (QString k, m_shares->get(type.id()).toStringList()) | 144 | Q_FOREACH (QString k, m_shares->get(type.id()).toStringList()) |
2116 | 144 | { | 145 | { |
2118 | 145 | qDebug() << Q_FUNC_INFO << k; | 146 | TRACE() << Q_FUNC_INFO << k; |
2119 | 146 | for_each(cuc::Peer{k}); | 147 | for_each(cuc::Peer{k}); |
2120 | 147 | } | 148 | } |
2121 | 148 | } | 149 | } |
2122 | 149 | 150 | ||
2123 | 150 | bool Registry::install_default_source_for_type(cuc::Type type, cuc::Peer peer) | 151 | bool Registry::install_default_source_for_type(cuc::Type type, cuc::Peer peer) |
2124 | 151 | { | 152 | { |
2126 | 152 | qDebug() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); | 153 | TRACE() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); |
2127 | 153 | if (m_defaultSources->keys().contains(type.id())) | 154 | if (m_defaultSources->keys().contains(type.id())) |
2128 | 154 | { | 155 | { |
2130 | 155 | qDebug() << Q_FUNC_INFO << "Default peer for" << type.id() << "already installed."; | 156 | TRACE() << Q_FUNC_INFO << "Default peer for" << type.id() << "already installed."; |
2131 | 156 | return false; | 157 | return false; |
2132 | 157 | } | 158 | } |
2133 | 158 | 159 | ||
2134 | @@ -162,7 +163,7 @@ | |||
2135 | 162 | 163 | ||
2136 | 163 | bool Registry::install_source_for_type(cuc::Type type, cuc::Peer peer) | 164 | bool Registry::install_source_for_type(cuc::Type type, cuc::Peer peer) |
2137 | 164 | { | 165 | { |
2139 | 165 | qDebug() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); | 166 | TRACE() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); |
2140 | 166 | QStringList l = m_sources->get(type.id()).toStringList(); | 167 | QStringList l = m_sources->get(type.id()).toStringList(); |
2141 | 167 | if (not l.contains(peer.id())) | 168 | if (not l.contains(peer.id())) |
2142 | 168 | { | 169 | { |
2143 | @@ -174,7 +175,7 @@ | |||
2144 | 174 | 175 | ||
2145 | 175 | bool Registry::install_destination_for_type(cuc::Type type, cuc::Peer peer) | 176 | bool Registry::install_destination_for_type(cuc::Type type, cuc::Peer peer) |
2146 | 176 | { | 177 | { |
2148 | 177 | qDebug() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); | 178 | TRACE() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); |
2149 | 178 | QStringList l = m_dests->get(type.id()).toStringList(); | 179 | QStringList l = m_dests->get(type.id()).toStringList(); |
2150 | 179 | if (not l.contains(peer.id())) | 180 | if (not l.contains(peer.id())) |
2151 | 180 | { | 181 | { |
2152 | @@ -186,7 +187,7 @@ | |||
2153 | 186 | 187 | ||
2154 | 187 | bool Registry::install_share_for_type(cuc::Type type, cuc::Peer peer) | 188 | bool Registry::install_share_for_type(cuc::Type type, cuc::Peer peer) |
2155 | 188 | { | 189 | { |
2157 | 189 | qDebug() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); | 190 | TRACE() << Q_FUNC_INFO << "type:" << type.id() << "peer:" << peer.id(); |
2158 | 190 | QStringList l = m_shares->get(type.id()).toStringList(); | 191 | QStringList l = m_shares->get(type.id()).toStringList(); |
2159 | 191 | if (not l.contains(peer.id())) | 192 | if (not l.contains(peer.id())) |
2160 | 192 | { | 193 | { |
2161 | @@ -198,7 +199,7 @@ | |||
2162 | 198 | 199 | ||
2163 | 199 | bool Registry::remove_peer(cuc::Peer peer) | 200 | bool Registry::remove_peer(cuc::Peer peer) |
2164 | 200 | { | 201 | { |
2166 | 201 | qDebug() << Q_FUNC_INFO << "peer:" << peer.id(); | 202 | TRACE() << Q_FUNC_INFO << "peer:" << peer.id(); |
2167 | 202 | bool ret = false; | 203 | bool ret = false; |
2168 | 203 | Q_FOREACH (QString type_id, m_sources->keys()) | 204 | Q_FOREACH (QString type_id, m_sources->keys()) |
2169 | 204 | { | 205 | { |
2170 | 205 | 206 | ||
2171 | === modified file 'src/com/ubuntu/content/service/registry.h' | |||
2172 | --- src/com/ubuntu/content/service/registry.h 2014-03-21 00:29:33 +0000 | |||
2173 | +++ src/com/ubuntu/content/service/registry.h 2014-03-21 00:29:34 +0000 | |||
2174 | @@ -20,7 +20,6 @@ | |||
2175 | 20 | #define REGISTRY_H | 20 | #define REGISTRY_H |
2176 | 21 | 21 | ||
2177 | 22 | #include <QGSettings/QGSettings> | 22 | #include <QGSettings/QGSettings> |
2178 | 23 | #include <QDebug> | ||
2179 | 24 | #include <com/ubuntu/content/peer.h> | 23 | #include <com/ubuntu/content/peer.h> |
2180 | 25 | #include <com/ubuntu/content/type.h> | 24 | #include <com/ubuntu/content/type.h> |
2181 | 26 | #include "detail/peer_registry.h" | 25 | #include "detail/peer_registry.h" |
2182 | 27 | 26 | ||
2183 | === modified file 'src/com/ubuntu/content/transfer.cpp' | |||
2184 | --- src/com/ubuntu/content/transfer.cpp 2014-03-21 00:29:33 +0000 | |||
2185 | +++ src/com/ubuntu/content/transfer.cpp 2014-03-21 00:29:34 +0000 | |||
2186 | @@ -43,7 +43,7 @@ | |||
2187 | 43 | 43 | ||
2188 | 44 | cuc::Transfer::~Transfer() | 44 | cuc::Transfer::~Transfer() |
2189 | 45 | { | 45 | { |
2191 | 46 | qDebug() << Q_FUNC_INFO; | 46 | TRACE() << Q_FUNC_INFO; |
2192 | 47 | purge_store_cache(d->store().uri()); | 47 | purge_store_cache(d->store().uri()); |
2193 | 48 | } | 48 | } |
2194 | 49 | 49 | ||
2195 | 50 | 50 | ||
2196 | === modified file 'src/com/ubuntu/content/utils.cpp' | |||
2197 | --- src/com/ubuntu/content/utils.cpp 2014-03-21 00:29:33 +0000 | |||
2198 | +++ src/com/ubuntu/content/utils.cpp 2014-03-21 00:29:34 +0000 | |||
2199 | @@ -27,6 +27,7 @@ | |||
2200 | 27 | #include <nih-dbus/dbus_util.h> | 27 | #include <nih-dbus/dbus_util.h> |
2201 | 28 | 28 | ||
2202 | 29 | #include "common.h" | 29 | #include "common.h" |
2203 | 30 | #include "debug.h" | ||
2204 | 30 | #include "com/ubuntu/content/type.h" | 31 | #include "com/ubuntu/content/type.h" |
2205 | 31 | 32 | ||
2206 | 32 | namespace cuc = com::ubuntu::content; | 33 | namespace cuc = com::ubuntu::content; |
2207 | @@ -46,7 +47,7 @@ | |||
2208 | 46 | /* sanitize the dbus names */ | 47 | /* sanitize the dbus names */ |
2209 | 47 | QString sanitize_id(const QString& appId) | 48 | QString sanitize_id(const QString& appId) |
2210 | 48 | { | 49 | { |
2212 | 49 | qDebug() << Q_FUNC_INFO; | 50 | TRACE() << Q_FUNC_INFO; |
2213 | 50 | return QString(nih_dbus_path(NULL, | 51 | return QString(nih_dbus_path(NULL, |
2214 | 51 | "", | 52 | "", |
2215 | 52 | appId.toLocal8Bit().data(), | 53 | appId.toLocal8Bit().data(), |
2216 | @@ -80,7 +81,7 @@ | |||
2217 | 80 | 81 | ||
2218 | 81 | QString aa_profile(QString uniqueConnectionId) | 82 | QString aa_profile(QString uniqueConnectionId) |
2219 | 82 | { | 83 | { |
2221 | 83 | qDebug() << Q_FUNC_INFO << uniqueConnectionId; | 84 | TRACE() << Q_FUNC_INFO << uniqueConnectionId; |
2222 | 84 | QDBusMessage msg = | 85 | QDBusMessage msg = |
2223 | 85 | QDBusMessage::createMethodCall("org.freedesktop.DBus", | 86 | QDBusMessage::createMethodCall("org.freedesktop.DBus", |
2224 | 86 | "/org/freedesktop/DBus", | 87 | "/org/freedesktop/DBus", |
2225 | @@ -94,7 +95,7 @@ | |||
2226 | 94 | QDBusConnection::sessionBus().call(msg, QDBus::Block); | 95 | QDBusConnection::sessionBus().call(msg, QDBus::Block); |
2227 | 95 | if (reply.type() == QDBusMessage::ReplyMessage) { | 96 | if (reply.type() == QDBusMessage::ReplyMessage) { |
2228 | 96 | aaProfile = reply.arguments().value(0, QString()).toString(); | 97 | aaProfile = reply.arguments().value(0, QString()).toString(); |
2230 | 97 | qDebug() << "AppArmor Profile:" << aaProfile; | 98 | TRACE() << "AppArmor Profile:" << aaProfile; |
2231 | 98 | } else { | 99 | } else { |
2232 | 99 | qWarning() << "Error getting app ID:" << reply.errorName() << | 100 | qWarning() << "Error getting app ID:" << reply.errorName() << |
2233 | 100 | reply.errorMessage(); | 101 | reply.errorMessage(); |
2234 | @@ -109,7 +110,7 @@ | |||
2235 | 109 | 110 | ||
2236 | 110 | QString copy_to_store(const QString& src, const QString& store) | 111 | QString copy_to_store(const QString& src, const QString& store) |
2237 | 111 | { | 112 | { |
2239 | 112 | qDebug() << Q_FUNC_INFO; | 113 | TRACE() << Q_FUNC_INFO; |
2240 | 113 | QUrl srcUrl(src); | 114 | QUrl srcUrl(src); |
2241 | 114 | if (not srcUrl.isLocalFile()) | 115 | if (not srcUrl.isLocalFile()) |
2242 | 115 | return srcUrl.url(); | 116 | return srcUrl.url(); |
2243 | @@ -120,7 +121,7 @@ | |||
2244 | 120 | if (not st.exists()) | 121 | if (not st.exists()) |
2245 | 121 | st.mkpath(st.absolutePath()); | 122 | st.mkpath(st.absolutePath()); |
2246 | 122 | QString destFilePath = store + QDir::separator() + fi.fileName(); | 123 | QString destFilePath = store + QDir::separator() + fi.fileName(); |
2248 | 123 | qDebug() << Q_FUNC_INFO << destFilePath; | 124 | TRACE() << Q_FUNC_INFO << destFilePath; |
2249 | 124 | bool result = QFile::copy(fi.filePath(), destFilePath); | 125 | bool result = QFile::copy(fi.filePath(), destFilePath); |
2250 | 125 | if (not result) | 126 | if (not result) |
2251 | 126 | { | 127 | { |
2252 | @@ -132,7 +133,7 @@ | |||
2253 | 132 | 133 | ||
2254 | 133 | bool is_persistent(QString store) | 134 | bool is_persistent(QString store) |
2255 | 134 | { | 135 | { |
2257 | 135 | qDebug() << Q_FUNC_INFO << store; | 136 | TRACE() << Q_FUNC_INFO << store; |
2258 | 136 | QRegExp rx("*.cache/*/HubIncoming/*"); | 137 | QRegExp rx("*.cache/*/HubIncoming/*"); |
2259 | 137 | rx.setPatternSyntax(QRegExp::Wildcard); | 138 | rx.setPatternSyntax(QRegExp::Wildcard); |
2260 | 138 | rx.setCaseSensitivity(Qt::CaseSensitive); | 139 | rx.setCaseSensitivity(Qt::CaseSensitive); |
2261 | @@ -141,18 +142,18 @@ | |||
2262 | 141 | 142 | ||
2263 | 142 | bool purge_store_cache(QString store) | 143 | bool purge_store_cache(QString store) |
2264 | 143 | { | 144 | { |
2266 | 144 | qDebug() << Q_FUNC_INFO << "Store:" << store; | 145 | TRACE() << Q_FUNC_INFO << "Store:" << store; |
2267 | 145 | 146 | ||
2268 | 146 | if (is_persistent(store)) | 147 | if (is_persistent(store)) |
2269 | 147 | { | 148 | { |
2271 | 148 | qDebug() << Q_FUNC_INFO << store << "is persistent"; | 149 | TRACE() << Q_FUNC_INFO << store << "is persistent"; |
2272 | 149 | return false; | 150 | return false; |
2273 | 150 | } | 151 | } |
2274 | 151 | 152 | ||
2275 | 152 | QDir st(store); | 153 | QDir st(store); |
2276 | 153 | if (st.exists()) | 154 | if (st.exists()) |
2277 | 154 | { | 155 | { |
2279 | 155 | qDebug() << Q_FUNC_INFO << store << "isn't persistent, purging"; | 156 | TRACE() << Q_FUNC_INFO << store << "isn't persistent, purging"; |
2280 | 156 | return st.removeRecursively(); | 157 | return st.removeRecursively(); |
2281 | 157 | } | 158 | } |
2282 | 158 | 159 |
PASSED: Continuous integration, rev:138 jenkins. qa.ubuntu. com/job/ content- hub-ci/ 121/ jenkins. qa.ubuntu. com/job/ content- hub-trusty- amd64-ci/ 24 jenkins. qa.ubuntu. com/job/ content- hub-trusty- armhf-ci/ 24 jenkins. qa.ubuntu. com/job/ content- hub-trusty- armhf-ci/ 24/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ content- hub-trusty- i386-ci/ 24
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/content- hub-ci/ 121/rebuild
http://