-
-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1198, start of Nextcloud bookmarks import implementation
- Loading branch information
Showing
50 changed files
with
149,287 additions
and
148,590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#define BUILD 533 | ||
#define BUILD 534 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <QtQml/QJSValueIterator> | ||
#include "serverbookmarksimportdialog.h" | ||
#include "ui_serverbookmarksimportdialog.h" | ||
|
||
ServerBookmarksImportDialog::ServerBookmarksImportDialog( | ||
QJSValue bookmarks, MainWindow *mainWindow, QWidget *parent) : | ||
MasterDialog(parent), | ||
ui(new Ui::ServerBookmarksImportDialog) { | ||
ui->setupUi(this); | ||
|
||
// init the iterator for the versions | ||
QJSValueIterator bookmarksIterator(bookmarks); | ||
|
||
QString url; | ||
QString title; | ||
QString description; | ||
QStringList tags; | ||
|
||
// iterate over the bookmarks | ||
while (bookmarksIterator.hasNext()) { | ||
bookmarksIterator.next(); | ||
|
||
QJSValue property = bookmarksIterator.value().property("url"); | ||
|
||
if (property.isUndefined()) { | ||
continue; | ||
} | ||
|
||
url = property.toString(); | ||
|
||
qDebug() << __func__ << " - 'url': " << url; | ||
|
||
if (url == "") { | ||
continue; | ||
} | ||
|
||
title = bookmarksIterator.value().property("title").toString(); | ||
description = bookmarksIterator.value().property("description").toString(); | ||
tags = bookmarksIterator.value().property("tags").toVariant().toStringList(); | ||
|
||
qDebug() << __func__ << " - 'tags': " << tags; | ||
} | ||
} | ||
|
||
ServerBookmarksImportDialog::~ServerBookmarksImportDialog() { | ||
delete ui; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef SERVERBOOKMARKSIMPORTDIALOG_H | ||
#define SERVERBOOKMARKSIMPORTDIALOG_H | ||
|
||
#include <QDialog> | ||
#include <QJSValue> | ||
#include <mainwindow.h> | ||
#include "masterdialog.h" | ||
|
||
namespace Ui { | ||
class ServerBookmarksImportDialog; | ||
} | ||
|
||
class ServerBookmarksImportDialog : public MasterDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ServerBookmarksImportDialog(QJSValue bookmarks, | ||
MainWindow *mainWindow, QWidget *parent = 0); | ||
~ServerBookmarksImportDialog(); | ||
|
||
private: | ||
Ui::ServerBookmarksImportDialog *ui; | ||
}; | ||
|
||
#endif // SERVERBOOKMARKSIMPORTDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ServerBookmarksImportDialog</class> | ||
<widget class="QDialog" name="ServerBookmarksImportDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Import bookmarks</string> | ||
</property> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.