[office/tellico] /: Add label for file listing collection and doc update

Robby Stephenson null at kde.org
Wed Mar 13 14:37:21 GMT 2024


Git commit 53f9cb1b334e2ebc91668c64709e3f949102d470 by Robby Stephenson.
Committed on 13/03/2024 at 14:37.
Pushed by rstephenson into branch 'master'.

Add label for file listing collection and doc update

M  +6    -1    doc/importing-exporting.docbook
M  +2    -2    src/tests/filelistingtest.cpp
M  +11   -5    src/translators/filelistingimporter.cpp
M  +1    -1    src/translators/filereadervideo.cpp

https://invent.kde.org/office/tellico/-/commit/53f9cb1b334e2ebc91668c64709e3f949102d470

diff --git a/doc/importing-exporting.docbook b/doc/importing-exporting.docbook
index 6ecec2ab..53d38899 100644
--- a/doc/importing-exporting.docbook
+++ b/doc/importing-exporting.docbook
@@ -213,8 +213,13 @@ The <ulink url="https://en.wikipedia.org/wiki/RIS_(file_format)"><acronym>RIS</a
 <title>Importing File Listings</title>
 
 <para>
-The best way to create a <link linkend="file-catalog">File Catalog</link> is to import the contents of a folder. The folder may be searched recursively, to add all files found within. This importer is most useful for backup listings and media cataloging, such as &CD; or <acronym>DVD</acronym> listings. In addition, image previews of the file contents may be generated, although it can take some time to read a large number of files. The file previews are same as those shown in the &kde; file manager.
+&tellico; can scan folders to import file information, primarily to create a <link linkend="file-catalog">File Catalog</link> collection. The folder may be searched recursively, to add all files found within. This importer is most useful for backup listings and media cataloging, such as &CD; or <acronym>DVD</acronym> listings. In addition, image previews of the file contents may be generated. The file previews are same as those shown in the &kde; file manager.
 </para>
+
+<para>
+Folders with ebook files and video files may also be imported as book and video collections. File metadata can be read, and for video files, any existing <literal role="extension">nfo</literal> files are used to complete the video entry information.
+</para>
+
 </sect2>
 
 <sect2 id="importing-xslt">
diff --git a/src/tests/filelistingtest.cpp b/src/tests/filelistingtest.cpp
index 506aeb51..c19323fe 100644
--- a/src/tests/filelistingtest.cpp
+++ b/src/tests/filelistingtest.cpp
@@ -38,8 +38,7 @@
 #include <QLoggingCategory>
 #include <QStandardPaths>
 
-// KIO::listDir in FileListingImporter seems to require a GUI Application
-QTEST_MAIN( FileListingTest )
+QTEST_GUILESS_MAIN( FileListingTest )
 
 void FileListingTest::initTestCase() {
   QStandardPaths::setTestModeEnabled(true);
@@ -177,6 +176,7 @@ void FileListingTest::testVideo() {
   QVERIFY(!castList.isEmpty());
   QCOMPARE(castList.at(0), QStringLiteral("Jill Actress::Heroine"));
   QVERIFY(!e0->field("plot").isEmpty());
+  QCOMPARE(e0->field("url"), url.url());
 
   QVERIFY(e1);
   QCOMPARE(e1->field("title"), QStringLiteral("Alien"));
diff --git a/src/translators/filelistingimporter.cpp b/src/translators/filelistingimporter.cpp
index 1ef52db2..38a80168 100644
--- a/src/translators/filelistingimporter.cpp
+++ b/src/translators/filelistingimporter.cpp
@@ -43,6 +43,7 @@
 
 #include <QDate>
 #include <QDir>
+#include <QLabel>
 #include <QCheckBox>
 #include <QGroupBox>
 #include <QFile>
@@ -157,7 +158,7 @@ QWidget* FileListingImporter::widget(QWidget* parent_) {
   QVBoxLayout* l = new QVBoxLayout(m_widget);
 
   QGroupBox* gbox = new QGroupBox(i18n("File Listing Options"), m_widget);
-  QVBoxLayout* vlay = new QVBoxLayout(gbox);
+  auto lay = new QGridLayout(gbox);
 
   m_recursive = new QCheckBox(i18n("Recursive folder search"), gbox);
   m_recursive->setWhatsThis(i18n("If checked, folders are recursively searched for all files."));
@@ -175,10 +176,15 @@ QWidget* FileListingImporter::widget(QWidget* parent_) {
   m_collCombo = new GUI::CollectionTypeCombo(gbox);
   m_collCombo->setIncludedTypes(collTypes);
   m_collCombo->setCurrentData(m_collType);
-
-  vlay->addWidget(m_recursive);
-  vlay->addWidget(m_filePreview);
-  vlay->addWidget(m_collCombo);
+  m_collCombo->setWhatsThis(i18n("Select the type of collection being imported."));
+  auto lab = new QLabel(i18n("Collection &type:"), gbox);
+  lab->setBuddy(m_collCombo);
+
+  int row = 0;
+  lay->addWidget(m_recursive, row++, 0, 1, -1);
+  lay->addWidget(m_filePreview, row++, 0, 1, -1);
+  lay->addWidget(lab, row, 0);
+  lay->addWidget(m_collCombo, row++, 1);
 
   l->addWidget(gbox);
   l->addStretch(1);
diff --git a/src/translators/filereadervideo.cpp b/src/translators/filereadervideo.cpp
index 64eddf01..f89406fc 100644
--- a/src/translators/filereadervideo.cpp
+++ b/src/translators/filereadervideo.cpp
@@ -64,7 +64,7 @@ bool FileReaderVideo::populate(Data::EntryPtr entry, const KFileItem& item) {
     return false;
   }
   bool isEmpty = true;
-#ifdef HAVE_KFILEMETADATA2
+#ifdef HAVE_KFILEMETADATA
   QStringList genres, keywords;
   const auto props = properties(item);
   for(auto it = props.constBegin(); it != props.constEnd(); ++it) {


More information about the kde-doc-english mailing list