Merge lp:~nskaggs/ubuntu-filemanager-app/revert-r209 into lp:ubuntu-filemanager-app
- revert-r209
- Merge into trunk
Proposed by
Nicholas Skaggs
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 213 |
Merged at revision: | 211 |
Proposed branch: | lp:~nskaggs/ubuntu-filemanager-app/revert-r209 |
Merge into: | lp:ubuntu-filemanager-app |
Diff against target: |
734 lines (+104/-401) 15 files modified
debian/control (+1/-12) debian/qtdeclarative5-placesmodel0.1.install (+0/-1) src/app/qml/components/PathBar.qml (+1/-1) src/app/qml/components/PlacesSidebar.qml (+36/-13) src/app/qml/filemanager.qml (+2/-7) src/app/qml/ui/FolderListPage.qml (+28/-15) src/app/qml/ui/PlacesPopover.qml (+35/-2) src/plugin/CMakeLists.txt (+0/-1) src/plugin/placesmodel/CMakeLists.txt (+0/-35) src/plugin/placesmodel/placesmodel.cpp (+0/-174) src/plugin/placesmodel/placesmodel.h (+0/-64) src/plugin/placesmodel/placesmodel_plugin.cpp (+0/-34) src/plugin/placesmodel/placesmodel_plugin.h (+0/-39) src/plugin/placesmodel/qmldir (+0/-2) tests/autopilot/filemanager/tests/test_places.py (+1/-1) |
To merge this branch: | bzr merge lp:~nskaggs/ubuntu-filemanager-app/revert-r209 |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Ubuntu File Manager Developers | Pending | ||
Review via email: mp+223783@code.launchpad.net |
Commit message
Revert accidental merge
Description of the change
Revert accidental merge of https:/
To post a comment you must log in.
- 213. By Nicholas Skaggs
-
also revert test_places ap change
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:213
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
review:
Approve
(continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote : | # |
Ran 22 tests in 495.191s
OK
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' |
2 | --- debian/control 2014-06-18 17:37:53 +0000 |
3 | +++ debian/control 2014-06-19 16:03:59 +0000 |
4 | @@ -38,19 +38,9 @@ |
5 | Qt is a cross-platform C++ application framework. Qt's primary feature |
6 | is its rich set of widgets that provide standard GUI functionality. |
7 | . |
8 | - This package contains the Folder List model plugin of the Nemo QML |
9 | + This package contains the Folder List model plugin of the Nemo QML |
10 | plugins collection. |
11 | |
12 | -Package: qtdeclarative5-placesmodel0.1 |
13 | -Architecture: any |
14 | -Multi-Arch: same |
15 | -Depends: ${misc:Depends}, |
16 | - ${shlibs:Depends}, |
17 | - ${misc:Pre-Depends}, |
18 | -Description: Places model QML plugin |
19 | - This package contains a plugin that enables QML apps to list and |
20 | - modify a set of places (bookmarks) in the file system. |
21 | - |
22 | Package: ubuntu-filemanager-app-autopilot |
23 | Architecture: all |
24 | Depends: ${misc:Depends}, |
25 | @@ -59,6 +49,5 @@ |
26 | ubuntu-filemanager-app (>= ${source:Version}), |
27 | ubuntu-ui-toolkit-autopilot, |
28 | python3-autopilot, |
29 | - python3-fixtures, |
30 | Description: Autopilot tests for File Manager Application |
31 | This package contains the autopilot tests for the File Manager |
32 | |
33 | === removed file 'debian/qtdeclarative5-placesmodel0.1.install' |
34 | --- debian/qtdeclarative5-placesmodel0.1.install 2014-06-18 09:00:10 +0000 |
35 | +++ debian/qtdeclarative5-placesmodel0.1.install 1970-01-01 00:00:00 +0000 |
36 | @@ -1,1 +0,0 @@ |
37 | -usr/lib/*/qt5/qml/com/ubuntu/PlacesModel/ |
38 | |
39 | === modified file 'src/app/qml/components/PathBar.qml' |
40 | --- src/app/qml/components/PathBar.qml 2014-06-18 09:00:10 +0000 |
41 | +++ src/app/qml/components/PathBar.qml 2014-06-19 16:03:59 +0000 |
42 | @@ -117,7 +117,7 @@ |
43 | Label { |
44 | id: label |
45 | anchors.centerIn: parent |
46 | - text: modelData === "" ? "/" : modelData |
47 | + text: modelData === "" ? "/" : modelData === "~" ? i18n.tr("Home") : modelData |
48 | color: UbuntuColors.coolGrey |
49 | } |
50 | |
51 | |
52 | === modified file 'src/app/qml/components/PlacesSidebar.qml' |
53 | --- src/app/qml/components/PlacesSidebar.qml 2014-06-18 13:57:37 +0000 |
54 | +++ src/app/qml/components/PlacesSidebar.qml 2014-06-19 16:03:59 +0000 |
55 | @@ -20,7 +20,6 @@ |
56 | import Ubuntu.Components 0.1 |
57 | import Ubuntu.Components.ListItems 0.1 |
58 | import Ubuntu.Components.Popups 0.1 |
59 | -import com.ubuntu.PlacesModel 0.1 |
60 | |
61 | Sidebar { |
62 | id: root |
63 | @@ -43,6 +42,40 @@ |
64 | UbuntuNumberAnimation {} |
65 | } |
66 | |
67 | + ListModel { |
68 | + id: places |
69 | + |
70 | + ListElement { |
71 | + objectName: "placeHome" |
72 | + path: "~" |
73 | + } |
74 | + |
75 | + ListElement { |
76 | + path: "~/Documents" |
77 | + } |
78 | + |
79 | + ListElement { |
80 | + path: "~/Downloads" |
81 | + } |
82 | + |
83 | + ListElement { |
84 | + path: "~/Music" |
85 | + } |
86 | + |
87 | + ListElement { |
88 | + path: "~/Pictures" |
89 | + } |
90 | + |
91 | + ListElement { |
92 | + path: "~/Videos" |
93 | + } |
94 | + |
95 | + ListElement { |
96 | + objectName: "placeRoot" |
97 | + path: "/" |
98 | + } |
99 | + } |
100 | + |
101 | Column { |
102 | anchors { |
103 | left: parent.left |
104 | @@ -54,24 +87,14 @@ |
105 | text: i18n.tr("Places") |
106 | } |
107 | |
108 | - PlacesModel { |
109 | - id: userplaces |
110 | - |
111 | - // By default, the model only contains the |
112 | - // user directories. Add the file system location too |
113 | - Component.onCompleted: { |
114 | - addLocation("/"); |
115 | - } |
116 | - } |
117 | - |
118 | Repeater { |
119 | id: placesList |
120 | objectName: "placesList" |
121 | |
122 | - model: userplaces |
123 | + model: places |
124 | |
125 | delegate: Standard { |
126 | - objectName: "place" + folderName(path).replace(/ /g,'') |
127 | + objectName: model.objectName |
128 | text: folderName(path) |
129 | |
130 | Image { |
131 | |
132 | === modified file 'src/app/qml/filemanager.qml' |
133 | --- src/app/qml/filemanager.qml 2014-06-18 09:00:10 +0000 |
134 | +++ src/app/qml/filemanager.qml 2014-06-19 16:03:59 +0000 |
135 | @@ -21,7 +21,6 @@ |
136 | import Ubuntu.Components.Popups 0.1 |
137 | import Ubuntu.Unity.Action 1.0 as UnityActions |
138 | import U1db 1.0 as U1db |
139 | -import com.ubuntu.PlacesModel 0.1 |
140 | |
141 | import "ui" |
142 | |
143 | @@ -61,10 +60,6 @@ |
144 | backgroundColor: "#797979" |
145 | footerColor: "#808080" |
146 | |
147 | - PlacesModel { |
148 | - id: userplaces |
149 | - } |
150 | - |
151 | // HUD Actions |
152 | Action { |
153 | id: settingsAction |
154 | @@ -77,7 +72,7 @@ |
155 | |
156 | property var pageStack: pageStack |
157 | |
158 | - property var folderTabs: [userplaces.locationHome] |
159 | + property var folderTabs: ["~"] |
160 | |
161 | function openTab(folder) { |
162 | var list = folderTabs |
163 | @@ -105,7 +100,7 @@ |
164 | page: FolderListPage { |
165 | objectName: "folderPage" |
166 | |
167 | - folder: userplaces.locationHome //modelData |
168 | + folder: "~"//modelData |
169 | } |
170 | } |
171 | |
172 | |
173 | === modified file 'src/app/qml/ui/FolderListPage.qml' |
174 | --- src/app/qml/ui/FolderListPage.qml 2014-06-18 09:00:10 +0000 |
175 | +++ src/app/qml/ui/FolderListPage.qml 2014-06-19 16:03:59 +0000 |
176 | @@ -20,7 +20,6 @@ |
177 | import Ubuntu.Components.Popups 0.1 |
178 | import Ubuntu.Components.ListItems 0.1 |
179 | import org.nemomobile.folderlistmodel 1.0 |
180 | -import com.ubuntu.PlacesModel 0.1 |
181 | import "../components" |
182 | |
183 | Page { |
184 | @@ -64,15 +63,27 @@ |
185 | } |
186 | } |
187 | |
188 | - PlacesModel { id: userplaces } |
189 | - |
190 | + // This stores the location using ~ to represent home |
191 | property string folder |
192 | - property string path: folder |
193 | + property string homeFolder: "~" |
194 | + |
195 | + // This replaces ~ with the actual home folder, since the |
196 | + // plugin doesn't recognize the ~ |
197 | + property string path: folder.replace("~", pageModel.homePath()) |
198 | + |
199 | + function goHome() { |
200 | + goTo(folderListPage.homeFolder) |
201 | + } |
202 | |
203 | function goTo(location) { |
204 | - // This allows us to enter "~" as a shortcut to the home folder |
205 | - // when entering a location on the Go To dialog |
206 | - folderListPage.folder = location.replace("~", userplaces.locationHome) |
207 | + // Since the FolderListModel returns paths using the actual |
208 | + // home folder, this replaces with ~ before actually going |
209 | + // to the specified folder |
210 | + while (location !== '/' && location.substring(location.lastIndexOf('/')+1) === "") { |
211 | + location = location.substring(0, location.length - 1) |
212 | + } |
213 | + |
214 | + folderListPage.folder = location.replace(pageModel.homePath(), "~") |
215 | refresh() |
216 | } |
217 | |
218 | @@ -102,20 +113,21 @@ |
219 | // files will need an icon. |
220 | // TODO: Remove isDir parameter and use new model functions |
221 | function fileIcon(file, isDir) { |
222 | + file = file.replace(pageModel.homePath(), "~") |
223 | var iconPath = isDir ? "/usr/share/icons/Humanity/places/48/folder.svg" |
224 | : "/usr/share/icons/Humanity/mimes/48/empty.svg" |
225 | |
226 | - if (file === userplaces.locationHome) { |
227 | + if (file === "~") { |
228 | iconPath = "../icons/folder-home.svg" |
229 | } else if (file === i18n.tr("~/Desktop")) { |
230 | iconPath = "/usr/share/icons/Humanity/places/48/user-desktop.svg" |
231 | - } else if (file === userplaces.locationDocuments) { |
232 | + } else if (file === i18n.tr("~/Documents")) { |
233 | iconPath = "/usr/share/icons/Humanity/places/48/folder-documents.svg" |
234 | - } else if (file === userplaces.locationDownloads) { |
235 | + } else if (file === i18n.tr("~/Downloads")) { |
236 | iconPath = "/usr/share/icons/Humanity/places/48/folder-downloads.svg" |
237 | - } else if (file === userplaces.locationMusic) { |
238 | + } else if (file === i18n.tr("~/Music")) { |
239 | iconPath = "/usr/share/icons/Humanity/places/48/folder-music.svg" |
240 | - } else if (file === userplaces.locationPictures) { |
241 | + } else if (file === i18n.tr("~/Pictures")) { |
242 | iconPath = "/usr/share/icons/Humanity/places/48/folder-pictures.svg" |
243 | } else if (file === i18n.tr("~/Public")) { |
244 | iconPath = "/usr/share/icons/Humanity/places/48/folder-publicshare.svg" |
245 | @@ -123,7 +135,7 @@ |
246 | iconPath = "/usr/share/icons/Humanity/places/48/folder-system.svg" |
247 | } else if (file === i18n.tr("~/Templates")) { |
248 | iconPath = "/usr/share/icons/Humanity/places/48/folder-templates.svg" |
249 | - } else if (file === userplaces.locationVideos) { |
250 | + } else if (file === i18n.tr("~/Videos")) { |
251 | iconPath = "/usr/share/icons/Humanity/places/48/folder-videos.svg" |
252 | } else if (file === "/") { |
253 | iconPath = "/usr/share/icons/Humanity/devices/48/drive-harddisk.svg" |
254 | @@ -133,8 +145,9 @@ |
255 | } |
256 | |
257 | function folderName(folder) { |
258 | + folder = folder.replace(pageModel.homePath(), "~") |
259 | |
260 | - if (folder === userplaces.locationHome) { |
261 | + if (folder === folderListPage.homeFolder) { |
262 | return i18n.tr("Home") |
263 | } else if (folder === "/") { |
264 | return i18n.tr("File System") |
265 | @@ -195,7 +208,7 @@ |
266 | path: folderListPage.folder |
267 | |
268 | onPathChanged: { |
269 | - console.log("Path changed to: " + repeaterModel.path) |
270 | + console.log("Path: " + repeaterModel.path) |
271 | } |
272 | } |
273 | |
274 | |
275 | === modified file 'src/app/qml/ui/PlacesPopover.qml' |
276 | --- src/app/qml/ui/PlacesPopover.qml 2014-06-18 09:00:10 +0000 |
277 | +++ src/app/qml/ui/PlacesPopover.qml 2014-06-19 16:03:59 +0000 |
278 | @@ -19,12 +19,45 @@ |
279 | import Ubuntu.Components 0.1 |
280 | import Ubuntu.Components.Popups 0.1 |
281 | import Ubuntu.Components.ListItems 0.1 |
282 | -import com.ubuntu.PlacesModel 0.1 |
283 | |
284 | Popover { |
285 | id: root |
286 | objectName: "placesPopover" |
287 | |
288 | + ListModel { |
289 | + id: places |
290 | + |
291 | + ListElement { |
292 | + objectName: 'placeHome' |
293 | + path: "~" |
294 | + } |
295 | + |
296 | + ListElement { |
297 | + path: "~/Documents" |
298 | + } |
299 | + |
300 | + ListElement { |
301 | + path: "~/Downloads" |
302 | + } |
303 | + |
304 | + ListElement { |
305 | + path: "~/Music" |
306 | + } |
307 | + |
308 | + ListElement { |
309 | + path: "~/Pictures" |
310 | + } |
311 | + |
312 | + ListElement { |
313 | + path: "~/Videos" |
314 | + } |
315 | + |
316 | + ListElement { |
317 | + objectName: "placeRoot" |
318 | + path: "/" |
319 | + } |
320 | + } |
321 | + |
322 | Column { |
323 | anchors { |
324 | left: parent.left |
325 | @@ -80,7 +113,7 @@ |
326 | id: placesList |
327 | objectName: "placesList" |
328 | |
329 | - model: PlacesModel {} |
330 | + model: places |
331 | |
332 | delegate: Standard { |
333 | objectName: model.objectName |
334 | |
335 | === modified file 'src/plugin/CMakeLists.txt' |
336 | --- src/plugin/CMakeLists.txt 2014-06-18 09:02:58 +0000 |
337 | +++ src/plugin/CMakeLists.txt 2014-06-19 16:03:59 +0000 |
338 | @@ -5,4 +5,3 @@ |
339 | find_package(Qt5Widgets) |
340 | |
341 | add_subdirectory(folderlistmodel) |
342 | -add_subdirectory(placesmodel) |
343 | |
344 | === removed directory 'src/plugin/placesmodel' |
345 | === removed file 'src/plugin/placesmodel/CMakeLists.txt' |
346 | --- src/plugin/placesmodel/CMakeLists.txt 2014-06-18 09:00:10 +0000 |
347 | +++ src/plugin/placesmodel/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
348 | @@ -1,35 +0,0 @@ |
349 | -include_directories( |
350 | - ${CMAKE_CURRENT_SOURCE_DIR} |
351 | -) |
352 | - |
353 | -set(PLUGIN_DIR com/ubuntu/PlacesModel) |
354 | - |
355 | -set(placesmodel_SRCS |
356 | - placesmodel.cpp |
357 | - placesmodel.h |
358 | - placesmodel_plugin.cpp |
359 | - placesmodel_plugin.h |
360 | -) |
361 | - |
362 | -add_library(PlacesModel MODULE |
363 | - ${placesmodel_SRCS} |
364 | -) |
365 | - |
366 | -qt5_use_modules(PlacesModel Gui Qml Quick Widgets) |
367 | - |
368 | -# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator |
369 | -if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") |
370 | - add_custom_command(TARGET PlacesModel POST_BUILD |
371 | - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR} |
372 | - COMMENT "Creating plugin directory layout in the build directory" |
373 | - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR} |
374 | - COMMENT "Copying the qmldir file to the build directory" |
375 | - COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PlacesModel> ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR} |
376 | - COMMENT "Copying the plugin binary to the build directory" |
377 | - ) |
378 | -endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") |
379 | - |
380 | -# Install plugin file |
381 | -install(TARGETS PlacesModel DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR}) |
382 | -install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR}) |
383 | - |
384 | |
385 | === removed file 'src/plugin/placesmodel/placesmodel.cpp' |
386 | --- src/plugin/placesmodel/placesmodel.cpp 2014-06-18 12:24:06 +0000 |
387 | +++ src/plugin/placesmodel/placesmodel.cpp 1970-01-01 00:00:00 +0000 |
388 | @@ -1,174 +0,0 @@ |
389 | -/* |
390 | - * Copyright (C) 2013 Canonical Ltd |
391 | - * |
392 | - * This program is free software: you can redistribute it and/or modify |
393 | - * it under the terms of the GNU General Public License version 3 as |
394 | - * published by the Free Software Foundation. |
395 | - * |
396 | - * This program is distributed in the hope that it will be useful, |
397 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
398 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
399 | - * GNU General Public License for more details. |
400 | - * |
401 | - * You should have received a copy of the GNU General Public License |
402 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
403 | - * |
404 | - * Author : David Planella <david.planella@ubuntu.com> |
405 | - */ |
406 | - |
407 | -#include "placesmodel.h" |
408 | -#include <QDebug> |
409 | -#include <QDir> |
410 | -#include <QAbstractItemModel> |
411 | -#include <QCoreApplication> |
412 | -#include <QStandardPaths> |
413 | -#include <QDebug> |
414 | - |
415 | -PlacesModel::PlacesModel(QAbstractListModel *parent) : |
416 | - QAbstractListModel(parent) |
417 | -{ |
418 | - |
419 | - QStringList defaultLocations; |
420 | - // Set the storage location to a path that works well |
421 | - // with app isolation |
422 | - QString settingsLocation = |
423 | - QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first() |
424 | - + "/" + QCoreApplication::applicationName() + "/" + "places.conf"; |
425 | - m_settings = new QSettings(settingsLocation, QSettings::IniFormat, this); |
426 | - |
427 | - // Prepopulate the model with the user locations |
428 | - // for the first time it's used |
429 | - defaultLocations.append(locationHome()); |
430 | - defaultLocations.append(locationDocuments()); |
431 | - defaultLocations.append(locationDownloads()); |
432 | - defaultLocations.append(locationMusic()); |
433 | - defaultLocations.append(locationPictures()); |
434 | - defaultLocations.append(locationVideos()); |
435 | - |
436 | - if (!m_settings->contains("storedLocations")) { |
437 | - m_locations.append(defaultLocations); |
438 | - } else { |
439 | - m_locations = m_settings->value("storedLocations").toStringList(); |
440 | - } |
441 | - |
442 | - foreach (const QString &location, m_locations) { |
443 | - qDebug() << "Location: " << location; |
444 | - } |
445 | - |
446 | -} |
447 | - |
448 | -PlacesModel::~PlacesModel() { |
449 | - |
450 | -} |
451 | - |
452 | -QString PlacesModel::standardLocation(QStandardPaths::StandardLocation location) const |
453 | -{ |
454 | - QStringList locations = QStandardPaths::standardLocations(location); |
455 | - QString standardLocation = ""; |
456 | - |
457 | - foreach (const QString &location, locations) { |
458 | - // We always return the first location or an empty string |
459 | - // The frontend should check out that it exists |
460 | - if (QDir(location).exists()) { |
461 | - standardLocation = location; |
462 | - break; |
463 | - } |
464 | - } |
465 | - |
466 | - return standardLocation; |
467 | -} |
468 | - |
469 | -QString PlacesModel::locationHome() const |
470 | -{ |
471 | - return standardLocation(QStandardPaths::HomeLocation); |
472 | -} |
473 | - |
474 | -QString PlacesModel::locationDocuments() const |
475 | -{ |
476 | - return standardLocation(QStandardPaths::DocumentsLocation); |
477 | -} |
478 | - |
479 | -QString PlacesModel::locationDownloads() const |
480 | -{ |
481 | - return standardLocation(QStandardPaths::DownloadLocation); |
482 | -} |
483 | - |
484 | -QString PlacesModel::locationMusic() const |
485 | -{ |
486 | - return standardLocation(QStandardPaths::MusicLocation); |
487 | -} |
488 | - |
489 | -QString PlacesModel::locationPictures() const |
490 | -{ |
491 | - return standardLocation(QStandardPaths::PicturesLocation); |
492 | -} |
493 | - |
494 | -QString PlacesModel::locationVideos() const |
495 | -{ |
496 | - return standardLocation(QStandardPaths::MoviesLocation); |
497 | -} |
498 | - |
499 | -int PlacesModel::rowCount(const QModelIndex &parent) const |
500 | -{ |
501 | - Q_UNUSED(parent) |
502 | - |
503 | - return m_locations.count(); |
504 | -} |
505 | - |
506 | -QVariant PlacesModel::data(const QModelIndex &index, int role) const |
507 | -{ |
508 | - Q_UNUSED(role) |
509 | - |
510 | - return m_locations.at(index.row()); |
511 | -} |
512 | - |
513 | -QHash<int, QByteArray> PlacesModel::roleNames() const |
514 | -{ |
515 | - QHash<int, QByteArray> roles; |
516 | - roles.insert(Qt::UserRole, "path"); |
517 | - |
518 | - return roles; |
519 | -} |
520 | - |
521 | -void PlacesModel::removeItem(int indexToRemove) |
522 | -{ |
523 | - |
524 | - // Tell Qt that we're going to be changing the model |
525 | - // There's no tree-parent, first new item will be at |
526 | - // indexToRemove, and the last one too |
527 | - beginRemoveRows(QModelIndex(), indexToRemove, indexToRemove); |
528 | - |
529 | - // Remove the actual location |
530 | - m_locations.removeAt(indexToRemove); |
531 | - |
532 | - // Tell Qt we're done with modifying the model so that |
533 | - // it can update the UI and everything else to reflect |
534 | - // the new state |
535 | - endRemoveRows(); |
536 | - |
537 | - // Remove the location permanently |
538 | - m_settings->setValue("storedLocations", m_locations); |
539 | -} |
540 | - |
541 | -void PlacesModel::addLocation(const QString &location) |
542 | -{ |
543 | - // Do not allow for duplicates |
544 | - if (!m_locations.contains(location)) { |
545 | - // Tell Qt that we're going to be changing the model |
546 | - // There's no tree-parent, first new item will be at |
547 | - // m_locations.count(), and the last one too |
548 | - beginInsertRows(QModelIndex(), m_locations.count(), m_locations.count()); |
549 | - |
550 | - // Append the actual location |
551 | - m_locations.append(location); |
552 | - |
553 | - |
554 | - // Tell Qt we're done with modifying the model so that |
555 | - // it can update the UI and everything else to reflect |
556 | - // the new state |
557 | - endInsertRows(); |
558 | - |
559 | - // Store the location permanently |
560 | - m_settings->setValue("storedLocations", m_locations); |
561 | - } |
562 | -} |
563 | |
564 | === removed file 'src/plugin/placesmodel/placesmodel.h' |
565 | --- src/plugin/placesmodel/placesmodel.h 2014-06-18 12:24:06 +0000 |
566 | +++ src/plugin/placesmodel/placesmodel.h 1970-01-01 00:00:00 +0000 |
567 | @@ -1,64 +0,0 @@ |
568 | -/* |
569 | - * Copyright (C) 2013 Canonical Ltd |
570 | - * |
571 | - * This program is free software: you can redistribute it and/or modify |
572 | - * it under the terms of the GNU General Public License version 3 as |
573 | - * published by the Free Software Foundation. |
574 | - * |
575 | - * This program is distributed in the hope that it will be useful, |
576 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
577 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
578 | - * GNU General Public License for more details. |
579 | - * |
580 | - * You should have received a copy of the GNU General Public License |
581 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
582 | - * |
583 | - * Author : David Planella <david.planella@ubuntu.com> |
584 | - */ |
585 | - |
586 | -#ifndef PLACESMODEL_H |
587 | -#define PLACESMODEL_H |
588 | - |
589 | -#include <QObject> |
590 | -#include <QAbstractListModel> |
591 | -#include <QStandardPaths> |
592 | -#include <QSettings> |
593 | - |
594 | -class PlacesModel : public QAbstractListModel |
595 | -{ |
596 | - Q_OBJECT |
597 | - |
598 | - Q_PROPERTY(QString locationHome READ locationHome CONSTANT) |
599 | - Q_PROPERTY(QString locationDocuments READ locationDocuments CONSTANT) |
600 | - Q_PROPERTY(QString locationDownloads READ locationDownloads CONSTANT) |
601 | - Q_PROPERTY(QString locationMusic READ locationMusic CONSTANT) |
602 | - Q_PROPERTY(QString locationPictures READ locationPictures CONSTANT) |
603 | - Q_PROPERTY(QString locationVideos READ locationVideos CONSTANT) |
604 | - |
605 | -public: |
606 | - explicit PlacesModel(QAbstractListModel *parent = 0); |
607 | - ~PlacesModel(); |
608 | - QString locationHome() const; |
609 | - QString locationDocuments() const; |
610 | - QString locationDownloads() const; |
611 | - QString locationMusic() const; |
612 | - QString locationPictures() const; |
613 | - QString locationVideos() const; |
614 | - int rowCount(const QModelIndex &parent) const override; |
615 | - QVariant data(const QModelIndex &index, int role) const override; |
616 | - QHash<int, QByteArray> roleNames() const override; |
617 | - |
618 | -public slots: |
619 | - void addLocation(const QString &location); |
620 | - void removeItem(int indexToRemove); |
621 | - |
622 | -private: |
623 | - QString standardLocation(QStandardPaths::StandardLocation location) const; |
624 | - QStringList m_locations; |
625 | - QSettings *m_settings; |
626 | -}; |
627 | - |
628 | -#endif // PLACESMODEL_H |
629 | - |
630 | - |
631 | - |
632 | |
633 | === removed file 'src/plugin/placesmodel/placesmodel_plugin.cpp' |
634 | --- src/plugin/placesmodel/placesmodel_plugin.cpp 2014-06-18 09:00:10 +0000 |
635 | +++ src/plugin/placesmodel/placesmodel_plugin.cpp 1970-01-01 00:00:00 +0000 |
636 | @@ -1,34 +0,0 @@ |
637 | -/* |
638 | - * Copyright (C) 2013 Canonical Ltd |
639 | - * |
640 | - * This program is free software: you can redistribute it and/or modify |
641 | - * it under the terms of the GNU General Public License version 3 as |
642 | - * published by the Free Software Foundation. |
643 | - * |
644 | - * This program is distributed in the hope that it will be useful, |
645 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
646 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
647 | - * GNU General Public License for more details. |
648 | - * |
649 | - * You should have received a copy of the GNU General Public License |
650 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
651 | - * |
652 | - * Author : David Planella <david.planella@ubuntu.com> |
653 | - */ |
654 | - |
655 | -#include <QtQml> |
656 | -#include <QtQml/QQmlContext> |
657 | -#include "placesmodel_plugin.h" |
658 | -#include "placesmodel.h" |
659 | - |
660 | -void BackendPlugin::registerTypes(const char *uri) |
661 | -{ |
662 | - Q_ASSERT(uri == QLatin1String(QUOTES(PLUGIN_URI))); |
663 | - |
664 | - qmlRegisterType<PlacesModel>(uri, 0, 1, "PlacesModel"); |
665 | -} |
666 | - |
667 | -void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri) |
668 | -{ |
669 | - QQmlExtensionPlugin::initializeEngine(engine, uri); |
670 | -} |
671 | |
672 | === removed file 'src/plugin/placesmodel/placesmodel_plugin.h' |
673 | --- src/plugin/placesmodel/placesmodel_plugin.h 2014-06-18 09:00:10 +0000 |
674 | +++ src/plugin/placesmodel/placesmodel_plugin.h 1970-01-01 00:00:00 +0000 |
675 | @@ -1,39 +0,0 @@ |
676 | -/* |
677 | - * Copyright (C) 2013 Canonical Ltd |
678 | - * |
679 | - * This program is free software: you can redistribute it and/or modify |
680 | - * it under the terms of the GNU General Public License version 3 as |
681 | - * published by the Free Software Foundation. |
682 | - * |
683 | - * This program is distributed in the hope that it will be useful, |
684 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
685 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
686 | - * GNU General Public License for more details. |
687 | - * |
688 | - * You should have received a copy of the GNU General Public License |
689 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
690 | - * |
691 | - * Author : David Planella <david.planella@ubuntu.com> |
692 | - */ |
693 | - |
694 | -#ifndef PLACESMODEL_PLUGIN_H |
695 | -#define PLACESMODEL_PLUGIN_H |
696 | - |
697 | -#include <QtQml/QQmlEngine> |
698 | -#include <QtQml/QQmlExtensionPlugin> |
699 | - |
700 | -class BackendPlugin : public QQmlExtensionPlugin |
701 | -{ |
702 | - Q_OBJECT |
703 | - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
704 | - |
705 | -public: |
706 | - void registerTypes(const char *uri); |
707 | - void initializeEngine(QQmlEngine *engine, const char *uri); |
708 | -}; |
709 | -#endif // PLACESMODEL_PLUGIN_H |
710 | - |
711 | - |
712 | - |
713 | - |
714 | - |
715 | |
716 | === removed file 'src/plugin/placesmodel/qmldir' |
717 | --- src/plugin/placesmodel/qmldir 2014-06-18 09:00:10 +0000 |
718 | +++ src/plugin/placesmodel/qmldir 1970-01-01 00:00:00 +0000 |
719 | @@ -1,2 +0,0 @@ |
720 | -module com.ubuntu.PlacesModel |
721 | -plugin PlacesModel |
722 | |
723 | === modified file 'tests/autopilot/filemanager/tests/test_places.py' |
724 | --- tests/autopilot/filemanager/tests/test_places.py 2014-06-18 13:57:37 +0000 |
725 | +++ tests/autopilot/filemanager/tests/test_places.py 2014-06-19 16:03:59 +0000 |
726 | @@ -34,7 +34,7 @@ |
727 | |
728 | def test_go_to_root_must_open_the_root_directory(self): |
729 | """Test that opens the File System bookmark from the places section.""" |
730 | - self.main_view.go_to_place('placeFileSystem') |
731 | + self.main_view.go_to_place('placeRoot') |
732 | |
733 | folder_list_page = self.main_view.get_folder_list_page() |
734 | self.assertThat( |
FAILED: Continuous integration, rev:212 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 261/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 581 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 581/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- filemanager- app-utopic- amd64-ci/ 59
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 261/rebuild
http://