[office/tellico] /: Add command line option to import PDF file
Robby Stephenson
null at kde.org
Sat Sep 25 02:24:25 BST 2021
Git commit 491d2694de7d6d6334791a803689ea17e5bbbf25 by Robby Stephenson.
Committed on 25/09/2021 at 00:43.
Pushed by rstephenson into branch 'master'.
Add command line option to import PDF file
M +4 -0 ChangeLog
M +1 -0 doc/advanced.docbook
M +3 -0 src/main.cpp
https://invent.kde.org/office/tellico/commit/491d2694de7d6d6334791a803689ea17e5bbbf25
diff --git a/ChangeLog b/ChangeLog
index 36b6b0c9..b30269d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-09-24 Robby Stephenson <robby at periapsis.org>
+
+ * Added command-line option to import PDF file.
+
2021-08-22 Robby Stephenson <robby at periapsis.org>
* Added DBUS command to import PDF files.
diff --git a/doc/advanced.docbook b/doc/advanced.docbook
index a687c2f3..47e57d7e 100644
--- a/doc/advanced.docbook
+++ b/doc/advanced.docbook
@@ -18,6 +18,7 @@ Options:
--bibtex Import <filename> as a bibtex file
--mods Import <filename> as a MODS file
--ris Import <filename> as a RIS file
+ --pdf Import <filename> as a PDF file
Arguments:
[filename] File to open
diff --git a/src/main.cpp b/src/main.cpp
index f4953402..9bedd059 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -143,6 +143,7 @@ int main(int argc, char* argv[]) {
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("bibtex"), i18n("Import <filename> as a bibtex file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("mods"), i18n("Import <filename> as a MODS file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("ris"), i18n("Import <filename> as a RIS file")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("pdf"), i18n("Import <filename> as a PDF file")));
parser.addPositionalArgument(QStringLiteral("[filename]"), i18n("File to open"));
aboutData.setupCommandLine(&parser);
@@ -170,6 +171,8 @@ int main(int argc, char* argv[]) {
tellico->importFile(Tellico::Import::MODS, QUrl::fromUserInput(args.at(0)), Tellico::Import::Replace);
} else if(parser.isSet(QStringLiteral("ris"))) {
tellico->importFile(Tellico::Import::RIS, QUrl::fromUserInput(args.at(0)), Tellico::Import::Replace);
+ } else if(parser.isSet(QStringLiteral("pdf"))) {
+ tellico->importFile(Tellico::Import::PDF, QUrl::fromUserInput(args.at(0)), Tellico::Import::Replace);
} else {
tellico->slotFileOpen(QUrl::fromUserInput(args.at(0), QDir::currentPath()));
}
More information about the kde-doc-english
mailing list