Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Superseded
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support
Merge into: lp:ubuntu-docviewer-app
Prerequisite: lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk-bottom-edge
Diff against target: 3349 lines (+1451/-991)
29 files modified
debian/control (+3/-1)
po/com.ubuntu.docviewer.pot (+23/-34)
po/ja.po (+0/-448)
po/ro.po (+0/-449)
src/app/qml/common/ContentHubProxy.qml (+5/-5)
src/app/qml/common/DetailsPage.qml (+2/-2)
src/app/qml/common/PickImportedDialog.qml (+1/-1)
src/app/qml/loView/LOViewDefaultHeader.qml (+1/-1)
src/app/qml/loView/LOViewPage.qml (+1/-1)
src/app/qml/pdfView/PdfView.qml (+2/-5)
src/app/qml/textView/TextView.qml (+1/-1)
src/app/qml/ubuntu-docviewer-app.qml (+8/-1)
src/plugin/file-qml-plugin/CMakeLists.txt (+27/-2)
src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt (+39/-0)
src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp (+288/-0)
src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h (+98/-0)
src/plugin/file-qml-plugin/InputInfo/plugin.cpp (+32/-0)
src/plugin/file-qml-plugin/InputInfo/plugin.h (+30/-0)
src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp (+196/-0)
src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h (+102/-0)
src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp (+270/-0)
src/plugin/file-qml-plugin/InputInfo/qinputinfo.h (+143/-0)
src/plugin/file-qml-plugin/InputInfo/qmldir (+3/-0)
src/plugin/file-qml-plugin/backend.cpp (+21/-10)
src/plugin/file-qml-plugin/documentmodel.cpp (+2/-2)
src/plugin/file-qml-plugin/fileutils.cpp (+11/-21)
src/plugin/file-qml-plugin/fileutils.h (+4/-7)
src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp (+82/-0)
src/plugin/file-qml-plugin/ubuntuconvergenceutils.h (+56/-0)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support
Reviewer Review Type Date Requested Status
Stefano Verzegnassi Disapprove
Nicholas Skaggs (community) Needs Fixing
Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+282639@code.launchpad.net

Commit message

Better desktop/pocket-desktop support, by detecting the number of mice and touchpads connected to the device. This uses QInputInfo, available in the Qt snapshots - imported version from unity 8 trunk (rev.2080).

WORKAROUND: This makes new BottomEdge component fully working on desktop

Description of the change

Better desktop/pocket-desktop support, by detecting the number of mice and touchpads connected to the device. This uses QInputInfo, available in the Qt snapshots - imported version from unity 8 trunk (rev.2080).

WORKAROUND: This makes new BottomEdge component fully working on desktop

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
242. By Stefano Verzegnassi

Added translation committed in trunk, removed by mistake

243. By Stefano Verzegnassi

updated pot

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Text conflict in po/com.ubuntu.docviewer.pot
Conflict adding file po/ja.po. Moved existing file to po/ja.po.moved.
Conflict adding file po/ro.po. Moved existing file to po/ro.po.moved.
Text conflict in src/app/qml/loView/LOViewPage.qml
Text conflict in src/app/qml/pdfView/PdfView.qml
5 conflicts encountered.
bzr: ERROR: Conflicts from merge

review: Needs Fixing
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

I did some mistake when I merged trunk (.po conflicts). I will create a new branch for this and propose a new MP.

review: Disapprove

Unmerged revisions

243. By Stefano Verzegnassi

updated pot

242. By Stefano Verzegnassi

Added translation committed in trunk, removed by mistake

241. By Stefano Verzegnassi

Added 'mouseAttached' property so that BottomEdgeHint can properly work on desktop

240. By Stefano Verzegnassi

Merged trunk

239. By Stefano Verzegnassi

