@@ -65,26 +65,30 @@ void ResultsTest::testAllColumns()
6565
6666void ResultsTest::testIconColumn_data()
6767{
68+ QTest::addColumn<QString>("uri");
6869 QTest::addColumn<QString>("giconString");
6970 QTest::addColumn<QString>("result");
7071
71− QTest::newRow("absolute path") << "/usr/share/icons/example.png" << "/usr/share/icons/example.png";
72− QTest::newRow("file uri") << "file:///usr/share/icons/example.png" << "file:///usr/share/icons/example.png";
73− QTest::newRow("http uri") << "http://images.ubuntu.com/example.jpg" << "http://images.ubuntu.com/example.jpg";
74− QTest::newRow("image uri") << "image://thumbnail/with/arguments?passed_to=ImageProvider" << "image://thumbnail/with/arguments?passed_to=ImageProvider";
75− QTest::newRow("themed icon") << "accessories-other" << "image://theme/accessories-other";
76− QTest::newRow("fileicon") << ". GFileIcon http://example.org/resource.gif" << "http://example.org/resource.gif";
77− QTest::newRow("themedicon") << ". GThemedIcon accessories-other accessories generic" << "image://theme/accessories-other,accessories,generic";
78− QTest::newRow("annotatedicon") << ". UnityProtocolAnnotatedIcon %7B'base-icon':%20%3C'.%20GThemedIcon%20accessories-other%20accessories%20generic'%3E%7D" << "image://theme/accessories-other,accessories,generic";
72+ QTest::newRow("unspecified") << "test:uri" << "" << "";
73+ QTest::newRow("absolute path") << "test:uri" << "/usr/share/icons/example.png" << "/usr/share/icons/example.png";
74+ QTest::newRow("file uri") << "test:uri" << "file:///usr/share/icons/example.png" << "file:///usr/share/icons/example.png";
75+ QTest::newRow("http uri") << "test:uri" << "http://images.ubuntu.com/example.jpg" << "http://images.ubuntu.com/example.jpg";
76+ QTest::newRow("image uri") << "test:uri" << "image://thumbnail/with/arguments?passed_to=ImageProvider" << "image://thumbnail/with/arguments?passed_to=ImageProvider";
77+ QTest::newRow("themed icon") << "test:uri" << "accessories-other" << "image://theme/accessories-other";
78+ QTest::newRow("fileicon") << "test:uri" << ". GFileIcon http://example.org/resource.gif" << "http://example.org/resource.gif";
79+ QTest::newRow("themedicon") << "test:uri" << ". GThemedIcon accessories-other accessories generic" << "image://theme/accessories-other,accessories,generic";
80+ QTest::newRow("annotatedicon") << "test:uri" << ". UnityProtocolAnnotatedIcon %7B'base-icon':%20%3C'.%20GThemedIcon%20accessories-other%20accessories%20generic'%3E%7D" << "image://theme/accessories-other,accessories,generic";
81+ QTest::newRow("thumbnailer icon") << "file:///usr/share/samples/video/foo.avi" << "" << "image://thumbnailer//usr/share/samples/video/foo.avi";
7982}
8083
8184void ResultsTest::testIconColumn()
8285{
86+ QFETCH(QString, uri);
8387 QFETCH(QString, giconString);
8488 QFETCH(QString, result);
8589 auto deeModel = createBackendModel();
8690 dee_model_append (deeModel,
87− "test:uri",
91+ uri.toLocal8Bit().constData(),
8892 giconString.toLocal8Bit().constData(),
8993 0,
9094 0,