[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kphotoalbum/category_l10n_removal] /: Re-enabled creating category names in the current locale when
From: Tobias Leupold <tobias.leupold () web ! de>
Date: 2015-11-29 16:22:21
Message-ID: E1a34k1-0006Vg-VE () scm ! kde ! org
[Download RAW message or body]
Git commit dc3dda8e34f03975b285b3000a6fdcc9868d67e4 by Tobias Leupold.
Committed on 29/11/2015 at 16:20.
Pushed by tleupold into branch 'category_l10n_removal'.
Re-enabled creating category names in the current locale when a new database is \
created. Adapted the default XML data to what KPA produces currently. Added default \
icons. Bumped the DB version so that we know if the user has already been informed \
about our changes.
M +1 -1 XMLDB/Database.cpp
M +9 -1 XMLDB/FileReader.cpp
M +9 -9 default-setup
M +11 -0 documentation/database-layout.md
http://commits.kde.org/kphotoalbum/dc3dda8e34f03975b285b3000a6fdcc9868d67e4
diff --git a/XMLDB/Database.cpp b/XMLDB/Database.cpp
index c7f6635..18fa61e 100644
--- a/XMLDB/Database.cpp
+++ b/XMLDB/Database.cpp
@@ -518,7 +518,7 @@ void XMLDB::Database::copyData(const DB::FileName &from, const \
DB::FileName &to) int XMLDB::Database::fileVersion()
{
// File format version, bump it up every time the format for the file changes.
- return 6;
+ return 7;
}
diff --git a/XMLDB/FileReader.cpp b/XMLDB/FileReader.cpp
index b776cce..d5652c6 100644
--- a/XMLDB/FileReader.cpp
+++ b/XMLDB/FileReader.cpp
@@ -225,7 +225,8 @@ void XMLDB::FileReader::loadCategories( ReaderPtr reader )
"and save your database."
"</p>"
"<p>"
- "<b>Sorry for the inconsistency!</b>"
+ "<b>Sorry for the inconsistency!</b> This warning will not be \
displayed anymore" + "when you have saved your database for the first \
time." "</p>"),
i18n("Changed standard category names")
);
@@ -413,6 +414,13 @@ XMLDB::ReaderPtr XMLDB::FileReader::readConfigFile( const \
QString& configFile ) QTextStream stream( &file );
stream.setCodec( QTextCodec::codecForName("UTF-8") );
QString str = stream.readAll();
+
+ // Replace the default setup's category and tag names with localized \
ones + str = str.replace(QString::fromUtf8("People"), i18n("People"));
+ str = str.replace(QString::fromUtf8("Places"), i18n("Places"));
+ str = str.replace(QString::fromUtf8("Events"), i18n("Events"));
+ str = str.replace(QString::fromUtf8("untagged"), i18n("untagged"));
+
str = str.replace( QRegExp( \
QString::fromLatin1("imageDirectory=\"[^\"]*\"")), \
QString::fromLatin1("") );
str = str.replace( QRegExp( \
QString::fromLatin1("htmlBaseDir=\"[^\"]*\"")), \
QString::fromLatin1("") );
str = str.replace( QRegExp( \
QString::fromLatin1("htmlBaseURL=\"[^\"]*\"")), \
QString::fromLatin1("") );
diff --git a/default-setup b/default-setup
index 72b62d0..8c9d4ad 100644
--- a/default-setup
+++ b/default-setup
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<KPhotoAlbum version="6" compressed="1" >
- <Categories>
- <Category viewtype="0" viewsize="0" name="Events" show="1">
- <value value="untagged" id="1" />
- </Category>
- <Category viewtype="0" viewsize="0" name="Places" show="1" />
- <Category viewtype="0" viewsize="0" name="People" show="1" positionable="1" />
- </Categories>
- <images/>
+<KPhotoAlbum version="7" compressed="1">
+ <Categories>
+ <Category name="People" icon="system-users" show="1" viewtype="0" \
positionable="1"/> + <Category name="Places" icon="applications-internet" \
show="1" viewtype="0"/> + <Category name="Events" icon="favorites" show="1" \
viewtype="0"> + <value value="untagged" id="1"/>
+ </Category>
+ </Categories>
+ <images/>
</KPhotoAlbum>
diff --git a/documentation/database-layout.md b/documentation/database-layout.md
index 629c4c3..2f0dfb3 100644
--- a/documentation/database-layout.md
+++ b/documentation/database-layout.md
@@ -221,6 +221,17 @@ Same structure as version 5.
superseded by storing GPS data in the EXIF database.
+### Version 7 ###
+
+Same structure as version 7.
+
+#### Differences to version 6 ####
+The concept of translatable "standard" categories led to a lot of problems when \
users started KPA +with different locales. Some of them simply can't be solved, so we \
decided to remove translatable +category names. Now, each category is stored with \
it's literal name. The version bump is only needed +to know if a warning about this \
change should be displayed or not. +
+
### Attribute values explained ###
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic