Merge lp:~carlos-mazieri/ubuntu-filemanager-app/plugin-change-std-array-to-qlist into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Carlos Jose Mazieri
Approved revision: 267
Merged at revision: 277
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/plugin-change-std-array-to-qlist
Merge into: lp:ubuntu-filemanager-app
Diff against target: 42 lines (+9/-10)
1 file modified
src/plugin/folderlistmodel/dirmodel.cpp (+9/-10)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/plugin-change-std-array-to-qlist
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+233281@code.launchpad.net

Commit message

Just changed from std:array to QList class.

Description of the change

Just changed from std:array to QList class.

The reason for that was a compiler error:

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DREGRESSION_TEST_FOLDERLISTMODEL -DSIMULATE_LONG_ACTION -DDEBUG_EXT_FS_WATCHER -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I../ubuntu-filemanager-app/src/plugin/test_folderlistmodel/simpleUI -I../ubuntu-filemanager-app/src/plugin/folderlistmodel -I../ubuntu-filemanager-app/src/plugin/folderlistmodel/trash -I../ubuntu-filemanager-app/src/plugin/folderlistmodel/disk -I/usr/include/qt5 -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -I. -o dirmodel.o ../ubuntu-filemanager-app/src/plugin/folderlistmodel/dirmodel.cpp
In file included from /usr/include/c++/4.8/array:35:0,
                 from ../ubuntu-filemanager-app/src/plugin/folderlistmodel/dirmodel.cpp:71:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error:

#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
../ubuntu-filemanager-app/src/plugin/folderlistmodel/dirmodel.cpp:86:5: error: β€˜array’ in namespace β€˜std’ does not name a type
     std::array<QStandardPaths::StandardLocation, 5> mtpStandardLocations = {
     ^

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Builds and runs fine here with the change. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/folderlistmodel/dirmodel.cpp'
2--- src/plugin/folderlistmodel/dirmodel.cpp 2014-08-09 19:57:42 +0000
3+++ src/plugin/folderlistmodel/dirmodel.cpp 2014-09-03 22:11:15 +0000
4@@ -62,15 +62,13 @@
5 #include <QDateTime>
6 #include <QMimeType>
7 #include <QStandardPaths>
8+#include <QList>
9
10 #if defined(REGRESSION_TEST_FOLDERLISTMODEL)
11 # include <QColor>
12 # include <QBrush>
13 #endif
14
15-#include <array>
16-
17-
18
19 #define IS_VALID_ROW(row) (row >=0 && row < mDirectoryContents.count())
20 #define WARN_ROW_OUT_OF_RANGE(row) qWarning() << Q_FUNC_INFO << this << "row:" << row << "Out of bounds access"
21@@ -83,13 +81,14 @@
22 QHash<QByteArray, int> roleMapping;
23 QList<QString> mtpDirectories;
24
25- std::array<QStandardPaths::StandardLocation, 5> mtpStandardLocations = {
26- QStandardPaths::DocumentsLocation,
27- QStandardPaths::DownloadLocation,
28- QStandardPaths::MusicLocation,
29- QStandardPaths::PicturesLocation,
30- QStandardPaths::MoviesLocation
31- };
32+ QList<QStandardPaths::StandardLocation> mtpStandardLocations =
33+ QList<QStandardPaths::StandardLocation>()
34+ << QStandardPaths::DocumentsLocation
35+ << QStandardPaths::DownloadLocation
36+ << QStandardPaths::MusicLocation
37+ << QStandardPaths::PicturesLocation
38+ << QStandardPaths::MoviesLocation;
39+
40
41 void buildMTPDirectories() {
42 mtpDirectories.clear();

Subscribers

People subscribed via source and target branches