Added ConvergenceUtils singleton. Improved desktop/pocket desktop support.

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 2015-11-27 16:39:21 +0000
3+++ debian/control 2016-01-14 17:54:32 +0000
4@@ -17,7 +17,9 @@
5 qtdeclarative5-qtquick2-plugin,
6 qtdeclarative5-private-dev,
7 qtbase5-private-dev,
8- qtdeclarative5-test-plugin
9+ qtdeclarative5-test-plugin,
10+ libudev-dev,
11+ libevdev-dev,
12 Standards-Version: 3.9.6
13 Section: misc
14 Homepage: https://launchpad.net/ubuntu-docviewer-app
15
16=== modified file 'po/com.ubuntu.docviewer.pot'
17--- po/com.ubuntu.docviewer.pot 2016-01-14 17:54:32 +0000
18+++ po/com.ubuntu.docviewer.pot 2016-01-14 17:54:32 +0000
19@@ -8,11 +8,7 @@
20 msgstr ""
21 "Project-Id-Version: \n"
22 "Report-Msgid-Bugs-To: \n"
23-<<<<<<< TREE
24-"POT-Creation-Date: 2015-12-27 13:06+0100\n"
25-=======
26-"POT-Creation-Date: 2015-12-15 20:33+0100\n"
27->>>>>>> MERGE-SOURCE
28+"POT-Creation-Date: 2016-01-14 18:54+0100\n"
29 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
30 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
31 "Language-Team: LANGUAGE <LL@li.org>\n"
32@@ -46,7 +42,7 @@
33
34 #: ../src/app/qml/common/DetailsPage.qml:26
35 #: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
36-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
37+#: ../src/app/qml/pdfView/PdfView.qml:224
38 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
39 msgid "Details"
40 msgstr ""
41@@ -121,6 +117,7 @@
42 #: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
43 #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
44 #: ../src/app/qml/loView/LOViewGotoDialog.qml:55
45+#: ../src/app/qml/pdfView/PdfView.qml:177
46 #: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
47 msgid "Cancel"
48 msgstr ""
49@@ -193,33 +190,33 @@
50
51 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
52 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
53-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
54+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:103
55 #, qt-format
56 msgid "Today, %1"
57 msgstr ""
58
59 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
60 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
61-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
62+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:108
63 #, qt-format
64 msgid "Yesterday, %1"
65 msgstr ""
66
67 #. TRANSLATORS: this is a datetime formatting string,
68 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
69-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
70-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
71+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:115
72+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:134
73 msgid "yyyy/MM/dd hh:mm"
74 msgstr ""
75
76 #. TRANSLATORS: this is a datetime formatting string,
77 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
78-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
79+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:128
80 msgid "dddd, hh:mm"
81 msgstr ""
82
83 #: ../src/app/qml/documentPage/DocumentPage.qml:23
84-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
85+#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
86 msgid "Documents"
87 msgstr ""
88
89@@ -346,13 +343,13 @@
90 msgstr ""
91
92 #: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
93-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
94+#: ../src/app/qml/pdfView/PdfView.qml:217
95 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
96 msgid "Disable night mode"
97 msgstr ""
98
99 #: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
100-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
101+#: ../src/app/qml/pdfView/PdfView.qml:217
102 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
103 msgid "Enable night mode"
104 msgstr ""
105@@ -396,31 +393,23 @@
106 msgstr ""
107
108 #. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
109-#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
110-<<<<<<< TREE
111-#: ../src/app/qml/pdfView/PdfView.qml:38
112-=======
113-#: ../src/app/qml/pdfView/PdfView.qml:40
114->>>>>>> MERGE-SOURCE
115+#: ../src/app/qml/pdfView/PdfContentsPage.qml:31
116+#: ../src/app/qml/pdfView/PdfView.qml:150
117 msgid "Contents"
118 msgstr ""
119
120-#: ../src/app/qml/pdfView/PdfContentsPage.qml:33
121-msgid "Hide table of contents"
122-msgstr ""
123-
124 #. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
125 #. while the second one (%2) refers to the total pages count.
126-<<<<<<< TREE
127-#: ../src/app/qml/pdfView/PdfView.qml:35
128-=======
129-#: ../src/app/qml/pdfView/PdfView.qml:32
130->>>>>>> MERGE-SOURCE
131+#: ../src/app/qml/pdfView/PdfView.qml:56
132 #, qt-format
133 msgid "Page %1 of %2"
134 msgstr ""
135
136-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
137+#: ../src/app/qml/pdfView/PdfView.qml:200
138+msgid "Search"
139+msgstr ""
140+
141+#: ../src/app/qml/pdfView/PdfView.qml:210
142 msgid "Go to page..."
143 msgstr ""
144
145@@ -433,7 +422,7 @@
146 msgid "Choose a page between 1 and %1"
147 msgstr ""
148
149-#: ../src/app/qml/ubuntu-docviewer-app.qml:124
150+#: ../src/app/qml/ubuntu-docviewer-app.qml:118
151 msgid "File does not exist."
152 msgstr ""
153
154@@ -446,15 +435,15 @@
155 #.
156 #. where "2" is given by the argument "%1"
157 #.
158-#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
159+#: ../src/plugin/file-qml-plugin/fileutils.cpp:101
160 #, qt-format
161 msgid "copy %1"
162 msgstr ""
163
164-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
165+#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
166 msgid "Document Viewer"
167 msgstr ""
168
169-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
170+#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
171 msgid "documents;viewer;pdf;reader;"
172 msgstr ""
173
174=== removed file 'po/ja.po'
175--- po/ja.po 2016-01-05 05:47:43 +0000
176+++ po/ja.po 1970-01-01 00:00:00 +0000
177@@ -1,448 +0,0 @@
178-# Japanese translation for ubuntu-docviewer-app
179-# Copyright (c) 2016 Rosetta Contributors and Canonical Ltd 2016
180-# This file is distributed under the same license as the ubuntu-docviewer-app package.
181-# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
182-#
183-msgid ""
184-msgstr ""
185-"Project-Id-Version: ubuntu-docviewer-app\n"
186-"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
187-"POT-Creation-Date: 2015-12-27 13:06+0100\n"
188-"PO-Revision-Date: 2016-01-03 18:49+0000\n"
189-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
190-"Language-Team: Japanese <ja@li.org>\n"
191-"MIME-Version: 1.0\n"
192-"Content-Type: text/plain; charset=UTF-8\n"
193-"Content-Transfer-Encoding: 8bit\n"
194-"Plural-Forms: nplurals=1; plural=0;\n"
195-"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
196-"X-Generator: Launchpad (build 17876)\n"
197-
198-#: ../src/app/qml/common/CommandLineProxy.qml:49
199-msgid "Some of the provided arguments are not valid."
200-msgstr ""
201-
202-#: ../src/app/qml/common/CommandLineProxy.qml:58
203-msgid "Open ubuntu-docviewer-app displaying the selected file"
204-msgstr ""
205-
206-#: ../src/app/qml/common/CommandLineProxy.qml:65
207-msgid "Run fullscreen"
208-msgstr ""
209-
210-#: ../src/app/qml/common/CommandLineProxy.qml:71
211-msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
212-msgstr ""
213-
214-#: ../src/app/qml/common/CommandLineProxy.qml:77
215-msgid ""
216-"Show documents from the given folder, instead of ~/Documents.\n"
217-"The path must exist prior to running ubuntu-docviewer-app"
218-msgstr ""
219-
220-#: ../src/app/qml/common/DetailsPage.qml:26
221-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
222-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
223-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
224-msgid "Details"
225-msgstr ""
226-
227-#: ../src/app/qml/common/DetailsPage.qml:42
228-msgid "File"
229-msgstr ""
230-
231-#: ../src/app/qml/common/DetailsPage.qml:47
232-msgid "Location"
233-msgstr ""
234-
235-#: ../src/app/qml/common/DetailsPage.qml:52
236-msgid "Size"
237-msgstr ""
238-
239-#: ../src/app/qml/common/DetailsPage.qml:57
240-msgid "Created"
241-msgstr ""
242-
243-#: ../src/app/qml/common/DetailsPage.qml:62
244-msgid "Last modified"
245-msgstr ""
246-
247-#: ../src/app/qml/common/DetailsPage.qml:69
248-msgid "MIME type"
249-msgstr ""
250-
251-#: ../src/app/qml/common/ErrorDialog.qml:23
252-msgid "Error"
253-msgstr ""
254-
255-#: ../src/app/qml/common/ErrorDialog.qml:26
256-#: ../src/app/qml/common/PickImportedDialog.qml:54
257-#: ../src/app/qml/common/RejectedImportDialog.qml:38
258-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
259-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
260-msgid "Close"
261-msgstr ""
262-
263-#: ../src/app/qml/common/PickImportedDialog.qml:29
264-msgid "Multiple documents imported"
265-msgstr ""
266-
267-#: ../src/app/qml/common/PickImportedDialog.qml:30
268-msgid "Choose which one to open:"
269-msgstr ""
270-
271-#: ../src/app/qml/common/RejectedImportDialog.qml:28
272-msgid "File not supported"
273-msgid_plural "Files not supported"
274-msgstr[0] ""
275-msgstr[1] ""
276-
277-#: ../src/app/qml/common/RejectedImportDialog.qml:29
278-msgid "Following document has not been imported:"
279-msgid_plural "Following documents have not been imported:"
280-msgstr[0] ""
281-msgstr[1] ""
282-
283-#: ../src/app/qml/common/UnknownTypeDialog.qml:27
284-msgid "Unknown file type"
285-msgstr ""
286-
287-#: ../src/app/qml/common/UnknownTypeDialog.qml:28
288-msgid ""
289-"This file is not supported.\n"
290-"Do you want to open it as a plain text?"
291-msgstr ""
292-
293-#: ../src/app/qml/common/UnknownTypeDialog.qml:38
294-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
295-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
296-#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
297-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
298-msgid "Cancel"
299-msgstr ""
300-
301-#: ../src/app/qml/common/UnknownTypeDialog.qml:44
302-msgid "Yes"
303-msgstr ""
304-
305-#. TRANSLATORS: %1 is the size of a file, expressed in GB
306-#: ../src/app/qml/common/utils.js:22
307-#, qt-format
308-msgid "%1 GB"
309-msgstr ""
310-
311-#. TRANSLATORS: %1 is the size of a file, expressed in MB
312-#: ../src/app/qml/common/utils.js:26
313-#, qt-format
314-msgid "%1 MB"
315-msgstr ""
316-
317-#. TRANSLATORS: %1 is the size of a file, expressed in kB
318-#: ../src/app/qml/common/utils.js:30
319-#, qt-format
320-msgid "%1 kB"
321-msgstr ""
322-
323-#. TRANSLATORS: %1 is the size of a file, expressed in byte
324-#: ../src/app/qml/common/utils.js:33
325-#, qt-format
326-msgid "%1 byte"
327-msgstr ""
328-
329-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
330-msgid "Delete file"
331-msgstr ""
332-
333-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
334-#, qt-format
335-msgid "Delete %1 file"
336-msgid_plural "Delete %1 files"
337-msgstr[0] ""
338-msgstr[1] ""
339-
340-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
341-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
342-msgid "Are you sure you want to permanently delete this file?"
343-msgid_plural "Are you sure you want to permanently delete these files?"
344-msgstr[0] ""
345-msgstr[1] ""
346-
347-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
348-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
349-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
350-msgid "Delete"
351-msgstr ""
352-
353-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
354-msgid "Share"
355-msgstr ""
356-
357-#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
358-msgid "No document found"
359-msgstr ""
360-
361-#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
362-msgid ""
363-"Connect your device to any computer and simply drag files to the Documents "
364-"folder or insert removable media with documents."
365-msgstr ""
366-
367-#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
368-#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
369-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
370-#, qt-format
371-msgid "Today, %1"
372-msgstr ""
373-
374-#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
375-#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
376-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
377-#, qt-format
378-msgid "Yesterday, %1"
379-msgstr ""
380-
381-#. TRANSLATORS: this is a datetime formatting string,
382-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
383-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
384-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
385-msgid "yyyy/MM/dd hh:mm"
386-msgstr ""
387-
388-#. TRANSLATORS: this is a datetime formatting string,
389-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
390-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
391-msgid "dddd, hh:mm"
392-msgstr ""
393-
394-#: ../src/app/qml/documentPage/DocumentPage.qml:23
395-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
396-msgid "Documents"
397-msgstr ""
398-
399-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
400-msgid "Search..."
401-msgstr ""
402-
403-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
404-msgid "Sorting settings..."
405-msgstr ""
406-
407-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
408-msgid "Switch to single column list"
409-msgstr ""
410-
411-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
412-msgid "Switch to grid"
413-msgstr ""
414-
415-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
416-msgid "Pick"
417-msgstr ""
418-
419-#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
420-msgid "Back"
421-msgstr ""
422-
423-#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
424-msgid "search in documents..."
425-msgstr ""
426-
427-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
428-msgid "Select None"
429-msgstr ""
430-
431-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
432-msgid "Select All"
433-msgstr ""
434-
435-#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
436-msgid "No matching document found"
437-msgstr ""
438-
439-#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
440-msgid ""
441-"Please ensure that your query is not misspelled and/or try a different query."
442-msgstr ""
443-
444-#: ../src/app/qml/documentPage/SectionHeader.qml:13
445-msgid "Today"
446-msgstr ""
447-
448-#: ../src/app/qml/documentPage/SectionHeader.qml:16
449-msgid "Yesterday"
450-msgstr ""
451-
452-#: ../src/app/qml/documentPage/SectionHeader.qml:19
453-msgid "Earlier this week"
454-msgstr ""
455-
456-#: ../src/app/qml/documentPage/SectionHeader.qml:22
457-msgid "Earlier this month"
458-msgstr ""
459-
460-#: ../src/app/qml/documentPage/SectionHeader.qml:24
461-msgid "Even earlier..."
462-msgstr ""
463-
464-#: ../src/app/qml/documentPage/SharePage.qml:23
465-msgid "Share to"
466-msgstr ""
467-
468-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
469-msgid "Sorting settings"
470-msgstr ""
471-
472-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
473-msgid "Sort by date (Latest first)"
474-msgstr ""
475-
476-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
477-msgid "Sort by name (A-Z)"
478-msgstr ""
479-
480-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
481-msgid "Sort by size (Smaller first)"
482-msgstr ""
483-
484-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
485-msgid "Reverse order"
486-msgstr ""
487-
488-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
489-#: ../src/app/qml/textView/TextView.qml:43
490-msgid "Loading..."
491-msgstr ""
492-
493-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
494-msgid "LibreOffice text document"
495-msgstr ""
496-
497-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
498-msgid "LibreOffice spread sheet"
499-msgstr ""
500-
501-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
502-msgid "LibreOffice presentation"
503-msgstr ""
504-
505-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
506-msgid "LibreOffice Draw document"
507-msgstr ""
508-
509-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
510-msgid "Unknown LibreOffice document"
511-msgstr ""
512-
513-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
514-msgid "Unknown type document"
515-msgstr ""
516-
517-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
518-msgid "Go to position..."
519-msgstr ""
520-
521-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
522-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
523-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
524-msgid "Disable night mode"
525-msgstr ""
526-
527-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
528-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
529-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
530-msgid "Enable night mode"
531-msgstr ""
532-
533-#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
534-msgid "Go to position"
535-msgstr ""
536-
537-#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
538-msgid "Choose a position between 1% and 100%"
539-msgstr ""
540-
541-#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
542-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
543-msgid "GO!"
544-msgstr ""
545-
546-#: ../src/app/qml/loView/LOViewPage.qml:129
547-msgid "LibreOffice binaries not found."
548-msgstr ""
549-
550-#: ../src/app/qml/loView/LOViewPage.qml:132
551-msgid "Error while loading LibreOffice."
552-msgstr ""
553-
554-#: ../src/app/qml/loView/LOViewPage.qml:135
555-msgid ""
556-"Document not loaded.\n"
557-"The requested document may be corrupt or protected by a password."
558-msgstr ""
559-
560-#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
561-#. Document Viewer for rendering LibreOffice/MS-Office documents.
562-#. Ref. https://docs.libreoffice.org/libreofficekit.html
563-#: ../src/app/qml/loView/Splashscreen.qml:45
564-msgid "Powered by LibreOfficeKit"
565-msgstr ""
566-
567-#: ../src/app/qml/loView/ZoomSelector.qml:110
568-msgid "Fit width"
569-msgstr ""
570-
571-#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
572-#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
573-#: ../src/app/qml/pdfView/PdfView.qml:38
574-msgid "Contents"
575-msgstr ""
576-
577-#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
578-msgid "Hide table of contents"
579-msgstr ""
580-
581-#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
582-#. while the second one (%2) refers to the total pages count.
583-#: ../src/app/qml/pdfView/PdfView.qml:35
584-#, qt-format
585-msgid "Page %1 of %2"
586-msgstr ""
587-
588-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
589-msgid "Go to page..."
590-msgstr ""
591-
592-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
593-msgid "Go to page"
594-msgstr ""
595-
596-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
597-#, qt-format
598-msgid "Choose a page between 1 and %1"
599-msgstr ""
600-
601-#: ../src/app/qml/ubuntu-docviewer-app.qml:118
602-msgid "File does not exist."
603-msgstr ""
604-
605-#. TRANSLATORS: This string is used for renaming a copied file,
606-#. when a file with the same name already exists in user's
607-#. Documents folder.
608-#.
609-#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
610-#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
611-#.
612-#. where "2" is given by the argument "%1"
613-#.
614-#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
615-#, qt-format
616-msgid "copy %1"
617-msgstr ""
618-
619-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
620-msgid "Document Viewer"
621-msgstr ""
622-
623-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
624-msgid "documents;viewer;pdf;reader;"
625-msgstr ""
626
627=== added file 'po/ro.po'
628--- po/ro.po 1970-01-01 00:00:00 +0000
629+++ po/ro.po 2016-01-14 17:54:32 +0000
630@@ -0,0 +1,449 @@
631+# Romanian translation for ubuntu-docviewer-app
632+# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
633+# This file is distributed under the same license as the ubuntu-docviewer-app package.
634+# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
635+#
636+msgid ""
637+msgstr ""
638+"Project-Id-Version: ubuntu-docviewer-app\n"
639+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
640+"POT-Creation-Date: 2015-12-27 13:06+0100\n"
641+"PO-Revision-Date: 2015-12-23 20:27+0000\n"
642+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
643+"Language-Team: Romanian <ro@li.org>\n"
644+"MIME-Version: 1.0\n"
645+"Content-Type: text/plain; charset=UTF-8\n"
646+"Content-Transfer-Encoding: 8bit\n"
647+"Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 "
648+"== 0) && (n != 0))) ? 2: 1));\n"
649+"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
650+"X-Generator: Launchpad (build 17876)\n"
651+
652+#: ../src/app/qml/common/CommandLineProxy.qml:49
653+msgid "Some of the provided arguments are not valid."
654+msgstr ""
655+
656+#: ../src/app/qml/common/CommandLineProxy.qml:58
657+msgid "Open ubuntu-docviewer-app displaying the selected file"
658+msgstr ""
659+
660+#: ../src/app/qml/common/CommandLineProxy.qml:65
661+msgid "Run fullscreen"
662+msgstr ""
663+
664+#: ../src/app/qml/common/CommandLineProxy.qml:71
665+msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
666+msgstr ""
667+
668+#: ../src/app/qml/common/CommandLineProxy.qml:77
669+msgid ""
670+"Show documents from the given folder, instead of ~/Documents.\n"
671+"The path must exist prior to running ubuntu-docviewer-app"
672+msgstr ""
673+
674+#: ../src/app/qml/common/DetailsPage.qml:26
675+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
676+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
677+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
678+msgid "Details"
679+msgstr ""
680+
681+#: ../src/app/qml/common/DetailsPage.qml:42
682+msgid "File"
683+msgstr ""
684+
685+#: ../src/app/qml/common/DetailsPage.qml:47
686+msgid "Location"
687+msgstr ""
688+
689+#: ../src/app/qml/common/DetailsPage.qml:52
690+msgid "Size"
691+msgstr ""
692+
693+#: ../src/app/qml/common/DetailsPage.qml:57
694+msgid "Created"
695+msgstr ""
696+
697+#: ../src/app/qml/common/DetailsPage.qml:62
698+msgid "Last modified"
699+msgstr ""
700+
701+#: ../src/app/qml/common/DetailsPage.qml:69
702+msgid "MIME type"
703+msgstr ""
704+
705+#: ../src/app/qml/common/ErrorDialog.qml:23
706+msgid "Error"
707+msgstr ""
708+
709+#: ../src/app/qml/common/ErrorDialog.qml:26
710+#: ../src/app/qml/common/PickImportedDialog.qml:54
711+#: ../src/app/qml/common/RejectedImportDialog.qml:38
712+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
713+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
714+msgid "Close"
715+msgstr ""
716+
717+#: ../src/app/qml/common/PickImportedDialog.qml:29
718+msgid "Multiple documents imported"
719+msgstr ""
720+
721+#: ../src/app/qml/common/PickImportedDialog.qml:30
722+msgid "Choose which one to open:"
723+msgstr ""
724+
725+#: ../src/app/qml/common/RejectedImportDialog.qml:28
726+msgid "File not supported"
727+msgid_plural "Files not supported"
728+msgstr[0] ""
729+msgstr[1] ""
730+
731+#: ../src/app/qml/common/RejectedImportDialog.qml:29
732+msgid "Following document has not been imported:"
733+msgid_plural "Following documents have not been imported:"
734+msgstr[0] ""
735+msgstr[1] ""
736+
737+#: ../src/app/qml/common/UnknownTypeDialog.qml:27
738+msgid "Unknown file type"
739+msgstr ""
740+
741+#: ../src/app/qml/common/UnknownTypeDialog.qml:28
742+msgid ""
743+"This file is not supported.\n"
744+"Do you want to open it as a plain text?"
745+msgstr ""
746+
747+#: ../src/app/qml/common/UnknownTypeDialog.qml:38
748+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
749+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
750+#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
751+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
752+msgid "Cancel"
753+msgstr ""
754+
755+#: ../src/app/qml/common/UnknownTypeDialog.qml:44
756+msgid "Yes"
757+msgstr ""
758+
759+#. TRANSLATORS: %1 is the size of a file, expressed in GB
760+#: ../src/app/qml/common/utils.js:22
761+#, qt-format
762+msgid "%1 GB"
763+msgstr ""
764+
765+#. TRANSLATORS: %1 is the size of a file, expressed in MB
766+#: ../src/app/qml/common/utils.js:26
767+#, qt-format
768+msgid "%1 MB"
769+msgstr ""
770+
771+#. TRANSLATORS: %1 is the size of a file, expressed in kB
772+#: ../src/app/qml/common/utils.js:30
773+#, qt-format
774+msgid "%1 kB"
775+msgstr ""
776+
777+#. TRANSLATORS: %1 is the size of a file, expressed in byte
778+#: ../src/app/qml/common/utils.js:33
779+#, qt-format
780+msgid "%1 byte"
781+msgstr ""
782+
783+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
784+msgid "Delete file"
785+msgstr ""
786+
787+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
788+#, qt-format
789+msgid "Delete %1 file"
790+msgid_plural "Delete %1 files"
791+msgstr[0] ""
792+msgstr[1] ""
793+
794+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
795+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
796+msgid "Are you sure you want to permanently delete this file?"
797+msgid_plural "Are you sure you want to permanently delete these files?"
798+msgstr[0] ""
799+msgstr[1] ""
800+
801+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
802+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
803+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
804+msgid "Delete"
805+msgstr ""
806+
807+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
808+msgid "Share"
809+msgstr ""
810+
811+#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
812+msgid "No document found"
813+msgstr ""
814+
815+#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
816+msgid ""
817+"Connect your device to any computer and simply drag files to the Documents "
818+"folder or insert removable media with documents."
819+msgstr ""
820+
821+#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
822+#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
823+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
824+#, qt-format
825+msgid "Today, %1"
826+msgstr ""
827+
828+#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
829+#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
830+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
831+#, qt-format
832+msgid "Yesterday, %1"
833+msgstr ""
834+
835+#. TRANSLATORS: this is a datetime formatting string,
836+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
837+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
838+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
839+msgid "yyyy/MM/dd hh:mm"
840+msgstr ""
841+
842+#. TRANSLATORS: this is a datetime formatting string,
843+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
844+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
845+msgid "dddd, hh:mm"
846+msgstr ""
847+
848+#: ../src/app/qml/documentPage/DocumentPage.qml:23
849+#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
850+msgid "Documents"
851+msgstr ""
852+
853+#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
854+msgid "Search..."
855+msgstr ""
856+
857+#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
858+msgid "Sorting settings..."
859+msgstr ""
860+
861+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
862+msgid "Switch to single column list"
863+msgstr ""
864+
865+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
866+msgid "Switch to grid"
867+msgstr ""
868+
869+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
870+msgid "Pick"
871+msgstr ""
872+
873+#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
874+msgid "Back"
875+msgstr ""
876+
877+#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
878+msgid "search in documents..."
879+msgstr ""
880+
881+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
882+msgid "Select None"
883+msgstr ""
884+
885+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
886+msgid "Select All"
887+msgstr ""
888+
889+#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
890+msgid "No matching document found"
891+msgstr ""
892+
893+#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
894+msgid ""
895+"Please ensure that your query is not misspelled and/or try a different query."
896+msgstr ""
897+
898+#: ../src/app/qml/documentPage/SectionHeader.qml:13
899+msgid "Today"
900+msgstr ""
901+
902+#: ../src/app/qml/documentPage/SectionHeader.qml:16
903+msgid "Yesterday"
904+msgstr ""
905+
906+#: ../src/app/qml/documentPage/SectionHeader.qml:19
907+msgid "Earlier this week"
908+msgstr ""
909+
910+#: ../src/app/qml/documentPage/SectionHeader.qml:22
911+msgid "Earlier this month"
912+msgstr ""
913+
914+#: ../src/app/qml/documentPage/SectionHeader.qml:24
915+msgid "Even earlier..."
916+msgstr ""
917+
918+#: ../src/app/qml/documentPage/SharePage.qml:23
919+msgid "Share to"
920+msgstr ""
921+
922+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
923+msgid "Sorting settings"
924+msgstr ""
925+
926+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
927+msgid "Sort by date (Latest first)"
928+msgstr ""
929+
930+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
931+msgid "Sort by name (A-Z)"
932+msgstr ""
933+
934+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
935+msgid "Sort by size (Smaller first)"
936+msgstr ""
937+
938+#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
939+msgid "Reverse order"
940+msgstr ""
941+
942+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
943+#: ../src/app/qml/textView/TextView.qml:43
944+msgid "Loading..."
945+msgstr ""
946+
947+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
948+msgid "LibreOffice text document"
949+msgstr ""
950+
951+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
952+msgid "LibreOffice spread sheet"
953+msgstr ""
954+
955+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
956+msgid "LibreOffice presentation"
957+msgstr ""
958+
959+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
960+msgid "LibreOffice Draw document"
961+msgstr ""
962+
963+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
964+msgid "Unknown LibreOffice document"
965+msgstr ""
966+
967+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
968+msgid "Unknown type document"
969+msgstr ""
970+
971+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
972+msgid "Go to position..."
973+msgstr ""
974+
975+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
976+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
977+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
978+msgid "Disable night mode"
979+msgstr ""
980+
981+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
982+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
983+#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
984+msgid "Enable night mode"
985+msgstr ""
986+
987+#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
988+msgid "Go to position"
989+msgstr ""
990+
991+#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
992+msgid "Choose a position between 1% and 100%"
993+msgstr ""
994+
995+#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
996+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
997+msgid "GO!"
998+msgstr ""
999+
1000+#: ../src/app/qml/loView/LOViewPage.qml:129
1001+msgid "LibreOffice binaries not found."
1002+msgstr ""
1003+
1004+#: ../src/app/qml/loView/LOViewPage.qml:132
1005+msgid "Error while loading LibreOffice."
1006+msgstr ""
1007+
1008+#: ../src/app/qml/loView/LOViewPage.qml:135
1009+msgid ""
1010+"Document not loaded.\n"
1011+"The requested document may be corrupt or protected by a password."
1012+msgstr ""
1013+
1014+#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
1015+#. Document Viewer for rendering LibreOffice/MS-Office documents.
1016+#. Ref. https://docs.libreoffice.org/libreofficekit.html
1017+#: ../src/app/qml/loView/Splashscreen.qml:45
1018+msgid "Powered by LibreOfficeKit"
1019+msgstr ""
1020+
1021+#: ../src/app/qml/loView/ZoomSelector.qml:110
1022+msgid "Fit width"
1023+msgstr ""
1024+
1025+#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
1026+#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
1027+#: ../src/app/qml/pdfView/PdfView.qml:38
1028+msgid "Contents"
1029+msgstr ""
1030+
1031+#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
1032+msgid "Hide table of contents"
1033+msgstr ""
1034+
1035+#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
1036+#. while the second one (%2) refers to the total pages count.
1037+#: ../src/app/qml/pdfView/PdfView.qml:35
1038+#, qt-format
1039+msgid "Page %1 of %2"
1040+msgstr ""
1041+
1042+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
1043+msgid "Go to page..."
1044+msgstr ""
1045+
1046+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
1047+msgid "Go to page"
1048+msgstr ""
1049+
1050+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
1051+#, qt-format
1052+msgid "Choose a page between 1 and %1"
1053+msgstr ""
1054+
1055+#: ../src/app/qml/ubuntu-docviewer-app.qml:118
1056+msgid "File does not exist."
1057+msgstr ""
1058+
1059+#. TRANSLATORS: This string is used for renaming a copied file,
1060+#. when a file with the same name already exists in user's
1061+#. Documents folder.
1062+#.
1063+#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
1064+#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
1065+#.
1066+#. where "2" is given by the argument "%1"
1067+#.
1068+#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
1069+#, qt-format
1070+msgid "copy %1"
1071+msgstr ""
1072+
1073+#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
1074+msgid "Document Viewer"
1075+msgstr ""
1076+
1077+#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
1078+msgid "documents;viewer;pdf;reader;"
1079+msgstr ""
1080
1081=== removed file 'po/ro.po'
1082--- po/ro.po 2016-01-05 05:47:43 +0000
1083+++ po/ro.po 1970-01-01 00:00:00 +0000
1084@@ -1,449 +0,0 @@
1085-# Romanian translation for ubuntu-docviewer-app
1086-# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
1087-# This file is distributed under the same license as the ubuntu-docviewer-app package.
1088-# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
1089-#
1090-msgid ""
1091-msgstr ""
1092-"Project-Id-Version: ubuntu-docviewer-app\n"
1093-"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1094-"POT-Creation-Date: 2015-12-27 13:06+0100\n"
1095-"PO-Revision-Date: 2015-12-23 20:27+0000\n"
1096-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1097-"Language-Team: Romanian <ro@li.org>\n"
1098-"MIME-Version: 1.0\n"
1099-"Content-Type: text/plain; charset=UTF-8\n"
1100-"Content-Transfer-Encoding: 8bit\n"
1101-"Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 "
1102-"== 0) && (n != 0))) ? 2: 1));\n"
1103-"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
1104-"X-Generator: Launchpad (build 17876)\n"
1105-
1106-#: ../src/app/qml/common/CommandLineProxy.qml:49
1107-msgid "Some of the provided arguments are not valid."
1108-msgstr ""
1109-
1110-#: ../src/app/qml/common/CommandLineProxy.qml:58
1111-msgid "Open ubuntu-docviewer-app displaying the selected file"
1112-msgstr ""
1113-
1114-#: ../src/app/qml/common/CommandLineProxy.qml:65
1115-msgid "Run fullscreen"
1116-msgstr ""
1117-
1118-#: ../src/app/qml/common/CommandLineProxy.qml:71
1119-msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
1120-msgstr ""
1121-
1122-#: ../src/app/qml/common/CommandLineProxy.qml:77
1123-msgid ""
1124-"Show documents from the given folder, instead of ~/Documents.\n"
1125-"The path must exist prior to running ubuntu-docviewer-app"
1126-msgstr ""
1127-
1128-#: ../src/app/qml/common/DetailsPage.qml:26
1129-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
1130-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
1131-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
1132-msgid "Details"
1133-msgstr ""
1134-
1135-#: ../src/app/qml/common/DetailsPage.qml:42
1136-msgid "File"
1137-msgstr ""
1138-
1139-#: ../src/app/qml/common/DetailsPage.qml:47
1140-msgid "Location"
1141-msgstr ""
1142-
1143-#: ../src/app/qml/common/DetailsPage.qml:52
1144-msgid "Size"
1145-msgstr ""
1146-
1147-#: ../src/app/qml/common/DetailsPage.qml:57
1148-msgid "Created"
1149-msgstr ""
1150-
1151-#: ../src/app/qml/common/DetailsPage.qml:62
1152-msgid "Last modified"
1153-msgstr ""
1154-
1155-#: ../src/app/qml/common/DetailsPage.qml:69
1156-msgid "MIME type"
1157-msgstr ""
1158-
1159-#: ../src/app/qml/common/ErrorDialog.qml:23
1160-msgid "Error"
1161-msgstr ""
1162-
1163-#: ../src/app/qml/common/ErrorDialog.qml:26
1164-#: ../src/app/qml/common/PickImportedDialog.qml:54
1165-#: ../src/app/qml/common/RejectedImportDialog.qml:38
1166-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
1167-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
1168-msgid "Close"
1169-msgstr ""
1170-
1171-#: ../src/app/qml/common/PickImportedDialog.qml:29
1172-msgid "Multiple documents imported"
1173-msgstr ""
1174-
1175-#: ../src/app/qml/common/PickImportedDialog.qml:30
1176-msgid "Choose which one to open:"
1177-msgstr ""
1178-
1179-#: ../src/app/qml/common/RejectedImportDialog.qml:28
1180-msgid "File not supported"
1181-msgid_plural "Files not supported"
1182-msgstr[0] ""
1183-msgstr[1] ""
1184-
1185-#: ../src/app/qml/common/RejectedImportDialog.qml:29
1186-msgid "Following document has not been imported:"
1187-msgid_plural "Following documents have not been imported:"
1188-msgstr[0] ""
1189-msgstr[1] ""
1190-
1191-#: ../src/app/qml/common/UnknownTypeDialog.qml:27
1192-msgid "Unknown file type"
1193-msgstr ""
1194-
1195-#: ../src/app/qml/common/UnknownTypeDialog.qml:28
1196-msgid ""
1197-"This file is not supported.\n"
1198-"Do you want to open it as a plain text?"
1199-msgstr ""
1200-
1201-#: ../src/app/qml/common/UnknownTypeDialog.qml:38
1202-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
1203-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
1204-#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
1205-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
1206-msgid "Cancel"
1207-msgstr ""
1208-
1209-#: ../src/app/qml/common/UnknownTypeDialog.qml:44
1210-msgid "Yes"
1211-msgstr ""
1212-
1213-#. TRANSLATORS: %1 is the size of a file, expressed in GB
1214-#: ../src/app/qml/common/utils.js:22
1215-#, qt-format
1216-msgid "%1 GB"
1217-msgstr ""
1218-
1219-#. TRANSLATORS: %1 is the size of a file, expressed in MB
1220-#: ../src/app/qml/common/utils.js:26
1221-#, qt-format
1222-msgid "%1 MB"
1223-msgstr ""
1224-
1225-#. TRANSLATORS: %1 is the size of a file, expressed in kB
1226-#: ../src/app/qml/common/utils.js:30
1227-#, qt-format
1228-msgid "%1 kB"
1229-msgstr ""
1230-
1231-#. TRANSLATORS: %1 is the size of a file, expressed in byte
1232-#: ../src/app/qml/common/utils.js:33
1233-#, qt-format
1234-msgid "%1 byte"
1235-msgstr ""
1236-
1237-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
1238-msgid "Delete file"
1239-msgstr ""
1240-
1241-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
1242-#, qt-format
1243-msgid "Delete %1 file"
1244-msgid_plural "Delete %1 files"
1245-msgstr[0] ""
1246-msgstr[1] ""
1247-
1248-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
1249-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
1250-msgid "Are you sure you want to permanently delete this file?"
1251-msgid_plural "Are you sure you want to permanently delete these files?"
1252-msgstr[0] ""
1253-msgstr[1] ""
1254-
1255-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
1256-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
1257-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
1258-msgid "Delete"
1259-msgstr ""
1260-
1261-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
1262-msgid "Share"
1263-msgstr ""
1264-
1265-#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
1266-msgid "No document found"
1267-msgstr ""
1268-
1269-#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
1270-msgid ""
1271-"Connect your device to any computer and simply drag files to the Documents "
1272-"folder or insert removable media with documents."
1273-msgstr ""
1274-
1275-#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1276-#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1277-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
1278-#, qt-format
1279-msgid "Today, %1"
1280-msgstr ""
1281-
1282-#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1283-#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1284-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
1285-#, qt-format
1286-msgid "Yesterday, %1"
1287-msgstr ""
1288-
1289-#. TRANSLATORS: this is a datetime formatting string,
1290-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1291-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
1292-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
1293-msgid "yyyy/MM/dd hh:mm"
1294-msgstr ""
1295-
1296-#. TRANSLATORS: this is a datetime formatting string,
1297-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1298-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
1299-msgid "dddd, hh:mm"
1300-msgstr ""
1301-
1302-#: ../src/app/qml/documentPage/DocumentPage.qml:23
1303-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
1304-msgid "Documents"
1305-msgstr ""
1306-
1307-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
1308-msgid "Search..."
1309-msgstr ""
1310-
1311-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
1312-msgid "Sorting settings..."
1313-msgstr ""
1314-
1315-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
1316-msgid "Switch to single column list"
1317-msgstr ""
1318-
1319-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
1320-msgid "Switch to grid"
1321-msgstr ""
1322-
1323-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
1324-msgid "Pick"
1325-msgstr ""
1326-
1327-#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
1328-msgid "Back"
1329-msgstr ""
1330-
1331-#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
1332-msgid "search in documents..."
1333-msgstr ""
1334-
1335-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
1336-msgid "Select None"
1337-msgstr ""
1338-
1339-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
1340-msgid "Select All"
1341-msgstr ""
1342-
1343-#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
1344-msgid "No matching document found"
1345-msgstr ""
1346-
1347-#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
1348-msgid ""
1349-"Please ensure that your query is not misspelled and/or try a different query."
1350-msgstr ""
1351-
1352-#: ../src/app/qml/documentPage/SectionHeader.qml:13
1353-msgid "Today"
1354-msgstr ""
1355-
1356-#: ../src/app/qml/documentPage/SectionHeader.qml:16
1357-msgid "Yesterday"
1358-msgstr ""
1359-
1360-#: ../src/app/qml/documentPage/SectionHeader.qml:19
1361-msgid "Earlier this week"
1362-msgstr ""
1363-
1364-#: ../src/app/qml/documentPage/SectionHeader.qml:22
1365-msgid "Earlier this month"
1366-msgstr ""
1367-
1368-#: ../src/app/qml/documentPage/SectionHeader.qml:24
1369-msgid "Even earlier..."
1370-msgstr ""
1371-
1372-#: ../src/app/qml/documentPage/SharePage.qml:23
1373-msgid "Share to"
1374-msgstr ""
1375-
1376-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
1377-msgid "Sorting settings"
1378-msgstr ""
1379-
1380-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
1381-msgid "Sort by date (Latest first)"
1382-msgstr ""
1383-
1384-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
1385-msgid "Sort by name (A-Z)"
1386-msgstr ""
1387-
1388-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
1389-msgid "Sort by size (Smaller first)"
1390-msgstr ""
1391-
1392-#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
1393-msgid "Reverse order"
1394-msgstr ""
1395-
1396-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
1397-#: ../src/app/qml/textView/TextView.qml:43
1398-msgid "Loading..."
1399-msgstr ""
1400-
1401-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
1402-msgid "LibreOffice text document"
1403-msgstr ""
1404-
1405-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
1406-msgid "LibreOffice spread sheet"
1407-msgstr ""
1408-
1409-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
1410-msgid "LibreOffice presentation"
1411-msgstr ""
1412-
1413-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
1414-msgid "LibreOffice Draw document"
1415-msgstr ""
1416-
1417-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
1418-msgid "Unknown LibreOffice document"
1419-msgstr ""
1420-
1421-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
1422-msgid "Unknown type document"
1423-msgstr ""
1424-
1425-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
1426-msgid "Go to position..."
1427-msgstr ""
1428-
1429-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
1430-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
1431-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
1432-msgid "Disable night mode"
1433-msgstr ""
1434-
1435-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
1436-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
1437-#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
1438-msgid "Enable night mode"
1439-msgstr ""
1440-
1441-#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
1442-msgid "Go to position"
1443-msgstr ""
1444-
1445-#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
1446-msgid "Choose a position between 1% and 100%"
1447-msgstr ""
1448-
1449-#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
1450-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
1451-msgid "GO!"
1452-msgstr ""
1453-
1454-#: ../src/app/qml/loView/LOViewPage.qml:129
1455-msgid "LibreOffice binaries not found."
1456-msgstr ""
1457-
1458-#: ../src/app/qml/loView/LOViewPage.qml:132
1459-msgid "Error while loading LibreOffice."
1460-msgstr ""
1461-
1462-#: ../src/app/qml/loView/LOViewPage.qml:135
1463-msgid ""
1464-"Document not loaded.\n"
1465-"The requested document may be corrupt or protected by a password."
1466-msgstr ""
1467-
1468-#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
1469-#. Document Viewer for rendering LibreOffice/MS-Office documents.
1470-#. Ref. https://docs.libreoffice.org/libreofficekit.html
1471-#: ../src/app/qml/loView/Splashscreen.qml:45
1472-msgid "Powered by LibreOfficeKit"
1473-msgstr ""
1474-
1475-#: ../src/app/qml/loView/ZoomSelector.qml:110
1476-msgid "Fit width"
1477-msgstr ""
1478-
1479-#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
1480-#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
1481-#: ../src/app/qml/pdfView/PdfView.qml:38
1482-msgid "Contents"
1483-msgstr ""
1484-
1485-#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
1486-msgid "Hide table of contents"
1487-msgstr ""
1488-
1489-#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
1490-#. while the second one (%2) refers to the total pages count.
1491-#: ../src/app/qml/pdfView/PdfView.qml:35
1492-#, qt-format
1493-msgid "Page %1 of %2"
1494-msgstr ""
1495-
1496-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
1497-msgid "Go to page..."
1498-msgstr ""
1499-
1500-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
1501-msgid "Go to page"
1502-msgstr ""
1503-
1504-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
1505-#, qt-format
1506-msgid "Choose a page between 1 and %1"
1507-msgstr ""
1508-
1509-#: ../src/app/qml/ubuntu-docviewer-app.qml:118
1510-msgid "File does not exist."
1511-msgstr ""
1512-
1513-#. TRANSLATORS: This string is used for renaming a copied file,
1514-#. when a file with the same name already exists in user's
1515-#. Documents folder.
1516-#.
1517-#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
1518-#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
1519-#.
1520-#. where "2" is given by the argument "%1"
1521-#.
1522-#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
1523-#, qt-format
1524-msgid "copy %1"
1525-msgstr ""
1526-
1527-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
1528-msgid "Document Viewer"
1529-msgstr ""
1530-
1531-#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
1532-msgid "documents;viewer;pdf;reader;"
1533-msgstr ""
1534
1535=== modified file 'src/app/qml/common/ContentHubProxy.qml'
1536--- src/app/qml/common/ContentHubProxy.qml 2015-10-10 12:03:30 +0000
1537+++ src/app/qml/common/ContentHubProxy.qml 2016-01-14 17:54:32 +0000
1538@@ -53,11 +53,11 @@
1539 for (var i=0; i<activeTransfer.items.length; i++) {
1540 var sourcePath = internal.getPathFromUrl(activeTransfer.items[i].url)
1541
1542- if (DocumentViewer.isFileSupported(sourcePath)) {
1543- var documentsLocation = DocumentViewer.getXdgDocumentsLocation()
1544+ if (FileUtils.isFileSupported(sourcePath)) {
1545+ var documentsLocation = FileUtils.getXdgDocumentsLocation()
1546
1547 // Check if we have already imported the same document in the past.
1548- var earlierImportedFile = DocumentViewer.checkIfFileAlreadyImported(sourcePath, [documentsLocation])
1549+ var earlierImportedFile = FileUtils.checkIfFileAlreadyImported(sourcePath, [documentsLocation])
1550 if (earlierImportedFile.length > 0) {
1551 // Document has been already imported in the past.
1552 // Append the path of the earlier copy of the
1553@@ -65,7 +65,7 @@
1554 importedDocsModel.append({ path: earlierImportedFile })
1555 } else {
1556 // No document has been found, so we can safely copy it.
1557- var destPath = DocumentViewer.buildDestinationPath(documentsLocation, sourcePath);
1558+ var destPath = FileUtils.buildDestinationPath(documentsLocation, sourcePath);
1559
1560 internal.importDocument(sourcePath, destPath)
1561 }
1562@@ -120,7 +120,7 @@
1563 }
1564
1565 function importDocument(sourcePath, destPath) {
1566- DocumentViewer.copy(sourcePath, destPath)
1567+ FileUtils.copy(sourcePath, destPath)
1568 importedDocsModel.append({ path: destPath })
1569 }
1570
1571
1572=== modified file 'src/app/qml/common/DetailsPage.qml'
1573--- src/app/qml/common/DetailsPage.qml 2015-12-27 12:10:06 +0000
1574+++ src/app/qml/common/DetailsPage.qml 2016-01-14 17:54:32 +0000
1575@@ -40,12 +40,12 @@
1576
1577 SubtitledListItem {
1578 text: i18n.tr("File")
1579- subText: DocumentViewer.getFileNameFromPath(file.path)
1580+ subText: FileUtils.getFileNameFromPath(file.path)
1581 }
1582
1583 SubtitledListItem {
1584 text: i18n.tr("Location")
1585- subText: DocumentViewer.getCanonicalPath(file.path)
1586+ subText: FileUtils.getCanonicalPath(file.path)
1587 }
1588
1589 SubtitledListItem {
1590
1591=== modified file 'src/app/qml/common/PickImportedDialog.qml'
1592--- src/app/qml/common/PickImportedDialog.qml 2015-12-26 18:27:13 +0000
1593+++ src/app/qml/common/PickImportedDialog.qml 2016-01-14 17:54:32 +0000
1594@@ -40,7 +40,7 @@
1595 }
1596
1597 Label {
1598- text: DocumentViewer.getFileBaseNameFromPath(model.path)
1599+ text: FileUtils.getFileBaseNameFromPath(model.path)
1600 anchors {
1601 left: parent.left; right: parent.right
1602 margins: units.gu(2)
1603
1604=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
1605--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-30 12:12:10 +0000
1606+++ src/app/qml/loView/LOViewDefaultHeader.qml 2016-01-14 17:54:32 +0000
1607@@ -73,7 +73,7 @@
1608 Layout.preferredHeight: units.gu(4)
1609
1610 view: targetPage.contentItem.loView
1611- visible: targetPage.contentItem && (DocumentViewer.desktopMode || mainView.wideWindow)
1612+ visible: targetPage.contentItem && (ConvergenceUtils.desktopMode || mainView.wideWindow)
1613 }
1614 }
1615
1616
1617=== modified file 'src/app/qml/loView/LOViewPage.qml'
1618--- src/app/qml/loView/LOViewPage.qml 2015-12-27 07:30:41 +0000
1619+++ src/app/qml/loView/LOViewPage.qml 2016-01-14 17:54:32 +0000
1620@@ -31,7 +31,7 @@
1621 property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)
1622 property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)
1623
1624- title: DocumentViewer.getFileBaseNameFromPath(file.path);
1625+ title: FileUtils.getFileBaseNameFromPath(file.path);
1626 flickable: isTextDocument ? loPage.contentItem.loView : null
1627
1628 splashScreen: Splashscreen { }
1629
1630=== modified file 'src/app/qml/pdfView/PdfView.qml'
1631--- src/app/qml/pdfView/PdfView.qml 2016-01-14 17:54:32 +0000
1632+++ src/app/qml/pdfView/PdfView.qml 2016-01-14 17:54:32 +0000
1633@@ -16,12 +16,9 @@
1634
1635 import QtQuick 2.4
1636 import Ubuntu.Components 1.3
1637-<<<<<<< TREE
1638-import DocumentViewer 1.0
1639-=======
1640 import Ubuntu.Components.Popups 1.3
1641 import QtQuick.Layouts 1.1
1642->>>>>>> MERGE-SOURCE
1643+import DocumentViewer 1.0
1644 import DocumentViewer.PDF 1.0 as PDF
1645
1646 import "../common"
1647@@ -29,7 +26,7 @@
1648
1649 Page {
1650 id: pdfPage
1651- title: DocumentViewer.getFileBaseNameFromPath(file.path)
1652+ title: FileUtils.getFileBaseNameFromPath(file.path)
1653
1654 header: PageHeader {
1655 flickable: pdfView
1656
1657=== modified file 'src/app/qml/textView/TextView.qml'
1658--- src/app/qml/textView/TextView.qml 2015-12-26 18:27:13 +0000
1659+++ src/app/qml/textView/TextView.qml 2016-01-14 17:54:32 +0000
1660@@ -23,7 +23,7 @@
1661
1662 Page {
1663 id: textPage
1664- title: DocumentViewer.getFileBaseNameFromPath(file.path)
1665+ title: FileUtils.getFileBaseNameFromPath(file.path)
1666
1667 // Reset night mode shader settings when closing the page
1668 // Component.onDestruction: mainView.nightModeEnabled = false
1669
1670=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
1671--- src/app/qml/ubuntu-docviewer-app.qml 2015-11-30 12:12:10 +0000
1672+++ src/app/qml/ubuntu-docviewer-app.qml 2016-01-14 17:54:32 +0000
1673@@ -80,7 +80,7 @@
1674 onIsLandscapeChanged: {
1675 // If device orientation is landscape and screen width is limited,
1676 // force hiding Unity 8 indicators panel.
1677- if (!DocumentViewer.desktopMode && mainView.isLandscape &&
1678+ if (!ConvergenceUtils.desktopMode && mainView.isLandscape &&
1679 mainView.width < units.gu(51)) {
1680 mainView.fullscreen = true
1681 return;
1682@@ -202,6 +202,13 @@
1683 }
1684 }
1685
1686+ // WORKAROUND: Not yet implemented in the SDK
1687+ Binding {
1688+ target: QuickUtils
1689+ property: "mouseAttached"
1690+ value: ConvergenceUtils.mouseAttached
1691+ }
1692+
1693 property bool nightModeEnabled: false
1694 layer.effect: NightModeShader {}
1695 layer.enabled: nightModeEnabled && (pageStack.depth > 1)
1696
1697=== modified file 'src/plugin/file-qml-plugin/CMakeLists.txt'
1698--- src/plugin/file-qml-plugin/CMakeLists.txt 2015-10-21 13:16:12 +0000
1699+++ src/plugin/file-qml-plugin/CMakeLists.txt 2016-01-14 17:54:32 +0000
1700@@ -1,23 +1,48 @@
1701+# This includes a temporary snapshot of the WIP QInputInfo API as we
1702+# require this in docviewer now but upstream isn't finished yet.
1703+# Eventually this should be dropped in favor of the upstream
1704+# QInputInfo API.
1705+
1706 set(PLUGIN_DIR DocumentViewer)
1707-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
1708
1709 find_package(Qt5Core)
1710 find_package(Qt5Qml)
1711 find_package(Qt5Quick)
1712
1713+pkg_check_modules(LIBUDEV REQUIRED libudev)
1714+pkg_check_modules(LIBEVDEV REQUIRED libevdev)
1715+
1716+include_directories(
1717+ ${CMAKE_CURRENT_SOURCE_DIR}
1718+ ${LIBUDEV_INCLUDE_DIRS}
1719+ ${LIBEVDEV_INCLUDE_DIRS}
1720+ InputInfo/
1721+)
1722+
1723+# QInputInfo sources
1724+set(inputinfo_SRCS
1725+ InputInfo/qinputinfo.cpp
1726+ InputInfo/qinputinfo.h
1727+ InputInfo/linux/qinputdeviceinfo_linux.cpp
1728+ InputInfo/linux/qinputdeviceinfo_linux_p.h
1729+)
1730+
1731 #add the sources to compile
1732 set(fileqmlplugin_SRCS
1733 backend.cpp
1734 documentmodel.cpp
1735 fswatcher.cpp
1736 docviewerfile.cpp
1737- docviewerutils.cpp
1738+ fileutils.cpp
1739+ ubuntuconvergenceutils.cpp
1740 )
1741
1742 add_library(fileqmlplugin MODULE
1743+ ${inputinfo_SRCS}
1744 ${fileqmlplugin_SRCS}
1745 )
1746
1747+target_link_libraries(fileqmlplugin ${LIBUDEV_LDFLAGS} ${LIBEVDEV_LDFLAGS} )
1748 qt5_use_modules(fileqmlplugin Qml Quick)
1749
1750 # Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator
1751
1752=== added directory 'src/plugin/file-qml-plugin/InputInfo'
1753=== added file 'src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt'
1754--- src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt 1970-01-01 00:00:00 +0000
1755+++ src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt 2016-01-14 17:54:32 +0000
1756@@ -0,0 +1,39 @@
1757+# This is a temporary snapshot of the WIP QInputInfo API as we
1758+# require this in unity now but upstream isn't finished yet.
1759+# Eventually this should be dropped in favor of the upstream
1760+# QInputInfo API.
1761+
1762+project(InputInfo)
1763+
1764+find_package(Qt5Core REQUIRED)
1765+find_package(Qt5Quick REQUIRED)
1766+
1767+pkg_check_modules(LIBUDEV REQUIRED libudev)
1768+pkg_check_modules(LIBEVDEV REQUIRED libevdev)
1769+
1770+include_directories(
1771+ ${CMAKE_CURRENT_SOURCE_DIR}
1772+ ${CMAKE_CURRENT_BINARY_DIR}
1773+ ${LIBUDEV_INCLUDE_DIRS}
1774+ ${LIBEVDEV_INCLUDE_DIRS}
1775+)
1776+
1777+set(InputInfo_SOURCES
1778+ plugin.cpp
1779+ qinputinfo.cpp
1780+ qdeclarativeinputdevicemodel.cpp
1781+ linux/qinputdeviceinfo_linux.cpp
1782+)
1783+
1784+add_library(InputInfo SHARED
1785+ ${InputInfo_SOURCES}
1786+)
1787+
1788+target_link_libraries(InputInfo
1789+ ${LIBUDEV_LDFLAGS}
1790+ ${LIBEVDEV_LDFLAGS}
1791+)
1792+
1793+qt5_use_modules(InputInfo Core Qml Quick)
1794+
1795+add_unity8_plugin(Unity.InputInfo 0.1 Unity/InputInfo TARGETS InputInfo)
1796
1797=== added directory 'src/plugin/file-qml-plugin/InputInfo/linux'
1798=== added file 'src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp'
1799--- src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp 1970-01-01 00:00:00 +0000
1800+++ src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp 2016-01-14 17:54:32 +0000
1801@@ -0,0 +1,288 @@
1802+/****************************************************************************
1803+**
1804+** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
1805+** Contact: http://www.qt-project.org/legal
1806+**
1807+** This file is part of the QtSystems module of the Qt Toolkit.
1808+**
1809+** $QT_BEGIN_LICENSE:LGPL$
1810+** Commercial License Usage
1811+** Licensees holding valid commercial Qt licenses may use this file in
1812+** accordance with the commercial license agreement provided with the
1813+** Software or, alternatively, in accordance with the terms contained in
1814+** a written agreement between you and Digia. For licensing terms and
1815+** conditions see http://qt.digia.com/licensing. For further information
1816+** use the contact form at http://qt.digia.com/contact-us.
1817+**
1818+** GNU Lesser General Public License Usage
1819+** Alternatively, this file may be used under the terms of the GNU Lesser
1820+** General Public License version 2.1 as published by the Free Software
1821+** Foundation and appearing in the file LICENSE.LGPL included in the
1822+** packaging of this file. Please review the following information to
1823+** ensure the GNU Lesser General Public License version 2.1 requirements
1824+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
1825+**
1826+** In addition, as a special exception, Digia gives you certain additional
1827+** rights. These rights are described in the Digia Qt LGPL Exception
1828+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
1829+**
1830+** GNU General Public License Usage
1831+** Alternatively, this file may be used under the terms of the GNU
1832+** General Public License version 3.0 as published by the Free Software
1833+** Foundation and appearing in the file LICENSE.GPL included in the
1834+** packaging of this file. Please review the following information to
1835+** ensure the GNU General Public License version 3.0 requirements will be
1836+** met: http://www.gnu.org/copyleft/gpl.html.
1837+**
1838+**
1839+** $QT_END_LICENSE$
1840+**
1841+****************************************************************************/
1842+
1843+#include "qinputdeviceinfo_linux_p.h"
1844+
1845+#include <libudev.h>
1846+#include <libevdev/libevdev.h>
1847+#include <fcntl.h>
1848+#include <QDebug>
1849+#include <QSocketNotifier>
1850+#include <QTimer>
1851+#include <QDir>
1852+
1853+QInputDeviceManagerPrivate::QInputDeviceManagerPrivate(QObject *parent) :
1854+ QObject(parent),
1855+ currentFilter(QInputDevice::Unknown),
1856+ udevice(0)
1857+{
1858+ QTimer::singleShot(250,this,SLOT(init()));
1859+}
1860+
1861+QInputDeviceManagerPrivate::~QInputDeviceManagerPrivate()
1862+{
1863+ udev_unref(udevice);
1864+ udev_monitor_unref(udevMonitor);
1865+}
1866+
1867+void QInputDeviceManagerPrivate::init()
1868+{
1869+ if (!udevice)
1870+ udevice = udev_new();
1871+
1872+ udev_list_entry *devices;
1873+ udev_list_entry *dev_list_entry;
1874+ udev_device *dev;
1875+
1876+ QString subsystem = QStringLiteral("input");
1877+ struct udev_enumerate *enumerate = 0;
1878+
1879+ if (udevice) {
1880+
1881+ udevMonitor = udev_monitor_new_from_netlink(udevice, "udev");
1882+ udev_monitor_filter_add_match_subsystem_devtype(udevMonitor, subsystem.toLatin1(), NULL);
1883+ enumerate = udev_enumerate_new(udevice);
1884+ udev_enumerate_add_match_subsystem(enumerate, subsystem.toLatin1());
1885+
1886+ udev_monitor_enable_receiving(udevMonitor);
1887+ notifierFd = udev_monitor_get_fd(udevMonitor);
1888+
1889+ notifier = new QSocketNotifier(notifierFd, QSocketNotifier::Read, this);
1890+ connect(notifier, SIGNAL(activated(int)), this, SLOT(onUDevChanges()));
1891+
1892+ udev_enumerate_scan_devices(enumerate);
1893+ devices = udev_enumerate_get_list_entry(enumerate);
1894+
1895+ udev_list_entry_foreach(dev_list_entry, devices) {
1896+ const char *path;
1897+ path = udev_list_entry_get_name(dev_list_entry);
1898+
1899+ dev = udev_device_new_from_syspath(udevice, path);
1900+ if (qstrcmp(udev_device_get_subsystem(dev), "input") == 0 ) {
1901+ QInputDevice *iDevice = addDevice(dev);
1902+ if (iDevice && !iDevice->devicePath().isEmpty()) {
1903+ deviceMap.insert(iDevice->devicePath(),iDevice);
1904+ }
1905+ }
1906+ udev_device_unref(dev);
1907+ }
1908+ udev_enumerate_unref(enumerate);
1909+ }
1910+ // udev_unref(udevice);
1911+ Q_FOREACH (const QString &devicePath, deviceMap.keys()) {
1912+ Q_EMIT deviceAdded(devicePath);
1913+ }
1914+ Q_EMIT ready();
1915+}
1916+
1917+QInputDevice::InputTypeFlags QInputDeviceManagerPrivate::getInputTypeFlags(struct udev_device *dev)
1918+{
1919+ QInputDevice::InputTypeFlags flags = QInputDevice::Unknown;
1920+ if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEY"), "1") == 0 ) {
1921+ flags |= QInputDevice::Button;
1922+ }
1923+ if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_MOUSE"), "1") == 0) {
1924+ flags |= QInputDevice::Mouse;
1925+ }
1926+ if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TOUCHPAD"), "1") == 0) {
1927+ flags |= QInputDevice::TouchPad;
1928+ }
1929+ if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN"), "1") == 0
1930+ || qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TABLET"), "1") == 0) {
1931+ flags |= QInputDevice::TouchScreen;
1932+ }
1933+ if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 ) {
1934+ flags |= QInputDevice::Keyboard;
1935+ }
1936+ if (!QString::fromLatin1(udev_device_get_property_value(dev, "SW")).isEmpty()) {
1937+ flags |= QInputDevice::Switch;
1938+ }
1939+
1940+ return flags;
1941+}
1942+
1943+QInputDevice *QInputDeviceManagerPrivate::addDevice(struct udev_device *udev)
1944+{
1945+ QString eventPath = QString::fromLatin1(udev_device_get_sysname(udev));
1946+
1947+ if (eventPath.contains(QStringLiteral("event")))
1948+ eventPath.prepend(QStringLiteral("/dev/input/"));
1949+
1950+ if (deviceMap.contains(eventPath)) {
1951+ return Q_NULLPTR;
1952+ }
1953+ struct libevdev *dev = NULL;
1954+ int fd;
1955+ int rc = 1;
1956+ QInputDevice *inputDevice;
1957+ inputDevice = addUdevDevice(udev);
1958+ if (!inputDevice) {
1959+ return Q_NULLPTR;
1960+ }
1961+ eventPath = inputDevice->devicePath();
1962+
1963+ fd = open(eventPath.toLatin1(), O_RDONLY|O_NONBLOCK);
1964+ if (fd == -1) {
1965+ return inputDevice;
1966+ }
1967+ rc = libevdev_new_from_fd(fd, &dev);
1968+ if (rc < 0) {
1969+ qWarning() << "Failed to init libevdev ("<< strerror(-rc) << ")";
1970+ return Q_NULLPTR;
1971+ }
1972+
1973+ for (int i = 0; i < EV_MAX; i++) {
1974+ if (i == EV_KEY || i == EV_SW || i == EV_REL
1975+ || i == EV_REL || i == EV_ABS) {
1976+ for (int j = 0; j < libevdev_event_type_get_max(i); j++) {
1977+ if (libevdev_has_event_code(dev, i, j)) {
1978+ switch (i) {
1979+ case EV_KEY:
1980+ inputDevice->addButton(j);
1981+ break;
1982+ case EV_SW:
1983+ inputDevice->addSwitch(j);
1984+ break;
1985+ case EV_REL:
1986+ inputDevice->addRelativeAxis(j);
1987+ break;
1988+ case EV_ABS:
1989+ inputDevice->addAbsoluteAxis(j);
1990+ break;
1991+ };
1992+ }
1993+ }
1994+ }
1995+ }
1996+
1997+ return inputDevice;
1998+}
1999+
2000+void QInputDeviceManagerPrivate::addDetails(struct udev_device *)
2001+{
2002+}
2003+
2004+void QInputDeviceManagerPrivate::removeDevice(const QString &path)
2005+{
2006+ // this path is not a full evdev path
2007+ Q_FOREACH (const QString devicePath, deviceMap.keys()) {
2008+ if (devicePath.contains(path)) {
2009+ deviceMap.remove(devicePath);
2010+ Q_EMIT deviceRemoved(devicePath);
2011+ }
2012+ }
2013+}
2014+
2015+QInputDevice *QInputDeviceManagerPrivate::addUdevDevice(struct udev_device *udev)
2016+{
2017+ QInputDevice *iDevice;
2018+
2019+ struct udev_list_entry *list;
2020+ struct udev_list_entry *node;
2021+
2022+ list = udev_device_get_properties_list_entry (udev);
2023+ QString syspath = QString::fromLatin1(udev_device_get_syspath(udev));
2024+ QDir sysdir(syspath);
2025+
2026+ QStringList infoList = sysdir.entryList(QStringList() << QStringLiteral("event*"),QDir::Dirs);
2027+
2028+ if (infoList.count() > 0) {
2029+ QString token = infoList.at(0);
2030+
2031+ token.prepend(QStringLiteral("/dev/input/"));
2032+ iDevice = new QInputDevice(this);
2033+ iDevice->setDevicePath(token);
2034+ } else {
2035+ return Q_NULLPTR;
2036+ }
2037+ udev_list_entry_foreach (node, list) {
2038+
2039+ QString key = QString::fromLatin1(udev_list_entry_get_name(node));
2040+ QString value = QString::fromLatin1(udev_list_entry_get_value(node));
2041+
2042+ if (key == QStringLiteral("NAME")) {
2043+ iDevice->setName(value.remove(QStringLiteral("\"")));
2044+ }
2045+ }
2046+ iDevice->setType(getInputTypeFlags(udev));
2047+ return iDevice;
2048+}
2049+
2050+void QInputDeviceManagerPrivate::onUDevChanges()
2051+{
2052+ if (!udevMonitor)
2053+ return;
2054+
2055+ udev_device *dev = udev_monitor_receive_device(udevMonitor);
2056+
2057+ if (dev) {
2058+ if (qstrcmp(udev_device_get_subsystem(dev), "input") == 0 ) {
2059+ QString eventPath = QString::fromLatin1(udev_device_get_sysname(dev));
2060+
2061+ QString action = QString::fromStdString(udev_device_get_action(dev));
2062+
2063+ if (!eventPath.contains(QStringLiteral("/dev/input/")))
2064+ eventPath.prepend(QStringLiteral("/dev/input/"));
2065+
2066+ if (action == QStringLiteral("add")) {
2067+ if (deviceMap.contains(eventPath)){
2068+ udev_device_unref(dev);
2069+ return;
2070+ }
2071+
2072+ QInputDevice *iDevice = addDevice(dev);
2073+ if (!iDevice) {
2074+ delete iDevice;
2075+ return;
2076+ }
2077+ iDevice->setType(getInputTypeFlags(dev));
2078+ udev_device_unref(dev);
2079+
2080+ deviceMap.insert(eventPath,iDevice);
2081+
2082+ Q_EMIT deviceAdded(eventPath);
2083+
2084+ } else if (action == QStringLiteral("remove")) {
2085+ removeDevice(eventPath);
2086+ }
2087+ }
2088+ }
2089+}
2090
2091=== added file 'src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h'
2092--- src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h 1970-01-01 00:00:00 +0000
2093+++ src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h 2016-01-14 17:54:32 +0000
2094@@ -0,0 +1,98 @@
2095+/****************************************************************************
2096+**
2097+** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
2098+** Contact: http://www.qt-project.org/legal
2099+**
2100+** This file is part of the QtSystems module of the Qt Toolkit.
2101+**
2102+** $QT_BEGIN_LICENSE:LGPL$
2103+** Commercial License Usage
2104+** Licensees holding valid commercial Qt licenses may use this file in
2105+** accordance with the commercial license agreement provided with the
2106+** Software or, alternatively, in accordance with the terms contained in
2107+** a written agreement between you and Digia. For licensing terms and
2108+** conditions see http://qt.digia.com/licensing. For further information
2109+** use the contact form at http://qt.digia.com/contact-us.
2110+**
2111+** GNU Lesser General Public License Usage
2112+** Alternatively, this file may be used under the terms of the GNU Lesser
2113+** General Public License version 2.1 as published by the Free Software
2114+** Foundation and appearing in the file LICENSE.LGPL included in the
2115+** packaging of this file. Please review the following information to
2116+** ensure the GNU Lesser General Public License version 2.1 requirements
2117+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
2118+**
2119+** In addition, as a special exception, Digia gives you certain additional
2120+** rights. These rights are described in the Digia Qt LGPL Exception
2121+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
2122+**
2123+** GNU General Public License Usage
2124+** Alternatively, this file may be used under the terms of the GNU
2125+** General Public License version 3.0 as published by the Free Software
2126+** Foundation and appearing in the file LICENSE.GPL included in the
2127+** packaging of this file. Please review the following information to
2128+** ensure the GNU General Public License version 3.0 requirements will be
2129+** met: http://www.gnu.org/copyleft/gpl.html.
2130+**
2131+**
2132+** $QT_END_LICENSE$
2133+**
2134+****************************************************************************/
2135+
2136+#ifndef QINPUTDEVICEINFO_LINUX_P_H
2137+#define QINPUTDEVICEINFO_LINUX_P_H
2138+
2139+#include <QObject>
2140+#include "qinputinfo.h"
2141+#include <libudev.h>
2142+
2143+class QInputDevicePrivate : public QObject
2144+{
2145+ Q_OBJECT
2146+public:
2147+ explicit QInputDevicePrivate(QObject *parent = 0);
2148+
2149+ QString name;
2150+ QString devicePath;
2151+ QList <int> buttons; //keys
2152+ QList <int> switches;
2153+ QList <int> relativeAxis;
2154+ QList <int> absoluteAxis;
2155+ QInputDevice::InputTypeFlags type;
2156+};
2157+
2158+class QInputDeviceManagerPrivate : public QObject
2159+{
2160+ Q_OBJECT
2161+public:
2162+ explicit QInputDeviceManagerPrivate(QObject *parent = 0);
2163+ ~QInputDeviceManagerPrivate();
2164+ QVector <QInputDevice *> deviceList;
2165+ QMap <QString, QInputDevice *> deviceMap;
2166+ static QInputDeviceManagerPrivate * instance();
2167+ QInputDevice::InputType currentFilter;
2168+
2169+Q_SIGNALS:
2170+ void deviceAdded(const QString &);
2171+ void deviceRemoved(const QString &);
2172+ void ready();
2173+
2174+private:
2175+ QInputDevice *addDevice(struct udev_device *udev);
2176+ QInputDevice *addUdevDevice(struct udev_device *);
2177+
2178+ QInputDevice *addDevice(const QString &path);
2179+ void removeDevice(const QString &path);
2180+ QSocketNotifier *notifier;
2181+ int notifierFd;
2182+ struct udev_monitor *udevMonitor;
2183+ QInputDevice::InputTypeFlags getInputTypeFlags(struct udev_device *);
2184+ struct udev *udevice;
2185+ void addDetails(struct udev_device *);
2186+
2187+private Q_SLOTS:
2188+ void onUDevChanges();
2189+ void init();
2190+};
2191+
2192+#endif // QINPUTDEVICEINFO_LINUX_P_H
2193
2194=== added file 'src/plugin/file-qml-plugin/InputInfo/plugin.cpp'
2195--- src/plugin/file-qml-plugin/InputInfo/plugin.cpp 1970-01-01 00:00:00 +0000
2196+++ src/plugin/file-qml-plugin/InputInfo/plugin.cpp 2016-01-14 17:54:32 +0000
2197@@ -0,0 +1,32 @@
2198+/*
2199+ * Copyright 2015 Canonical Ltd.
2200+ *
2201+ * This program is free software; you can redistribute it and/or modify
2202+ * it under the terms of the GNU Lesser General Public License as published by
2203+ * the Free Software Foundation; version 3.
2204+ *
2205+ * This program is distributed in the hope that it will be useful,
2206+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2207+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2208+ * GNU Lesser General Public License for more details.
2209+ *
2210+ * You should have received a copy of the GNU Lesser General Public License
2211+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2212+ */
2213+
2214+// Qt
2215+#include <QtQml/qqml.h>
2216+
2217+// self
2218+#include "plugin.h"
2219+
2220+// local
2221+#include "qdeclarativeinputdevicemodel_p.h"
2222+
2223+void InputInfoPlugin::registerTypes(const char *uri)
2224+{
2225+ int major = 0;
2226+ int minor = 1;
2227+ qmlRegisterType<QDeclarativeInputDeviceModel>(uri, major, minor, "InputDeviceModel");
2228+ qmlRegisterType<QInputDevice>(uri, major, minor, "InputInfo");
2229+}
2230
2231=== added file 'src/plugin/file-qml-plugin/InputInfo/plugin.h'
2232--- src/plugin/file-qml-plugin/InputInfo/plugin.h 1970-01-01 00:00:00 +0000
2233+++ src/plugin/file-qml-plugin/InputInfo/plugin.h 2016-01-14 17:54:32 +0000
2234@@ -0,0 +1,30 @@
2235+/*
2236+ * Copyright 2015 Canonical Ltd.
2237+ *
2238+ * This program is free software; you can redistribute it and/or modify
2239+ * it under the terms of the GNU Lesser General Public License as published by
2240+ * the Free Software Foundation; version 3.
2241+ *
2242+ * This program is distributed in the hope that it will be useful,
2243+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2244+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2245+ * GNU Lesser General Public License for more details.
2246+ *
2247+ * You should have received a copy of the GNU Lesser General Public License
2248+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2249+ */
2250+
2251+#ifndef INPUTINFO_PLUGIN_H
2252+#define INPUTINFO_PLUGIN_H
2253+
2254+#include <QtQml/QQmlExtensionPlugin>
2255+
2256+class InputInfoPlugin : public QQmlExtensionPlugin
2257+{
2258+ Q_OBJECT
2259+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2260+public:
2261+ void registerTypes(const char *uri);
2262+};
2263+
2264+#endif // INPUTINFO_PLUGIN_H
2265
2266=== added file 'src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp'
2267--- src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp 1970-01-01 00:00:00 +0000
2268+++ src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp 2016-01-14 17:54:32 +0000
2269@@ -0,0 +1,196 @@
2270+/****************************************************************************
2271+**
2272+** Copyright (C) 2015 Jolla.
2273+** Contact: http://www.qt-project.org/legal
2274+**
2275+** This file is part of the QtSystems module of the Qt Toolkit.
2276+**
2277+** $QT_BEGIN_LICENSE:LGPL$
2278+** Commercial License Usage
2279+** Licensees holding valid commercial Qt licenses may use this file in
2280+** accordance with the commercial license agreement provided with the
2281+** Software or, alternatively, in accordance with the terms contained in
2282+** a written agreement between you and Digia. For licensing terms and
2283+** conditions see http://qt.digia.com/licensing. For further information
2284+** use the contact form at http://qt.digia.com/contact-us.
2285+**
2286+** GNU Lesser General Public License Usage
2287+** Alternatively, this file may be used under the terms of the GNU Lesser
2288+** General Public License version 2.1 as published by the Free Software
2289+** Foundation and appearing in the file LICENSE.LGPL included in the
2290+** packaging of this file. Please review the following information to
2291+** ensure the GNU Lesser General Public License version 2.1 requirements
2292+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
2293+**
2294+** In addition, as a special exception, Digia gives you certain additional
2295+** rights. These rights are described in the Digia Qt LGPL Exception
2296+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
2297+**
2298+** GNU General Public License Usage
2299+** Alternatively, this file may be used under the terms of the GNU
2300+** General Public License version 3.0 as published by the Free Software
2301+** Foundation and appearing in the file LICENSE.GPL included in the
2302+** packaging of this file. Please review the following information to
2303+** ensure the GNU General Public License version 3.0 requirements will be
2304+** met: http://www.gnu.org/copyleft/gpl.html.
2305+**
2306+**
2307+** $QT_END_LICENSE$
2308+**
2309+****************************************************************************/
2310+#include "qdeclarativeinputdevicemodel_p.h"
2311+#include "qinputinfo.h"
2312+
2313+QDeclarativeInputDeviceModel::QDeclarativeInputDeviceModel(QObject *parent) :
2314+ QAbstractListModel(parent),
2315+ deviceInfo(new QInputDeviceManager),
2316+ currentFilter(QInputDevice::Unknown)
2317+{
2318+ connect(deviceInfo,SIGNAL(ready()),this,SLOT(updateDeviceList()));
2319+ connect(deviceInfo, &QInputDeviceManager::deviceAdded,this,&QDeclarativeInputDeviceModel::addedDevice);
2320+ connect(deviceInfo, &QInputDeviceManager::deviceRemoved,this,&QDeclarativeInputDeviceModel::removedDevice);
2321+}
2322+
2323+QDeclarativeInputDeviceModel::~QDeclarativeInputDeviceModel()
2324+{
2325+ delete deviceInfo;
2326+}
2327+
2328+QVariant QDeclarativeInputDeviceModel::data(const QModelIndex &index, int role) const
2329+{
2330+ switch (role) {
2331+ case ServiceRole:
2332+ return QVariant::fromValue(static_cast<QObject *>(inputDevices.value(index.row())));
2333+ break;
2334+ case NameRole:
2335+ return QVariant::fromValue(static_cast<QString>(inputDevices.value(index.row())->name()));
2336+ break;
2337+ case DevicePathRole:
2338+ return QVariant::fromValue(static_cast<QString>(inputDevices.value(index.row())->devicePath()));
2339+ break;
2340+ case ButtonsRole:
2341+ return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->buttons()));
2342+ break;
2343+ case SwitchesRole:
2344+ return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->switches()));
2345+ break;
2346+ case RelativeAxisRole:
2347+ return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->relativeAxis()));
2348+ break;
2349+ case AbsoluteAxisRole:
2350+ return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->absoluteAxis()));
2351+ break;
2352+ case TypesRole:
2353+ return QVariant::fromValue(static_cast<int>(inputDevices.value(index.row())->type()));
2354+ break;
2355+ };
2356+
2357+ return QVariant();
2358+}
2359+
2360+int QDeclarativeInputDeviceModel::rowCount(const QModelIndex &parent) const
2361+{
2362+ Q_UNUSED(parent);
2363+
2364+ return inputDevices.count();
2365+}
2366+
2367+int QDeclarativeInputDeviceModel::indexOf(const QString &devicePath) const
2368+{
2369+ int idx(-1);
2370+ Q_FOREACH (QInputDevice *device, inputDevices) {
2371+ idx++;
2372+ if (device->devicePath() == devicePath) return idx;
2373+ }
2374+
2375+ return -1;
2376+}
2377+
2378+QInputDevice *QDeclarativeInputDeviceModel::get(int index) const
2379+{
2380+ if (index < 0 || index > inputDevices.count())
2381+ return 0;
2382+ return inputDevices.value(index);
2383+}
2384+
2385+void QDeclarativeInputDeviceModel::updateDeviceList()
2386+{
2387+ QVector <QInputDevice *> newDevices = deviceInfo->deviceListOfType(currentFilter);
2388+
2389+ int numNew = newDevices.count();
2390+
2391+ for (int i = 0; i < numNew; i++) {
2392+ int j = inputDevices.indexOf(newDevices.value(i));
2393+
2394+ if (j == -1) {
2395+ beginInsertRows(QModelIndex(), i, i);
2396+ inputDevices.insert(i, newDevices.value(i));
2397+ endInsertRows();
2398+ Q_EMIT countChanged();
2399+ } else if (i != j) {
2400+ // changed its position -> move it
2401+ QInputDevice* device = inputDevices.value(j);
2402+ beginMoveRows(QModelIndex(), j, j, QModelIndex(), i);
2403+ inputDevices.remove(j);
2404+ inputDevices.insert(i, device);
2405+ endMoveRows();
2406+ Q_EMIT countChanged();
2407+ } //else {
2408+ QModelIndex changedIndex(this->index(j, 0, QModelIndex()));
2409+ Q_EMIT dataChanged(changedIndex, changedIndex);
2410+ }
2411+
2412+ int numOld = inputDevices.count();
2413+ if (numOld > numNew) {
2414+ beginRemoveRows(QModelIndex(), numNew, numOld - 1);
2415+ inputDevices.remove(numNew, numOld - numNew);
2416+ endRemoveRows();
2417+ Q_EMIT countChanged();
2418+ }
2419+}
2420+
2421+void QDeclarativeInputDeviceModel::addedDevice(const QString &devicePath)
2422+{
2423+ updateDeviceList();
2424+ Q_EMIT deviceAdded(devicePath);
2425+}
2426+
2427+void QDeclarativeInputDeviceModel::removedDevice(const QString &devicePath)
2428+{
2429+ updateDeviceList();
2430+ Q_EMIT deviceRemoved(devicePath);
2431+}
2432+
2433+QHash<int,QByteArray> QDeclarativeInputDeviceModel::roleNames() const
2434+{
2435+ QHash<int, QByteArray> roles;
2436+ roles[NameRole] = "name";
2437+ roles[DevicePathRole] = "devicePath";
2438+ roles[ButtonsRole] = "buttons";
2439+ roles[SwitchesRole] = "switches";
2440+ roles[RelativeAxisRole] = "rAxis";
2441+ roles[AbsoluteAxisRole] = "aAxis";
2442+ roles[TypesRole] = "types";
2443+ return roles;
2444+}
2445+
2446+/*
2447+ * Returns the currently set device filter.
2448+ * */
2449+QInputDevice::InputType QDeclarativeInputDeviceModel::deviceFilter()
2450+{
2451+ return currentFilter;
2452+}
2453+
2454+/*
2455+ * Sets the current input device filter to filter.
2456+ * */
2457+void QDeclarativeInputDeviceModel::setDeviceFilter(QInputDevice::InputType filter)
2458+{
2459+ if (filter != currentFilter) {
2460+ deviceInfo->setDeviceFilter(filter);
2461+ currentFilter = filter;
2462+ updateDeviceList();
2463+ Q_EMIT deviceFilterChanged(filter);
2464+ }
2465+}
2466
2467=== added file 'src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h'
2468--- src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h 1970-01-01 00:00:00 +0000
2469+++ src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h 2016-01-14 17:54:32 +0000
2470@@ -0,0 +1,102 @@
2471+/****************************************************************************
2472+**
2473+** Copyright (C) 2015 Jolla.
2474+** Contact: http://www.qt-project.org/legal
2475+**
2476+** This file is part of the QtSystems module of the Qt Toolkit.
2477+**
2478+** $QT_BEGIN_LICENSE:LGPL$
2479+** Commercial License Usage
2480+** Licensees holding valid commercial Qt licenses may use this file in
2481+** accordance with the commercial license agreement provided with the
2482+** Software or, alternatively, in accordance with the terms contained in
2483+** a written agreement between you and Digia. For licensing terms and
2484+** conditions see http://qt.digia.com/licensing. For further information
2485+** use the contact form at http://qt.digia.com/contact-us.
2486+**
2487+** GNU Lesser General Public License Usage
2488+** Alternatively, this file may be used under the terms of the GNU Lesser
2489+** General Public License version 2.1 as published by the Free Software
2490+** Foundation and appearing in the file LICENSE.LGPL included in the
2491+** packaging of this file. Please review the following information to
2492+** ensure the GNU Lesser General Public License version 2.1 requirements
2493+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
2494+**
2495+** In addition, as a special exception, Digia gives you certain additional
2496+** rights. These rights are described in the Digia Qt LGPL Exception
2497+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
2498+**
2499+** GNU General Public License Usage
2500+** Alternatively, this file may be used under the terms of the GNU
2501+** General Public License version 3.0 as published by the Free Software
2502+** Foundation and appearing in the file LICENSE.GPL included in the
2503+** packaging of this file. Please review the following information to
2504+** ensure the GNU General Public License version 3.0 requirements will be
2505+** met: http://www.gnu.org/copyleft/gpl.html.
2506+**
2507+**
2508+** $QT_END_LICENSE$
2509+**
2510+****************************************************************************/
2511+
2512+#ifndef QDECLARATIVEINPUTDEVICEMODEL_H
2513+#define QDECLARATIVEINPUTDEVICEMODEL_H
2514+
2515+#include <QObject>
2516+#include <QAbstractListModel>
2517+#include "qinputinfo.h"
2518+
2519+class QDeclarativeInputDeviceModel : public QAbstractListModel
2520+{
2521+ Q_OBJECT
2522+ Q_DISABLE_COPY(QDeclarativeInputDeviceModel)
2523+ Q_PROPERTY(QInputDevice::InputType deviceFilter READ deviceFilter WRITE setDeviceFilter NOTIFY deviceFilterChanged)
2524+
2525+ Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
2526+
2527+public:
2528+ enum ItemRoles {
2529+ ServiceRole = Qt::UserRole + 1,
2530+ NameRole,
2531+ DevicePathRole,
2532+ ButtonsRole,
2533+ SwitchesRole,
2534+ RelativeAxisRole,
2535+ AbsoluteAxisRole,
2536+ TypesRole
2537+ };
2538+
2539+ explicit QDeclarativeInputDeviceModel(QObject *parent = 0);
2540+ virtual ~QDeclarativeInputDeviceModel();
2541+
2542+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
2543+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
2544+
2545+ void setDeviceFilter(QInputDevice::InputType filter);
2546+ QInputDevice::InputType deviceFilter();
2547+
2548+ Q_INVOKABLE int indexOf(const QString &devicePath) const;
2549+
2550+ Q_INVOKABLE QInputDevice *get(int index) const;
2551+ QHash<int, QByteArray> roleNames() const;
2552+
2553+Q_SIGNALS:
2554+ void deviceAdded(const QString &devicePath);
2555+ void deviceRemoved(const QString &devicePath);
2556+ void deviceFilterChanged(const QInputDevice::InputType filter);
2557+ void countChanged();
2558+
2559+public Q_SLOTS:
2560+ void updateDeviceList();
2561+private:
2562+ QInputDeviceManager *deviceInfo;
2563+ QVector<QInputDevice *> inputDevices;
2564+ QInputDevice::InputType currentFilter;
2565+
2566+private Q_SLOTS:
2567+ void addedDevice(const QString &);
2568+ void removedDevice(const QString &path);
2569+
2570+};
2571+
2572+#endif // QDECLARATIVEINPUTDEVICEMODEL_H
2573
2574=== added file 'src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp'
2575--- src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp 1970-01-01 00:00:00 +0000
2576+++ src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp 2016-01-14 17:54:32 +0000
2577@@ -0,0 +1,270 @@
2578+/****************************************************************************
2579+**
2580+** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
2581+** Contact: http://www.qt-project.org/legal
2582+**
2583+** This file is part of the QtSystems module of the Qt Toolkit.
2584+**
2585+** $QT_BEGIN_LICENSE:LGPL$
2586+** Commercial License Usage
2587+** Licensees holding valid commercial Qt licenses may use this file in
2588+** accordance with the commercial license agreement provided with the
2589+** Software or, alternatively, in accordance with the terms contained in
2590+** a written agreement between you and Digia. For licensing terms and
2591+** conditions see http://qt.digia.com/licensing. For further information
2592+** use the contact form at http://qt.digia.com/contact-us.
2593+**
2594+** GNU Lesser General Public License Usage
2595+** Alternatively, this file may be used under the terms of the GNU Lesser
2596+** General Public License version 2.1 as published by the Free Software
2597+** Foundation and appearing in the file LICENSE.LGPL included in the
2598+** packaging of this file. Please review the following information to
2599+** ensure the GNU Lesser General Public License version 2.1 requirements
2600+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
2601+**
2602+** In addition, as a special exception, Digia gives you certain additional
2603+** rights. These rights are described in the Digia Qt LGPL Exception
2604+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
2605+**
2606+** GNU General Public License Usage
2607+** Alternatively, this file may be used under the terms of the GNU
2608+** General Public License version 3.0 as published by the Free Software
2609+** Foundation and appearing in the file LICENSE.GPL included in the
2610+** packaging of this file. Please review the following information to
2611+** ensure the GNU General Public License version 3.0 requirements will be
2612+** met: http://www.gnu.org/copyleft/gpl.html.
2613+**
2614+**
2615+** $QT_END_LICENSE$
2616+**
2617+****************************************************************************/
2618+
2619+#include "qinputinfo.h"
2620+
2621+#if defined(UNITY_MOCKS)
2622+#include "qinputdeviceinfo_mock_p.h"
2623+#elif defined(Q_OS_LINUX)
2624+#include "linux/qinputdeviceinfo_linux_p.h"
2625+#endif
2626+
2627+Q_GLOBAL_STATIC(QInputDeviceManagerPrivate, inputDeviceManagerPrivate)
2628+
2629+QT_BEGIN_NAMESPACE
2630+
2631+QInputDeviceManagerPrivate * QInputDeviceManagerPrivate::instance()
2632+{
2633+ QInputDeviceManagerPrivate *priv = inputDeviceManagerPrivate();
2634+ return priv;
2635+}
2636+
2637+QInputDevicePrivate::QInputDevicePrivate(QObject *parent) :
2638+ QObject(parent),
2639+ type(QInputDevice::Unknown)
2640+{
2641+}
2642+
2643+QInputDevice::QInputDevice(QObject *parent) :
2644+ QObject(parent),
2645+ d_ptr(new QInputDevicePrivate(this))
2646+{
2647+}
2648+
2649+/*
2650+ * Returns the name of this input device.
2651+ */
2652+QString QInputDevice::name() const
2653+{
2654+ return d_ptr->name;
2655+}
2656+
2657+/*
2658+ * Sets the name of this input device to \b name.
2659+ */
2660+void QInputDevice::setName(const QString &name)
2661+{
2662+ d_ptr->name = name;
2663+}
2664+
2665+/*
2666+ * Returns the device path of this device.
2667+ */
2668+QString QInputDevice::devicePath() const
2669+{
2670+ return d_ptr->devicePath;
2671+}
2672+
2673+/*
2674+ * Sets the device ppath of this device to /b path.
2675+ */
2676+void QInputDevice::setDevicePath(const QString &path)
2677+{
2678+ d_ptr->devicePath = path;
2679+}
2680+
2681+/*
2682+ * Returns the number of buttons this device has.
2683+ */
2684+QList <int> QInputDevice::buttons() const
2685+{
2686+ return d_ptr->buttons;
2687+}
2688+
2689+/*
2690+ * Adds a button
2691+ */
2692+void QInputDevice::addButton(int buttonCode)
2693+{
2694+ d_ptr->buttons.append(buttonCode);
2695+}
2696+
2697+/*
2698+ * Returns the number of switch of this device.
2699+ */
2700+QList <int> QInputDevice::switches() const
2701+{
2702+ return d_ptr->switches;
2703+}
2704+
2705+/*
2706+ * Adds a switch
2707+ */
2708+void QInputDevice::addSwitch(int switchCode)
2709+{
2710+ d_ptr->switches.append(switchCode);
2711+}
2712+
2713+/*
2714+ * Returns a list of the relative axis of this device
2715+ */
2716+QList <int> QInputDevice::relativeAxis() const
2717+{
2718+ return d_ptr->relativeAxis;
2719+}
2720+
2721+/*
2722+ */
2723+void QInputDevice::addRelativeAxis(int axisCode)
2724+{
2725+ d_ptr->relativeAxis.append(axisCode);
2726+}
2727+
2728+/*
2729+ * Returns a list of the absolute axis of this device
2730+ */
2731+QList <int> QInputDevice::absoluteAxis() const
2732+{
2733+ return d_ptr->absoluteAxis;
2734+}
2735+
2736+/*
2737+ */
2738+void QInputDevice::addAbsoluteAxis(int axisCode)
2739+{
2740+ d_ptr->absoluteAxis.append(axisCode);
2741+}
2742+
2743+/*
2744+ * Returns a QInputDevice::InputTypeFlags of all the types of types.
2745+ */
2746+QInputDevice::InputTypeFlags QInputDevice::type() const
2747+{
2748+ return d_ptr->type;
2749+}
2750+
2751+/*
2752+ */
2753+void QInputDevice::setType(QInputDevice::InputTypeFlags type) //? setTypes?
2754+{
2755+ d_ptr->type = type;
2756+}
2757+
2758+QInputDeviceManager::QInputDeviceManager(QObject *parent) :
2759+ QObject(parent),
2760+ d_ptr(inputDeviceManagerPrivate)
2761+{
2762+ connect(d_ptr, &QInputDeviceManagerPrivate::deviceAdded,this,&QInputDeviceManager::addedDevice);
2763+ connect(d_ptr, &QInputDeviceManagerPrivate::deviceRemoved,this,&QInputDeviceManager::deviceRemoved);
2764+
2765+ connect(d_ptr,SIGNAL(ready()),this,SIGNAL(ready()));
2766+}
2767+
2768+/*
2769+ * Returns a QMap of known input devices.
2770+ */
2771+QMap <QString, QInputDevice *> QInputDeviceManager::deviceMap()
2772+{
2773+ return d_ptr->deviceMap;
2774+}
2775+
2776+/*
2777+ */
2778+void QInputDeviceManager::addedDevice(const QString & devicePath)
2779+{
2780+ Q_EMIT deviceAdded(devicePath);
2781+}
2782+
2783+/*
2784+ * Returns a QVector of InputDevices of type filter
2785+ * */
2786+QVector <QInputDevice *> QInputDeviceManager::deviceListOfType(QInputDevice::InputType filter)
2787+{
2788+ QVector <QInputDevice *> dList;
2789+ QMapIterator<QString, QInputDevice *> i(d_ptr->deviceMap);
2790+ while (i.hasNext()) {
2791+ i.next();
2792+ if (i.value()->type().testFlag(filter) || filter == QInputDevice::Unknown) {
2793+ dList.append(i.value());
2794+ }
2795+ }
2796+ return dList;
2797+}
2798+
2799+/*
2800+ * Returns the number of input devices with the currently set QInputDevice::InputType filter.
2801+ * If no device filter has been set, returns number of all available input devices.
2802+ * If filter has not been set, returns all available input devices
2803+ */
2804+int QInputDeviceManager::deviceCount() const
2805+{
2806+ return deviceCount(static_cast< QInputDevice::InputType >(d_ptr->currentFilter));
2807+}
2808+
2809+/*
2810+ * Returns the number of input devices of the type filter.
2811+ */
2812+int QInputDeviceManager::deviceCount(const QInputDevice::InputType filter) const
2813+{
2814+ int dList = 0;
2815+ QMapIterator<QString, QInputDevice *> i(d_ptr->deviceMap);
2816+ while (i.hasNext()) {
2817+ i.next();
2818+// qDebug() << i.value()->name() << i.value()->devicePath();
2819+// qDebug() << i.value()->type() << i.value()->type().testFlag(filter);
2820+
2821+ if (i.value()->type().testFlag(filter)) {
2822+ dList++;
2823+ }
2824+ }
2825+ return dList;
2826+}
2827+
2828+/*
2829+ * Returns the currently set device filter.
2830+ * */
2831+QInputDevice::InputType QInputDeviceManager::deviceFilter()
2832+{
2833+ return d_ptr->currentFilter;
2834+}
2835+
2836+/*
2837+ * Sets the current input device filter to filter.
2838+ * */
2839+void QInputDeviceManager::setDeviceFilter(QInputDevice::InputType filter)
2840+{
2841+ if (filter != d_ptr->currentFilter) {
2842+ d_ptr->currentFilter = filter;
2843+ Q_EMIT deviceFilterChanged(filter);
2844+ }
2845+}
2846+
2847+QT_END_NAMESPACE
2848
2849=== added file 'src/plugin/file-qml-plugin/InputInfo/qinputinfo.h'
2850--- src/plugin/file-qml-plugin/InputInfo/qinputinfo.h 1970-01-01 00:00:00 +0000
2851+++ src/plugin/file-qml-plugin/InputInfo/qinputinfo.h 2016-01-14 17:54:32 +0000
2852@@ -0,0 +1,143 @@
2853+/****************************************************************************
2854+**
2855+** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
2856+** Contact: http://www.qt-project.org/legal
2857+**
2858+** This file is part of the QtSystems module of the Qt Toolkit.
2859+**
2860+** $QT_BEGIN_LICENSE:LGPL$
2861+** Commercial License Usage
2862+** Licensees holding valid commercial Qt licenses may use this file in
2863+** accordance with the commercial license agreement provided with the
2864+** Software or, alternatively, in accordance with the terms contained in
2865+** a written agreement between you and Digia. For licensing terms and
2866+** conditions see http://qt.digia.com/licensing. For further information
2867+** use the contact form at http://qt.digia.com/contact-us.
2868+**
2869+** GNU Lesser General Public License Usage
2870+** Alternatively, this file may be used under the terms of the GNU Lesser
2871+** General Public License version 2.1 as published by the Free Software
2872+** Foundation and appearing in the file LICENSE.LGPL included in the
2873+** packaging of this file. Please review the following information to
2874+** ensure the GNU Lesser General Public License version 2.1 requirements
2875+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
2876+**
2877+** In addition, as a special exception, Digia gives you certain additional
2878+** rights. These rights are described in the Digia Qt LGPL Exception
2879+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
2880+**
2881+** GNU General Public License Usage
2882+** Alternatively, this file may be used under the terms of the GNU
2883+** General Public License version 3.0 as published by the Free Software
2884+** Foundation and appearing in the file LICENSE.GPL included in the
2885+** packaging of this file. Please review the following information to
2886+** ensure the GNU General Public License version 3.0 requirements will be
2887+** met: http://www.gnu.org/copyleft/gpl.html.
2888+**
2889+**
2890+** $QT_END_LICENSE$
2891+**
2892+****************************************************************************/
2893+
2894+#ifndef QINPUTINFO_H
2895+#define QINPUTINFO_H
2896+
2897+#include <QObject>
2898+#include <QVector>
2899+#include <QMap>
2900+#include <QSocketNotifier>
2901+#include <QDebug>
2902+
2903+class QInputDeviceManagerPrivate;
2904+class QInputDevicePrivate;
2905+class QInputDevice;
2906+
2907+class QInputDeviceManager;
2908+
2909+class QInputDevice : public QObject
2910+{
2911+ Q_OBJECT
2912+ Q_ENUMS(InputType)
2913+ Q_FLAGS(InputType InputTypeFlags)
2914+ friend class QInputDeviceManagerPrivate;
2915+
2916+public:
2917+
2918+ enum InputType {
2919+ Unknown = 0,
2920+ Button = 1,
2921+ Mouse = 2,
2922+ TouchPad = 4,
2923+ TouchScreen = 8,
2924+ Keyboard = 16,
2925+ Switch = 32
2926+ };
2927+ Q_ENUMS(InputType)
2928+ Q_DECLARE_FLAGS(InputTypeFlags, InputType)
2929+
2930+ explicit QInputDevice(QObject *parent = 0);
2931+ QString name() const;
2932+ QString devicePath() const;
2933+ QList <int> buttons() const; //keys event code
2934+ QList <int> switches() const;
2935+ QList <int> relativeAxis() const;
2936+ QList <int> absoluteAxis() const;
2937+ QInputDevice::InputTypeFlags type() const;
2938+
2939+private:
2940+
2941+ QInputDevicePrivate *d_ptr;
2942+ void setName(const QString &);
2943+ void setDevicePath(const QString &);
2944+ void addButton(int);
2945+ void addSwitch(int);
2946+ void addRelativeAxis(int);
2947+ void addAbsoluteAxis(int);
2948+ void setType(QInputDevice::InputTypeFlags flags);
2949+
2950+};
2951+
2952+Q_DECLARE_METATYPE(QInputDevice::InputType)
2953+Q_DECLARE_METATYPE(QInputDevice::InputTypeFlags)
2954+
2955+class QInputDeviceManagerPrivate;
2956+
2957+class QInputDeviceManager : public QObject
2958+{
2959+ Q_OBJECT
2960+ Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
2961+ Q_PROPERTY(QInputDevice::InputType deviceFilter READ deviceFilter WRITE setDeviceFilter NOTIFY deviceFilterChanged)
2962+public:
2963+
2964+ explicit QInputDeviceManager(QObject *parent = 0);
2965+
2966+ int deviceCount() const;
2967+ int deviceCount(const QInputDevice::InputType filter) const;
2968+
2969+ void setDeviceFilter(QInputDevice::InputType filter);
2970+ QInputDevice::InputType deviceFilter();
2971+
2972+ QMap <QString, QInputDevice *> deviceMap();
2973+ Q_INVOKABLE QVector <QInputDevice *> deviceListOfType(QInputDevice::InputType filter);
2974+
2975+Q_SIGNALS:
2976+
2977+ void deviceAdded(const QString & devicePath);
2978+ void deviceRemoved(const QString & devicePath);
2979+
2980+ void ready();
2981+ void deviceCountChanged(int count);
2982+ void deviceFilterChanged(const QInputDevice::InputType filter);
2983+
2984+public Q_SLOTS:
2985+ void addedDevice(const QString & devicePath);
2986+
2987+private:
2988+ Q_DISABLE_COPY(QInputDeviceManager)
2989+#if !defined(QT_SIMULATOR)
2990+ QInputDeviceManagerPrivate *const d_ptr;
2991+ Q_DECLARE_PRIVATE(QInputDeviceManager)
2992+#endif
2993+};
2994+
2995+#endif // QINPUTINFO_H
2996
2997=== added file 'src/plugin/file-qml-plugin/InputInfo/qmldir'
2998--- src/plugin/file-qml-plugin/InputInfo/qmldir 1970-01-01 00:00:00 +0000
2999+++ src/plugin/file-qml-plugin/InputInfo/qmldir 2016-01-14 17:54:32 +0000
3000@@ -0,0 +1,3 @@
3001+module Unity.InputInfo
3002+plugin InputInfo
3003+typeinfo InputInfo.qmltypes
3004
3005=== modified file 'src/plugin/file-qml-plugin/backend.cpp'
3006--- src/plugin/file-qml-plugin/backend.cpp 2015-09-19 15:40:22 +0000
3007+++ src/plugin/file-qml-plugin/backend.cpp 2016-01-14 17:54:32 +0000
3008@@ -21,15 +21,25 @@
3009 #include "backend.h"
3010 #include "documentmodel.h"
3011 #include "docviewerfile.h"
3012-#include "docviewerutils.h"
3013-
3014-static QObject *registerDocviewerUtils (QQmlEngine *engine, QJSEngine *scriptEngine)
3015-{
3016- Q_UNUSED(engine)
3017- Q_UNUSED(scriptEngine)
3018-
3019- DocviewerUtils *ch = new DocviewerUtils();
3020- return ch;
3021+#include "fileutils.h"
3022+#include "ubuntuconvergenceutils.h"
3023+
3024+static QObject *registerFileUtils (QQmlEngine *engine, QJSEngine *scriptEngine)
3025+{
3026+ Q_UNUSED(engine)
3027+ Q_UNUSED(scriptEngine)
3028+
3029+ DocviewerFileUtils *f = new DocviewerFileUtils();
3030+ return f;
3031+}
3032+
3033+static QObject *registerConvergenceUtils (QQmlEngine *engine, QJSEngine *scriptEngine)
3034+{
3035+ Q_UNUSED(engine)
3036+ Q_UNUSED(scriptEngine)
3037+
3038+ UbuntuConvergenceUtils *c = new UbuntuConvergenceUtils();
3039+ return c;
3040 }
3041
3042 void BackendPlugin::registerTypes(const char *uri)
3043@@ -41,7 +51,8 @@
3044 qmlRegisterType<DocumentModel>(uri, 1, 0, "DocumentsModel");
3045 qmlRegisterType<DocviewerFile>(uri, 1, 0, "File");
3046
3047- qmlRegisterSingletonType<DocviewerUtils>(uri, 1, 0, "DocumentViewer", registerDocviewerUtils);
3048+ qmlRegisterSingletonType<DocviewerFileUtils>(uri, 1, 0, "FileUtils", registerFileUtils);
3049+ qmlRegisterSingletonType<UbuntuConvergenceUtils>(uri, 1, 0, "ConvergenceUtils", registerConvergenceUtils);
3050 }
3051
3052 void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
3053
3054=== modified file 'src/plugin/file-qml-plugin/documentmodel.cpp'
3055--- src/plugin/file-qml-plugin/documentmodel.cpp 2015-09-19 15:40:22 +0000
3056+++ src/plugin/file-qml-plugin/documentmodel.cpp 2016-01-14 17:54:32 +0000
3057@@ -17,7 +17,7 @@
3058
3059 #include "documentmodel.h"
3060 #include "fswatcher.h"
3061-#include "docviewerutils.h"
3062+#include "fileutils.h"
3063
3064 #include <QStandardPaths>
3065 #include <QDir>
3066@@ -115,7 +115,7 @@
3067
3068 bool DocumentModel::isFileSupported(const QString &path)
3069 {
3070- return DocviewerUtils::isFileSupported(path);
3071+ return DocviewerFileUtils::isFileSupported(path);
3072 }
3073
3074 QHash<int, QByteArray> DocumentModel::roleNames() const
3075
3076=== renamed file 'src/plugin/file-qml-plugin/docviewerutils.cpp' => 'src/plugin/file-qml-plugin/fileutils.cpp'
3077--- src/plugin/file-qml-plugin/docviewerutils.cpp 2015-12-27 12:10:06 +0000
3078+++ src/plugin/file-qml-plugin/fileutils.cpp 2016-01-14 17:54:32 +0000
3079@@ -14,7 +14,7 @@
3080 along with this program. If not, see http://www.gnu.org/licenses/.
3081 */
3082
3083-#include "docviewerutils.h"
3084+#include "fileutils.h"
3085
3086 #include <QFileInfo>
3087 #include <QDir>
3088@@ -22,18 +22,8 @@
3089 #include <QStandardPaths>
3090 #include <QDirIterator>
3091 #include <QDateTime>
3092-#include <QtGui/QGuiApplication>
3093-
3094-bool DocviewerUtils::desktopMode() const
3095-{
3096- // Assume that platformName (QtUbuntu) with ubuntu
3097- // in name means it's running on device
3098- // TODO: replace this check with SDK call for formfactor
3099- QString platform = QGuiApplication::platformName();
3100- return !((platform == "ubuntu") || (platform == "ubuntumirclient"));
3101-}
3102-
3103-bool DocviewerUtils::exists(const QString &path)
3104+
3105+bool DocviewerFileUtils::exists(const QString &path)
3106 {
3107 QFileInfo fi(path);
3108
3109@@ -44,12 +34,12 @@
3110 return QDir(path).exists();
3111 }
3112
3113-bool DocviewerUtils::copy(const QString &source, const QString &destination)
3114+bool DocviewerFileUtils::copy(const QString &source, const QString &destination)
3115 {
3116 return QFile::copy(source, destination);
3117 }
3118
3119-bool DocviewerUtils::isFileSupported(const QString &path)
3120+bool DocviewerFileUtils::isFileSupported(const QString &path)
3121 {
3122 QMimeDatabase mdb;
3123 const QString mimetype = mdb.mimeTypeForFile(path).name();
3124@@ -65,12 +55,12 @@
3125 || mimetype == "application/vnd.ms-powerpoint";
3126 }
3127
3128-QString DocviewerUtils::getXdgDocumentsLocation()
3129+QString DocviewerFileUtils::getXdgDocumentsLocation()
3130 {
3131 return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
3132 }
3133
3134-QString DocviewerUtils::buildDestinationPath(const QString &destinationDir, const QString &sourcePath)
3135+QString DocviewerFileUtils::buildDestinationPath(const QString &destinationDir, const QString &sourcePath)
3136 {
3137 QFileInfo fi(sourcePath);
3138
3139@@ -135,7 +125,7 @@
3140 // Return the path of the file, if found in the storageLocation paths,
3141 // otherwise return an empty string.
3142 // Used for prevent importing of a second copy of a file through ContentHub.
3143-QString DocviewerUtils::checkIfFileAlreadyImported(const QString &filePath, const QStringList &storageLocationList)
3144+QString DocviewerFileUtils::checkIfFileAlreadyImported(const QString &filePath, const QStringList &storageLocationList)
3145 {
3146 QFileInfo fi(filePath);
3147 QStringList files;
3148@@ -168,17 +158,17 @@
3149 return QString();
3150 }
3151
3152-QString DocviewerUtils::getFileBaseNameFromPath(const QString &filePath)
3153+QString DocviewerFileUtils::getFileBaseNameFromPath(const QString &filePath)
3154 {
3155 return QFileInfo(filePath).completeBaseName();
3156 }
3157
3158-QString DocviewerUtils::getFileNameFromPath(const QString &filePath)
3159+QString DocviewerFileUtils::getFileNameFromPath(const QString &filePath)
3160 {
3161 return QFileInfo(filePath).fileName();
3162 }
3163
3164-QString DocviewerUtils::getCanonicalPath(const QString &filePath)
3165+QString DocviewerFileUtils::getCanonicalPath(const QString &filePath)
3166 {
3167 return QFileInfo(filePath).canonicalPath();
3168 }
3169
3170=== renamed file 'src/plugin/file-qml-plugin/docviewerutils.h' => 'src/plugin/file-qml-plugin/fileutils.h'
3171--- src/plugin/file-qml-plugin/docviewerutils.h 2015-12-27 12:10:06 +0000
3172+++ src/plugin/file-qml-plugin/fileutils.h 2016-01-14 17:54:32 +0000
3173@@ -14,19 +14,16 @@
3174 along with this program. If not, see http://www.gnu.org/licenses/.
3175 */
3176
3177-#ifndef DOCVIEWERUTILS_H
3178-#define DOCVIEWERUTILS_H
3179+#ifndef DOCVIEWER_FILEUTILS_H
3180+#define DOCVIEWER_FILEUTILS_H
3181
3182 #include <QObject>
3183
3184-class DocviewerUtils : public QObject
3185+class DocviewerFileUtils : public QObject
3186 {
3187 Q_OBJECT
3188- Q_PROPERTY(bool desktopMode READ desktopMode CONSTANT)
3189
3190 public:
3191- bool desktopMode() const;
3192-
3193 Q_INVOKABLE static bool exists(const QString &path);
3194 Q_INVOKABLE static bool copy(const QString &source, const QString &destination);
3195
3196@@ -42,4 +39,4 @@
3197 Q_INVOKABLE static QString getCanonicalPath(const QString &filePath);
3198 };
3199
3200-#endif // DOCVIEWERUTILS_H
3201+#endif // DOCVIEWER_FILEUTILS_H
3202
3203=== added file 'src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp'
3204--- src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp 1970-01-01 00:00:00 +0000
3205+++ src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp 2016-01-14 17:54:32 +0000
3206@@ -0,0 +1,82 @@
3207+/*
3208+ Copyright (C) 2015 Stefano Verzegnassi
3209+
3210+ This program is free software: you can redistribute it and/or modify
3211+ it under the terms of the GNU General Public License 3 as published by
3212+ the Free Software Foundation.
3213+
3214+ This program is distributed in the hope that it will be useful,
3215+ but WITHOUT ANY WARRANTY; without even the implied warranty of
3216+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3217+ GNU General Public License for more details.
3218+
3219+ You should have received a copy of the GNU General Public License
3220+ along with this program. If not, see http://www.gnu.org/licenses/.
3221+*/
3222+
3223+#include "ubuntuconvergenceutils.h"
3224+#include "InputInfo/qinputinfo.h"
3225+
3226+#include <QtGui/QGuiApplication>
3227+
3228+bool isUnity8Env()
3229+{
3230+ // Assume that platformName (QtUbuntu) with ubuntu
3231+ // in name means it's running on device
3232+ QString platform = QGuiApplication::platformName();
3233+ return (platform == "ubuntu") || (platform == "ubuntumirclient");
3234+}
3235+
3236+UbuntuConvergenceUtils::UbuntuConvergenceUtils(QObject *parent) :
3237+ QObject(parent),
3238+ m_desktopMode(false),
3239+ m_mouseAttached(false),
3240+ m_inputDevicesWatcher(new QInputDeviceManager())
3241+{
3242+ // Initialize signals when the watcher is ready.
3243+ // QInputDeviceManager() emits deviceAdded() signal multiple times during its
3244+ // initializations.
3245+ connect(m_inputDevicesWatcher, &QInputDeviceManager::ready,
3246+ this, &UbuntuConvergenceUtils::init);
3247+}
3248+
3249+void UbuntuConvergenceUtils::init()
3250+{
3251+ // Connect signals
3252+ connect(m_inputDevicesWatcher, SIGNAL(deviceAdded(QString)), this, SLOT(checkPointersCount()));
3253+ connect(m_inputDevicesWatcher, SIGNAL(deviceRemoved(QString)), this, SLOT(checkPointersCount()));
3254+
3255+ checkPointersCount();
3256+}
3257+
3258+void UbuntuConvergenceUtils::checkPointersCount()
3259+{
3260+ int mouseCount = m_inputDevicesWatcher->deviceCount(QInputDevice::Mouse);
3261+ int touchPadCount = m_inputDevicesWatcher->deviceCount(QInputDevice::TouchPad);
3262+
3263+ setMouseAttached(mouseCount || touchPadCount);
3264+ setDesktopMode(isUnity8Env() || m_mouseAttached);
3265+}
3266+
3267+void UbuntuConvergenceUtils::setDesktopMode(bool desktopMode)
3268+{
3269+ if (m_desktopMode == desktopMode)
3270+ return;
3271+
3272+ m_desktopMode = desktopMode;
3273+ Q_EMIT desktopModeChanged();
3274+}
3275+
3276+void UbuntuConvergenceUtils::setMouseAttached(bool mouseAttached)
3277+{
3278+ if (m_mouseAttached == mouseAttached)
3279+ return;
3280+
3281+ m_mouseAttached = mouseAttached;
3282+ Q_EMIT mouseAttachedChanged();
3283+}
3284+
3285+UbuntuConvergenceUtils::~UbuntuConvergenceUtils()
3286+{
3287+ delete m_inputDevicesWatcher;
3288+}
3289
3290=== added file 'src/plugin/file-qml-plugin/ubuntuconvergenceutils.h'
3291--- src/plugin/file-qml-plugin/ubuntuconvergenceutils.h 1970-01-01 00:00:00 +0000
3292+++ src/plugin/file-qml-plugin/ubuntuconvergenceutils.h 2016-01-14 17:54:32 +0000
3293@@ -0,0 +1,56 @@
3294+/*
3295+ Copyright (C) 2015 Stefano Verzegnassi
3296+
3297+ This program is free software: you can redistribute it and/or modify
3298+ it under the terms of the GNU General Public License 3 as published by
3299+ the Free Software Foundation.
3300+
3301+ This program is distributed in the hope that it will be useful,
3302+ but WITHOUT ANY WARRANTY; without even the implied warranty of
3303+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3304+ GNU General Public License for more details.
3305+
3306+ You should have received a copy of the GNU General Public License
3307+ along with this program. If not, see http://www.gnu.org/licenses/.
3308+*/
3309+
3310+#ifndef DOCVIEWER_CONVERGENCEUTILS_H
3311+#define DOCVIEWER_CONVERGENCEUTILS_H
3312+
3313+#include <QObject>
3314+
3315+class QInputDeviceManager;
3316+
3317+class UbuntuConvergenceUtils : public QObject
3318+{
3319+ Q_OBJECT
3320+ Q_PROPERTY(bool desktopMode READ desktopMode NOTIFY desktopModeChanged)
3321+ Q_PROPERTY(bool mouseAttached READ mouseAttached NOTIFY mouseAttachedChanged)
3322+
3323+public:
3324+ UbuntuConvergenceUtils(QObject *parent = 0);
3325+ ~UbuntuConvergenceUtils();
3326+
3327+ bool desktopMode() const { return m_desktopMode; }
3328+ bool mouseAttached() const { return m_mouseAttached; }
3329+
3330+Q_SIGNALS:
3331+ void desktopModeChanged();
3332+ void mouseAttachedChanged();
3333+
3334+private slots:
3335+ void checkPointersCount();
3336+ void init();
3337+
3338+private:
3339+ bool m_desktopMode;
3340+ bool m_mouseAttached;
3341+
3342+private:
3343+ QInputDeviceManager* m_inputDevicesWatcher;
3344+
3345+ void setDesktopMode(bool desktopMode);
3346+ void setMouseAttached(bool mouseAttached);
3347+};
3348+
3349+#endif // DOCVIEWER_CONVERGENCEUTILS_H

Subscribers

People subscribed via source and target branches