summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2014-12-17 18:16:25 (GMT)
committerMarco Martin <notmart@gmail.com>2014-12-17 18:16:25 (GMT)
commit78d8b1f6050205e0bd6c79a2a07788613c0fa961 (patch)
tree1e3e4811bf28b21cfe47c8d0575c770916405514
parent3d50fec102acd5d902bf40029fe20084ad7ecc5e (diff)
port the QML part
works correctly when a filename is fixed still to port the c++ app part
-rw-r--r--active/app/package/contents/ui/Bookmarks.qml2
-rw-r--r--active/app/package/contents/ui/Browser.qml14
-rw-r--r--active/app/package/contents/ui/FullScreenDelegate.qml14
-rw-r--r--active/app/package/contents/ui/TableOfContents.qml10
-rw-r--r--active/app/package/contents/ui/Thumbnails.qml8
-rw-r--r--active/app/package/contents/ui/ThumbnailsBase.qml20
-rw-r--r--active/app/package/contents/ui/TreeDelegate.qml10
-rw-r--r--active/app/package/contents/ui/main.qml11
-rw-r--r--active/components/documentitem.cpp2
-rw-r--r--active/components/documentitem.h6
10 files changed, 49 insertions, 48 deletions
diff --git a/active/app/package/contents/ui/Bookmarks.qml b/active/app/package/contents/ui/Bookmarks.qml
index a51e7b3..4b40233 100644
--- a/active/app/package/contents/ui/Bookmarks.qml
+++ b/active/app/package/contents/ui/Bookmarks.qml
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
+import QtQuick 2.1
ThumbnailsBase {
diff --git a/active/app/package/contents/ui/Browser.qml b/active/app/package/contents/ui/Browser.qml
index e95541c..1cdea18 100644
--- a/active/app/package/contents/ui/Browser.qml
+++ b/active/app/package/contents/ui/Browser.qml
@@ -17,13 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.extras 0.1 as PlasmaExtras
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
-import org.kde.qtextracomponents 0.1
-import org.kde.okular 0.1 as Okular
+import QtQuick 2.1
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
+import org.kde.kquickcontrolsaddons 2.0
+import org.kde.okular 2.0 as Okular
MobileComponents.OverlayDrawer {
diff --git a/active/app/package/contents/ui/FullScreenDelegate.qml b/active/app/package/contents/ui/FullScreenDelegate.qml
index 3cbf770..504e039 100644
--- a/active/app/package/contents/ui/FullScreenDelegate.qml
+++ b/active/app/package/contents/ui/FullScreenDelegate.qml
@@ -17,13 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.extras 0.1 as PlasmaExtra
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
-import org.kde.qtextracomponents 0.1
-import org.kde.okular 0.1 as Okular
+import QtQuick 2.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.extras 2.0 as PlasmaExtra
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
+import org.kde.kquickcontrolsaddons 2.0
+import org.kde.okular 2.0 as Okular
MouseEventListener {
id: root
diff --git a/active/app/package/contents/ui/TableOfContents.qml b/active/app/package/contents/ui/TableOfContents.qml
index c9fa764..79b0451 100644
--- a/active/app/package/contents/ui/TableOfContents.qml
+++ b/active/app/package/contents/ui/TableOfContents.qml
@@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.extras 0.1 as PlasmaExtras
-import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+import QtQuick 2.1
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.mobilecomponents 2.0 as MobileComponents
PlasmaComponents.Page {
property alias contentY: flickable.contentY
diff --git a/active/app/package/contents/ui/Thumbnails.qml b/active/app/package/contents/ui/Thumbnails.qml
index 0da889e..8260619 100644
--- a/active/app/package/contents/ui/Thumbnails.qml
+++ b/active/app/package/contents/ui/Thumbnails.qml
@@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+import QtQuick 2.1
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
ThumbnailsBase {
id: root
diff --git a/active/app/package/contents/ui/ThumbnailsBase.qml b/active/app/package/contents/ui/ThumbnailsBase.qml
index 968effa..be99f59 100644
--- a/active/app/package/contents/ui/ThumbnailsBase.qml
+++ b/active/app/package/contents/ui/ThumbnailsBase.qml
@@ -17,12 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.okular 0.1 as Okular
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.extras 0.1 as PlasmaExtras
-import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
+import QtQuick 2.1
+import org.kde.okular 2.0 as Okular
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
PlasmaComponents.Page {
id: root
@@ -41,8 +41,8 @@ PlasmaComponents.Page {
id: resultsGrid
anchors.fill: parent
- cellWidth: theme.defaultFont.mSize.width * 14
- cellHeight: theme.defaultFont.mSize.height * 12
+ cellWidth: theme.mSize(theme.defaultFont).width * 14
+ cellHeight: theme.mSize(theme.defaultFont).height * 12
delegate: Item {
width: resultsGrid.cellWidth
@@ -66,9 +66,9 @@ PlasmaComponents.Page {
y: parent.margins.top
document: documentItem
pageNumber: modelData
- width: theme.defaultFont.mSize.width * 10
+ width: theme.mSize(theme.defaultFont).width * 10
//value repeated to avoid binding loops
- height: Math.round(theme.defaultFont.mSize.width * 10 / (implicitWidth/implicitHeight))
+ height: Math.round(theme.mSize(theme.defaultFont).width * 10 / (implicitWidth/implicitHeight))
Rectangle {
width: childrenRect.width
height: childrenRect.height
diff --git a/active/app/package/contents/ui/TreeDelegate.qml b/active/app/package/contents/ui/TreeDelegate.qml
index 3588623..88c5b68 100644
--- a/active/app/package/contents/ui/TreeDelegate.qml
+++ b/active/app/package/contents/ui/TreeDelegate.qml
@@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.qtextracomponents 0.1
+import QtQuick 2.1
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.qtextracomponents 2.0
Column {
id: treeDelegate
@@ -66,7 +66,7 @@ Column {
//there isn't a sane way to do a dotted line in QML1
Rectangle {
color: theme.textColor
- opacity: 0.1
+ opacity: 2.0
height: 1
anchors {
bottom: parent.bottom
diff --git a/active/app/package/contents/ui/main.qml b/active/app/package/contents/ui/main.qml
index 7fca2b0..2cf2325 100644
--- a/active/app/package/contents/ui/main.qml
+++ b/active/app/package/contents/ui/main.qml
@@ -17,10 +17,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.okular 0.1 as Okular
-import org.kde.plasma.extras 0.1 as PlasmaExtras
-import org.kde.plasma.components 0.1 as PlasmaComponents
+import QtQuick 2.1
+import org.kde.okular 2.0 as Okular
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.components 2.0 as PlasmaComponents
Image {
id: fileBrowserRoot
@@ -31,10 +31,11 @@ Image {
width: 360
height: 360
+ /*TODO: port ResourceInstance
PlasmaExtras.ResourceInstance {
id: resourceInstance
uri: documentItem.path
- }
+ }*/
Okular.DocumentItem {
id: documentItem
diff --git a/active/components/documentitem.cpp b/active/components/documentitem.cpp
index 6e185ef..399eed3 100644
--- a/active/components/documentitem.cpp
+++ b/active/components/documentitem.cpp
@@ -119,7 +119,7 @@ int DocumentItem::pageCount() const
return m_document->pages();
}
-QList<int> DocumentItem::matchingPages() const
+QVariantList DocumentItem::matchingPages() const
{
return m_matchingPages;
}
diff --git a/active/components/documentitem.h b/active/components/documentitem.h
index a421a0a..6bef385 100644
--- a/active/components/documentitem.h
+++ b/active/components/documentitem.h
@@ -76,7 +76,7 @@ class DocumentItem : public QObject
/**
* A list of all pages that contain a match for the search terms. If no text has been searched, all pages are returned.
*/
- Q_PROPERTY(QList<int> matchingPages READ matchingPages NOTIFY matchingPagesChanged)
+ Q_PROPERTY(QVariantList matchingPages READ matchingPages NOTIFY matchingPagesChanged)
/**
* Table of contents for the document, if available
@@ -114,7 +114,7 @@ public:
bool isSearchInProgress() const;
- QList<int> matchingPages() const;
+ QVariantList matchingPages() const;
TOCModel *tableOfContents() const;
@@ -160,7 +160,7 @@ private:
TOCModel *m_tocModel;
Observer *m_thumbnailObserver;
Observer *m_pageviewObserver;
- QList<int> m_matchingPages;
+ QVariantList m_matchingPages;
bool m_searchInProgress;
};