[krita] libs: Overhaul Author Profile handling.

Wolthera van Hövell tot Westerflier null at kde.org
Fri Nov 24 13:49:57 UTC 2017


Git commit 04042ba101b15efc88095551e4baadf8ffe0143d by Wolthera van Hövell tot Westerflier.
Committed on 24/11/2017 at 13:45.
Pushed by woltherav into branch 'master'.

Overhaul Author Profile handling.

This does a few things:
1. It reworks author profiles so they are more "independant artist in the internet age"-friendly, by adding
things like multiple possible contacts, home page contact, suggestions for the author role and changing the
full name section to "nick name".
2. It removes the automated KUser default author profile to avoid leaking.
3. It puts the author info into  new resources folder, named "authorinfo". This way, this information does
not get deleted when deleting the kritarc file.

Differential revision: https://phabricator.kde.org/D7076
CCMAIL:Kimageshop at kde.org

M  +85   -54   libs/odf/KoDocumentInfo.cpp
M  +10   -0    libs/odf/KoDocumentInfo.h
M  +10   -0    libs/ui/KisViewManager.cpp
M  +302  -72   libs/widgets/KoConfigAuthorPage.cpp
M  +20   -0    libs/widgets/KoConfigAuthorPage.h
M  +92   -154  libs/widgets/KoConfigAuthorPage.ui
M  +9    -9    libs/widgets/KoDocumentInfoDlg.cpp
M  +27   -132  libs/widgets/koDocumentInfoAuthorWidget.ui

https://commits.kde.org/krita/04042ba101b15efc88095551e4baadf8ffe0143d

diff --git a/libs/odf/KoDocumentInfo.cpp b/libs/odf/KoDocumentInfo.cpp
index 3a309f09b47..e084b1266d1 100644
--- a/libs/odf/KoDocumentInfo.cpp
+++ b/libs/odf/KoDocumentInfo.cpp
@@ -29,6 +29,7 @@
 #include <KoXmlWriter.h>
 #include <QDomDocument>
 #include <KoXmlReader.h>
+#include <QDir>
 
 #include <kconfig.h>
 #include <kconfiggroup.h>
@@ -46,11 +47,8 @@ KoDocumentInfo::KoDocumentInfo(QObject *parent) : QObject(parent)
     << "keyword" << "initial-creator" << "editing-cycles" << "editing-time"
     << "date" << "creation-date" << "language";
 
-    m_authorTags << "creator" << "initial" << "author-title"
-    << "email" << "telephone" << "telephone-work"
-    << "fax" << "country" << "postal-code" << "city"
-    << "street" << "position" << "company";
-
+    m_authorTags << "creator" << "creator-first-name" << "creator-last-name" << "initial" << "author-title" << "position" << "company";
+    m_contactTags << "email" << "telephone" << "telephone-work" << "fax" << "country" << "postal-code" << "city" << "street";
     setAboutInfo("editing-cycles", "0");
     setAboutInfo("time-elapsed", "0");
     setAboutInfo("initial-creator", i18n("Unknown"));
@@ -62,10 +60,12 @@ KoDocumentInfo::KoDocumentInfo(const KoDocumentInfo &rhs, QObject *parent)
     : QObject(parent),
       m_aboutTags(rhs.m_aboutTags),
       m_authorTags(rhs.m_authorTags),
+      m_contact(rhs.m_contact),
       m_authorInfo(rhs.m_authorInfo),
       m_authorInfoOverride(rhs.m_authorInfoOverride),
       m_aboutInfo(rhs.m_aboutInfo),
       m_generator(rhs.m_generator)
+
 {
 }
 
@@ -108,7 +108,8 @@ QDomDocument KoDocumentInfo::save(QDomDocument &doc)
 
 void KoDocumentInfo::setAuthorInfo(const QString &info, const QString &data)
 {
-    if (!m_authorTags.contains(info)) {
+    if (!m_authorTags.contains(info) && !m_contactTags.contains(info) && !info.contains("contact-mode-")) {
+        qDebug()<<info<<"dun exist";
         return;
     }
 
@@ -117,12 +118,12 @@ void KoDocumentInfo::setAuthorInfo(const QString &info, const QString &data)
 
 void KoDocumentInfo::setActiveAuthorInfo(const QString &info, const QString &data)
 {
-    if (!m_authorTags.contains(info)) {
+    if (!m_authorTags.contains(info) && !m_contactTags.contains(info) && !info.contains("contact-mode-")) {
+        qDebug()<<info<<"doesn't exist";
         return;
     }
-
-    if (data.isEmpty()) {
-        m_authorInfo.remove(info);
+    if (m_contactTags.contains(info)) {
+        m_contact.insert(data, info);
     } else {
         m_authorInfo.insert(info, data);
     }
@@ -131,12 +132,17 @@ void KoDocumentInfo::setActiveAuthorInfo(const QString &info, const QString &dat
 
 QString KoDocumentInfo::authorInfo(const QString &info) const
 {
-    if (!m_authorTags.contains(info))
+    if (!m_authorTags.contains(info)  && !m_contactTags.contains(info) && !info.contains("contact-mode-"))
         return QString();
 
     return m_authorInfo[ info ];
 }
 
+QStringList KoDocumentInfo::authorContactInfo() const
+{
+    return m_contact.keys();
+}
+
 void KoDocumentInfo::setAboutInfo(const QString &info, const QString &data)
 {
     if (!m_aboutTags.contains(info))
@@ -198,16 +204,20 @@ bool KoDocumentInfo::loadOasisAuthorInfo(const KoXmlNode &metaDoc)
 
 bool KoDocumentInfo::loadAuthorInfo(const KoXmlElement &e)
 {
+    m_contact.clear();
     KoXmlNode n = e.namedItem("author").firstChild();
     for (; !n.isNull(); n = n.nextSibling()) {
         KoXmlElement e = n.toElement();
         if (e.isNull())
             continue;
 
-        if (e.tagName() == "full-name")
+        if (e.tagName() == "full-name") {
             setActiveAuthorInfo("creator", e.text().trimmed());
-        else
+        } else if (e.tagName() == "contact") {
+            m_contact.insert(e.text(), e.attribute("type"));
+        } else {
             setActiveAuthorInfo(e.tagName(), e.text().trimmed());
+        }
     }
 
     return true;
@@ -227,6 +237,13 @@ QDomElement KoDocumentInfo::saveAuthorInfo(QDomDocument &doc)
         e.appendChild(t);
         t.appendChild(doc.createTextNode(authorInfo(tag)));
     }
+    for (int i=0; i<m_contact.keys().size(); i++) {
+        t = doc.createElement("contact");
+        e.appendChild(t);
+        QString key = m_contact.keys().at(i);
+        t.setAttribute("type", m_contact[key]);
+        t.appendChild(doc.createTextNode(key));
+    }
 
     return e;
 }
@@ -363,52 +380,66 @@ void KoDocumentInfo::updateParameters()
     }
 
     KConfig config("kritarc");
-    config.reparseConfiguration();
-    KConfigGroup authorGroup(&config, "Author");
-    QStringList profiles = authorGroup.readEntry("profile-names", QStringList());
-
     config.reparseConfiguration();
     KConfigGroup appAuthorGroup(&config, "Author");
     QString profile = appAuthorGroup.readEntry("active-profile", "");
 
-    if (profiles.contains(profile)) {
-        KConfigGroup cgs(&authorGroup, "Author-" + profile);
-        setActiveAuthorInfo("creator", cgs.readEntry("creator"));
-        setActiveAuthorInfo("initial", cgs.readEntry("initial"));
-        setActiveAuthorInfo("author-title", cgs.readEntry("author-title"));
-        setActiveAuthorInfo("email", cgs.readEntry("email"));
-        setActiveAuthorInfo("telephone", cgs.readEntry("telephone"));
-        setActiveAuthorInfo("telephone-work", cgs.readEntry("telephone-work"));
-        setActiveAuthorInfo("fax", cgs.readEntry("fax"));
-        setActiveAuthorInfo("country",cgs.readEntry("country"));
-        setActiveAuthorInfo("postal-code",cgs.readEntry("postal-code"));
-        setActiveAuthorInfo("city", cgs.readEntry("city"));
-        setActiveAuthorInfo("street", cgs.readEntry("street"));
-        setActiveAuthorInfo("position", cgs.readEntry("position"));
-        setActiveAuthorInfo("company", cgs.readEntry("company"));
-    } else {
-        if (profile == "anonymous") {
-            setActiveAuthorInfo("creator", QString());
-            setActiveAuthorInfo("telephone", QString());
-            setActiveAuthorInfo("telephone-work", QString());
-            setActiveAuthorInfo("email", QString());
-        } else {
-            KUser user(KUser::UseRealUserID);
-            setActiveAuthorInfo("creator", user.property(KUser::FullName).toString());
-            setActiveAuthorInfo("telephone-work", user.property(KUser::WorkPhone).toString());
-            setActiveAuthorInfo("telephone", user.property(KUser::HomePhone).toString());
-            KEMailSettings eMailSettings;
-            setActiveAuthorInfo("email", eMailSettings.getSetting(KEMailSettings::EmailAddress));
+    QString authorInfo = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/authorinfo/";
+    QDir dir(authorInfo);
+    QStringList filters = QStringList() << "*.authorinfo";
+
+    //Anon case
+    setActiveAuthorInfo("creator", QString());
+    setActiveAuthorInfo("initial", "");
+    setActiveAuthorInfo("author-title", "");
+    setActiveAuthorInfo("position", "");
+    setActiveAuthorInfo("company", "");
+    if (dir.entryList(filters).contains(profile+".authorinfo")) {
+        QFile file(dir.absoluteFilePath(profile+".authorinfo"));
+        if (file.exists()) {
+            file.open(QFile::ReadOnly);
+            QByteArray ba = file.readAll();
+            file.close();
+            QDomDocument doc = QDomDocument();
+            doc.setContent(ba);
+            QDomElement root = doc.firstChildElement();
+
+            QDomElement el = root.firstChildElement("nickname");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("creator", el.text());
+            }
+            el = root.firstChildElement("givenname");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("creator-first-name", el.text());
+            }
+            el = root.firstChildElement("middlename");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("initial", el.text());
+            }
+            el = root.firstChildElement("familyname");
+            if (!el.isNull()) {
+               setActiveAuthorInfo("creator-last-name", el.text());
+            }
+            el = root.firstChildElement("title");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("author-title", el.text());
+            }
+            el = root.firstChildElement("position");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("position", el.text());
+            }
+            el = root.firstChildElement("company");
+            if (!el.isNull()) {
+                setActiveAuthorInfo("company", el.text());
+            }
+
+            m_contact.clear();
+            el = root.firstChildElement("contact");
+            while (!el.isNull()) {
+                m_contact.insert(el.text(), el.attribute("type"));
+                el = el.nextSiblingElement("contact");
+            }
         }
-        setActiveAuthorInfo("initial", "");
-        setActiveAuthorInfo("author-title", "");
-        setActiveAuthorInfo("fax", "");
-        setActiveAuthorInfo("country", "");
-        setActiveAuthorInfo("postal-code", "");
-        setActiveAuthorInfo("city", "");
-        setActiveAuthorInfo("street", "");
-        setActiveAuthorInfo("position", "");
-        setActiveAuthorInfo("company", "");
     }
 
     //alllow author info set programatically to override info from author profile
diff --git a/libs/odf/KoDocumentInfo.h b/libs/odf/KoDocumentInfo.h
index 9845a5775ab..f02d56f64db 100644
--- a/libs/odf/KoDocumentInfo.h
+++ b/libs/odf/KoDocumentInfo.h
@@ -92,6 +92,12 @@ public:
      */
     QString authorInfo(const QString& info) const;
 
+    /**
+     * @brief authorContactInfo
+     * @return returns list of contact info for author.
+     */
+    QStringList authorContactInfo() const;
+
     /**
      * Set information about the document
      * @param info the kind of information to set
@@ -198,6 +204,10 @@ private:
     QStringList m_aboutTags;
     /** A QStringList containing all tags for the author information */
     QStringList m_authorTags;
+    /** A QStringList containing all valid contact tags */
+    QStringList m_contactTags;
+    /** A QMap with the contact modes and their type in the second string */
+    QMap <QString, QString> m_contact;
     /** The map containing information about the author */
     QMap<QString, QString> m_authorInfo;
     /** The map containing information about the author set programatically*/
diff --git a/libs/ui/KisViewManager.cpp b/libs/ui/KisViewManager.cpp
index 59eb5fe1ea2..5dd98bf0264 100644
--- a/libs/ui/KisViewManager.cpp
+++ b/libs/ui/KisViewManager.cpp
@@ -1356,6 +1356,16 @@ void KisViewManager::slotUpdateAuthorProfileActions()
 
     KConfigGroup authorGroup(KoGlobal::calligraConfig(), "Author");
     QStringList profiles = authorGroup.readEntry("profile-names", QStringList());
+    QString authorInfo = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/authorinfo/";
+    QStringList filters = QStringList() << "*.authorinfo";
+    QDir dir(authorInfo);
+    Q_FOREACH(QString entry, dir.entryList(filters)) {
+        int ln = QString(".authorinfo").size();
+        entry.chop(ln);
+        if (!profiles.contains(entry)) {
+            profiles.append(entry);
+        }
+    }
     Q_FOREACH (const QString &profile , profiles) {
         d->actionAuthor->addAction(profile);
     }
diff --git a/libs/widgets/KoConfigAuthorPage.cpp b/libs/widgets/KoConfigAuthorPage.cpp
index e99db28da17..046deaa481f 100644
--- a/libs/widgets/KoConfigAuthorPage.cpp
+++ b/libs/widgets/KoConfigAuthorPage.cpp
@@ -25,6 +25,7 @@
 
 #include <KoGlobal.h>
 #include <KoIcon.h>
+#include <QDebug>
 
 #include <klocalizedstring.h>
 #include <kuser.h>
@@ -33,6 +34,7 @@
 #include <ksharedconfig.h>
 
 #include <QLineEdit>
+#include <QCompleter>
 #include <QStackedWidget>
 #include <QList>
 #include <QComboBox>
@@ -41,6 +43,14 @@
 #include <QStringList>
 #include <QToolButton>
 #include <QInputDialog>
+#include <QTableView>
+#include <QStandardItem>
+#include <QLabel>
+#include <QDomDocument>
+#include <QDomElement>
+#include <QFile>
+#include <QDir>
+#include <QByteArray>
 
 class Q_DECL_HIDDEN KoConfigAuthorPage::Private
 {
@@ -49,6 +59,10 @@ public:
     QStackedWidget *stack;
     QComboBox *combo;
     QToolButton *deleteUser;
+    QStringList positions;
+    QStringList contactModes;
+    QStringList contactKeys;
+    QString defaultAuthor;
 };
 
 
@@ -57,65 +71,204 @@ KoConfigAuthorPage::KoConfigAuthorPage()
 {
     QGridLayout *layout = new QGridLayout;
 
-    d->combo = new QComboBox;
+    d->combo = new QComboBox();
     layout->addWidget(d->combo, 0, 0);
-    QToolButton *newUser = new QToolButton;
+    QToolButton *newUser = new QToolButton();
     newUser->setIcon(koIcon("list-add"));
     newUser->setToolTip(i18n("Add new author profile (starts out as a copy of current)"));
     layout->addWidget(newUser, 0, 1);
-    d->deleteUser = new QToolButton;
+    d->deleteUser = new QToolButton();
     d->deleteUser->setIcon(koIcon("trash-empty"));
     d->deleteUser->setToolTip(i18n("Delete the author profile"));
     layout->addWidget(d->deleteUser, 0, 2);
-    QFrame *f = new QFrame;
+    QFrame *f = new QFrame();
     f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
     layout->addWidget(f, 1, 0);
     d->stack = new QStackedWidget();
     layout->addWidget(d->stack, 2, 0, 1, 3);
     setLayout(layout);
 
-    // Add a default profile
+    //list of positions that we can use to provide useful autocompletion.
+    d->positions << i18n("Adapter") << i18n("Animator") << i18n("Artist")
+                 << i18n("Art Director") << i18n("Author") << i18n("Assistant Editor")
+                 << i18n("Background Artist") << i18n("Cartoonist") << i18n("Colorist")
+                 << i18n("Concept Artist") << i18n("Corrector") << i18n("Cover Artist")
+                 << i18n("Creator") << i18n("Designer") << i18n("Editor")
+                 << i18n("Inker") << i18n("Letterer") << i18n("Matte Painter")
+                 << i18n("Painter") << i18n("Penciller") << i18n("Proofreader")
+                 << i18n("Pixel Artist") << i18n("Redliner") << i18n("Sprite Artist")
+                 << i18n("Typographer") << i18n("Texture Artist") << i18n("Translator")
+                 << i18n("Writer") << i18n("Other");
+
+    //Keep these two in sync!
+    d->contactModes << i18n("Homepage") << i18n("Email") << i18n("Post Address") << i18n("Telephone") << i18n("Fax");
+    d->contactKeys << "homepage" << "email" << "address" << "telephone" << "fax";
+    QStringList headerlabels;
+    headerlabels<< i18n("Type") << i18n("Entry");
+
     Ui::KoConfigAuthorPage *aUi = new Ui::KoConfigAuthorPage();
     QWidget *w = new QWidget;
-    w->setEnabled(false);
-    aUi->setupUi(w);
-    d->combo->addItem(i18n("Default Author Profile"));
-    d->stack->addWidget(w);
-    KUser user(KUser::UseRealUserID);
-    aUi->leFullName->setText(user.property(KUser::FullName).toString());
-    aUi->lePhoneWork->setText(user.property(KUser::WorkPhone).toString());
-    aUi->lePhoneHome->setText(user.property(KUser::HomePhone).toString());
-    KEMailSettings eMailSettings;
-    aUi->leEmail->setText(eMailSettings.getSetting(KEMailSettings::EmailAddress));
-    d->profileUiList.append(aUi);
-
-    // Add all the user defined profiles
+    d->defaultAuthor = i18n("Default Author Profile");
+
+    QStringList profilesNew;
+    QString authorInfo = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/authorinfo/";
+    QDir dir(authorInfo);
+    QStringList filters = QStringList() << "*.authorinfo";
+    Q_FOREACH(const QString &entry, dir.entryList(filters)) {
+        QFile file(dir.absoluteFilePath(entry));
+        if (file.exists()) {
+            file.open(QFile::ReadOnly);
+            QByteArray ba = file.readAll();
+            file.close();
+            QDomDocument doc = QDomDocument();
+            doc.setContent(ba);
+            QDomElement root = doc.firstChildElement();
+            aUi = new Ui::KoConfigAuthorPage();
+            w = new QWidget;
+            aUi->setupUi(w);
+            QString profile = root.attribute("name");
+
+            QDomElement el = root.firstChildElement("nickname");
+            if (!el.isNull()) {
+                aUi->leNickName->setText(el.text());
+            }
+            el = root.firstChildElement("givenname");
+            if (!el.isNull()) {
+                aUi->leFirstName->setText(el.text());
+            }
+            el = root.firstChildElement("middlename");
+            if (!el.isNull()) {
+                aUi->leInitials->setText(el.text());
+            }
+            el = root.firstChildElement("familyname");
+            if (!el.isNull()) {
+                aUi->leLastName->setText(el.text());
+            }
+            el = root.firstChildElement("title");
+            if (!el.isNull()) {
+                aUi->leTitle->setText(el.text());
+            }
+            el = root.firstChildElement("position");
+            if (!el.isNull()) {
+                aUi->lePosition->setText(el.text());
+            }
+            el = root.firstChildElement("company");
+            if (!el.isNull()) {
+                aUi->leCompany->setText(el.text());
+            }
+
+            aUi->tblContactInfo->setItemDelegate(new KoContactInfoDelegate(this, d->contactModes));
+            QStandardItemModel *modes = new QStandardItemModel();
+            aUi->tblContactInfo->setModel(modes);
+            el = root.firstChildElement("contact");
+            while (!el.isNull()) {
+                QList<QStandardItem *> list;
+                QString type = d->contactModes.at(d->contactKeys.indexOf(el.attribute("type")));
+                list.append(new QStandardItem(type));
+                list.append(new QStandardItem(el.text()));
+                modes->appendRow(list);
+                el = el.nextSiblingElement("contact");
+            }
+            modes->setHorizontalHeaderLabels(headerlabels);
+
+            connect(aUi->btnAdd, SIGNAL(clicked()), this, SLOT(addContactEntry()));
+            connect(aUi->btnRemove, SIGNAL(clicked()), this, SLOT(removeContactEntry()));
+
+            d->combo->addItem(profile);
+            profilesNew.append(profile);
+            d->profileUiList.append(aUi);
+            d->stack->addWidget(w);
+        }
+    }
+
+    // Add all the user defined profiles (old type)
     KConfig *config = KoGlobal::calligraConfig();
     KConfigGroup authorGroup(config, "Author");
     QStringList profiles = authorGroup.readEntry("profile-names", QStringList());
 
-    foreach (const QString &profile , profiles) {
-        KConfigGroup cgs(&authorGroup, "Author-" + profile);
-        aUi = new Ui::KoConfigAuthorPage();
-        w = new QWidget;
+
+    // Add a default profile
+    aUi = new Ui::KoConfigAuthorPage();
+    w = new QWidget;
+    if (profiles.contains(d->defaultAuthor)==false || profilesNew.contains(d->defaultAuthor)) {
+        //w->setEnabled(false);
         aUi->setupUi(w);
-        aUi->leFullName->setText(cgs.readEntry("creator"));
-        aUi->leInitials->setText(cgs.readEntry("initial"));
-        aUi->leTitle->setText(cgs.readEntry("author-title"));
-        aUi->leCompany->setText(cgs.readEntry("company"));
-        aUi->leEmail->setText(cgs.readEntry("email"));
-        aUi->lePhoneWork->setText(cgs.readEntry("telephone-work"));
-        aUi->lePhoneHome->setText(cgs.readEntry("telephone"));
-        aUi->leFax->setText(cgs.readEntry("fax"));
-        aUi->leCountry->setText(cgs.readEntry("country"));
-        aUi->lePostal->setText(cgs.readEntry("postal-code"));
-        aUi->leCity->setText(cgs.readEntry("city"));
-        aUi->leStreet->setText(cgs.readEntry("street"));
-        aUi->lePosition->setText(cgs.readEntry("position"));
-
-        d->combo->addItem(profile);
-        d->profileUiList.append(aUi);
+        w->setEnabled(false);
+        d->combo->addItem(d->defaultAuthor);
         d->stack->addWidget(w);
+        //KUser user(KUser::UseRealUserID);
+        //aUi->leFullName->setText(user.property(KUser::FullName).toString());
+        //aUi->lePhoneWork->setText(user.property(KUser::WorkPhone).toString());
+        //aUi->lePhoneHome->setText(user.property(KUser::HomePhone).toString());
+        //KEMailSettings eMailSettings;
+        //aUi->leEmail->setText(eMailSettings.getSetting(KEMailSettings::EmailAddress));
+        d->profileUiList.append(aUi);
+    }
+
+    foreach (const QString &profile , profiles) {
+        if (profilesNew.contains(profile)==false) {
+            KConfigGroup cgs(&authorGroup, "Author-" + profile);
+            aUi = new Ui::KoConfigAuthorPage();
+            w = new QWidget;
+            aUi->setupUi(w);
+            aUi->leNickName->setText(cgs.readEntry("creator"));
+            aUi->leFirstName->setText(cgs.readEntry("creator-first-name"));
+            aUi->leLastName->setText(cgs.readEntry("creator-last-name"));
+            aUi->leInitials->setText(cgs.readEntry("initial"));
+            aUi->leTitle->setText(cgs.readEntry("author-title"));
+            aUi->lePosition->setText(cgs.readEntry("position"));
+            QCompleter *positionSuggestions = new QCompleter(d->positions);
+            positionSuggestions->setCaseSensitivity(Qt::CaseInsensitive);
+            aUi->lePosition->setCompleter(positionSuggestions);
+            aUi->leCompany->setText(cgs.readEntry("company"));
+
+            aUi->tblContactInfo->setItemDelegate(new KoContactInfoDelegate(this, d->contactModes));
+            QStandardItemModel *modes = new QStandardItemModel();
+            aUi->tblContactInfo->setModel(modes);
+            if (cgs.hasKey("email")) {
+                QList<QStandardItem *> list;
+                QString email = d->contactModes.at(d->contactKeys.indexOf("email"));
+                list.append(new QStandardItem(email));
+                list.append(new QStandardItem(cgs.readEntry("email")));
+                modes->appendRow(list);
+            }
+            if (cgs.hasKey("telephone-work")) {
+                QList<QStandardItem *> list;
+                QString tel = d->contactModes.at(d->contactKeys.indexOf("telephone"));
+                list.append(new QStandardItem(tel));
+                list.append(new QStandardItem(cgs.readEntry("telephone-work")));
+                modes->appendRow(list);
+            }
+            if (cgs.hasKey("fax")) {
+                QList<QStandardItem *> list;
+                QString fax = d->contactModes.at(d->contactKeys.indexOf("fax"));
+                list.append(new QStandardItem(fax));
+                list.append(new QStandardItem(cgs.readEntry("fax")));
+                modes->appendRow(list);
+            }
+            QStringList postal;
+            postal << cgs.readEntry("street") << cgs.readEntry("postal-code") << cgs.readEntry("city") << cgs.readEntry("country");
+            QString address;
+            Q_FOREACH(QString part, postal) {
+                if (!part.isEmpty()) {
+                    address+= part + "\n";
+                }
+            }
+            if (!address.isEmpty()) {
+                QList<QStandardItem *> list;
+                QString add = d->contactModes.at(d->contactKeys.indexOf("address"));
+                list.append(new QStandardItem(add));
+                list.append(new QStandardItem(address));
+                modes->appendRow(list);
+            }
+            modes->setHorizontalHeaderLabels(headerlabels);
+            connect(aUi->btnAdd, SIGNAL(clicked()), this, SLOT(addContactEntry()));
+            connect(aUi->btnRemove, SIGNAL(clicked()), this, SLOT(removeContactEntry()));
+
+            d->combo->addItem(profile);
+            d->profileUiList.append(aUi);
+            d->stack->addWidget(w);
+        }
     }
 
     // Connect slots
@@ -150,19 +303,22 @@ void KoConfigAuthorPage::addUser()
     QWidget *w = new QWidget;
     aUi->setupUi(w);
 
-    aUi->leFullName->setText(curUi->leFullName->text());
+    aUi->leNickName->setText(curUi->leNickName->text());
     aUi->leInitials->setText(curUi->leInitials->text());
     aUi->leTitle->setText(curUi->leTitle->text());
     aUi->leCompany->setText(curUi->leCompany->text());
-    aUi->leEmail->setText(curUi->leEmail->text());
-    aUi->lePhoneWork->setText(curUi->lePhoneWork->text());
-    aUi->lePhoneHome->setText(curUi->lePhoneHome->text());
-    aUi->leFax->setText(curUi->leFax->text());
-    aUi->leCountry->setText(curUi->leCountry->text());
-    aUi->lePostal->setText(curUi->lePostal->text());
-    aUi->leCity->setText(curUi->leCity->text());
-    aUi->leStreet->setText(curUi->leStreet->text());
+    aUi->leFirstName->setText(curUi->leFirstName->text());
+    aUi->leLastName->setText(curUi->leLastName->text());
     aUi->lePosition->setText(curUi->lePosition->text());
+    QCompleter *positionSuggestions = new QCompleter(d->positions);
+    positionSuggestions->setCaseSensitivity(Qt::CaseInsensitive);
+    aUi->lePosition->setCompleter(positionSuggestions);
+    aUi->tblContactInfo->setItemDelegate(new KoContactInfoDelegate(this, d->contactModes));
+    QStandardItemModel *modes = new QStandardItemModel();
+    aUi->tblContactInfo->setModel(modes);
+
+    connect(aUi->btnAdd, SIGNAL(clicked()), this, SLOT(addContactEntry()));
+    connect(aUi->btnRemove, SIGNAL(clicked()), this, SLOT(removeContactEntry()));
 
     int index = d->combo->currentIndex() + 1;
     d->combo->insertItem(index, profileName);
@@ -182,32 +338,106 @@ void KoConfigAuthorPage::deleteUser()
     delete w;
 }
 
+void KoConfigAuthorPage::addContactEntry()
+{
+    int i = d->combo->currentIndex();
+    Ui::KoConfigAuthorPage *aUi = d->profileUiList[i];
+    QStandardItemModel *contact = static_cast<QStandardItemModel*>(aUi->tblContactInfo->model());
+    QList<QStandardItem*>list;
+    list.append(new QStandardItem(d->contactModes.at(0)));
+    list.append(new QStandardItem(i18n("New Contact Info")));
+    contact->appendRow(list);
+    aUi->tblContactInfo->setModel(contact);
+}
+
+void KoConfigAuthorPage::removeContactEntry()
+{
+    int i = d->combo->currentIndex();
+    Ui::KoConfigAuthorPage *aUi = d->profileUiList[i];
+    QModelIndex index = aUi->tblContactInfo->selectionModel()->currentIndex();
+    aUi->tblContactInfo->model()->removeRow(index.row());
+}
+
 void KoConfigAuthorPage::apply()
 {
-    KConfig *config = KoGlobal::calligraConfig();
-    KConfigGroup authorGroup(config, "Author");
-    QStringList profiles;
-
-    for (int i = 1; i < d->profileUiList.size(); i++) {
-        KConfigGroup cgs(&authorGroup, "Author-" + d->combo->itemText(i));
-        profiles.append(d->combo->itemText(i));
-        Ui::KoConfigAuthorPage *aUi = d->profileUiList[i];
-        cgs.writeEntry("creator", aUi->leFullName->text());
-        cgs.writeEntry("initial", aUi->leInitials->text());
-        cgs.writeEntry("author-title", aUi->leTitle->text());
-        cgs.writeEntry("company", aUi->leCompany->text());
-        cgs.writeEntry("email", aUi->leEmail->text());
-        cgs.writeEntry("telephone-work", aUi->lePhoneWork->text());
-        cgs.writeEntry("telephone", aUi->lePhoneHome->text());
-        cgs.writeEntry("fax", aUi->leFax->text());
-        cgs.writeEntry("country", aUi->leCountry->text());
-        cgs.writeEntry("postal-code", aUi->lePostal->text());
-        cgs.writeEntry("city", aUi->leCity->text());
-        cgs.writeEntry("street", aUi->leStreet->text());
-        cgs.writeEntry("position", aUi->lePosition->text());
-
-        cgs.sync();
+    QString authorInfo = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/authorinfo/";
+    QDir dir(authorInfo);
+    if (!dir.mkpath(authorInfo)) {
+        qWarning()<<"We can't make an author info directory, and therefore not save!";
+        return;
+    }
+    for (int i = 0; i < d->profileUiList.size(); i++) {
+        if (d->combo->itemText(i)!= d->defaultAuthor) {
+            QByteArray ba;
+            QDomDocument doc = QDomDocument();
+            Ui::KoConfigAuthorPage *aUi = d->profileUiList[i];
+
+            QDomElement root = doc.createElement("author");
+            root.setAttribute("name", d->combo->itemText(i));
+
+            QDomElement nickname = doc.createElement("nickname");
+            nickname.appendChild(doc.createTextNode(aUi->leNickName->text()));
+            root.appendChild(nickname);
+            QDomElement givenname = doc.createElement("givenname");
+            givenname.appendChild(doc.createTextNode(aUi->leFirstName->text()));
+            root.appendChild(givenname);
+            QDomElement familyname = doc.createElement("familyname");
+            familyname.appendChild(doc.createTextNode(aUi->leLastName->text()));
+            root.appendChild(familyname);
+            QDomElement middlename = doc.createElement("middlename");
+            middlename.appendChild(doc.createTextNode(aUi->leInitials->text()));
+            root.appendChild(middlename);
+            QDomElement title = doc.createElement("title");
+            title.appendChild(doc.createTextNode(aUi->leTitle->text()));
+            root.appendChild(title);
+            QDomElement company = doc.createElement("company");
+            company.appendChild(doc.createTextNode(aUi->leCompany->text()));
+            root.appendChild(company);
+            QDomElement position = doc.createElement("position");
+            position.appendChild(doc.createTextNode(aUi->lePosition->text()));
+            root.appendChild(position);
+            if (aUi->tblContactInfo) {
+                if (aUi->tblContactInfo->model()) {
+                    for (int i=0; i<aUi->tblContactInfo->model()->rowCount(); i++) {
+                        QModelIndex index = aUi->tblContactInfo->model()->index(i, 1);
+                        QModelIndex typeIndex = aUi->tblContactInfo->model()->index(i, 0);
+                        QDomElement contactEl = doc.createElement("contact");
+                        QString content = QVariant(aUi->tblContactInfo->model()->data(index)).toString();
+                        contactEl.appendChild(doc.createTextNode(content));
+                        QString type = QVariant(aUi->tblContactInfo->model()->data(typeIndex)).toString();
+                        contactEl.setAttribute("type", d->contactKeys.at(d->contactModes.indexOf(type)));
+                        root.appendChild(contactEl);
+                    }
+                }
+            }
+            doc.appendChild(root);
+            ba = doc.toByteArray();
+
+            QFile f(authorInfo + d->combo->itemText(i) +".authorinfo");
+            f.open(QFile::WriteOnly);
+            f.write(ba);
+            f.close();
+        }
+    }
+}
+
+KoContactInfoDelegate::KoContactInfoDelegate(QWidget *parent, QStringList contactModes): QStyledItemDelegate(parent), m_contactModes(contactModes)
+{
+}
+
+KoContactInfoDelegate::~KoContactInfoDelegate()
+{
+
+}
+
+QWidget* KoContactInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+
+    if (index.column() > 0) {
+        return new QLineEdit(parent);
+    } else {
+        QComboBox *box = new QComboBox(parent);
+        box->addItems(m_contactModes);
+        return box;
     }
-    authorGroup.writeEntry("profile-names", profiles);
-    authorGroup.sync();
 }
diff --git a/libs/widgets/KoConfigAuthorPage.h b/libs/widgets/KoConfigAuthorPage.h
index 154e5eb2a44..0df1ceb3f47 100644
--- a/libs/widgets/KoConfigAuthorPage.h
+++ b/libs/widgets/KoConfigAuthorPage.h
@@ -23,6 +23,7 @@
 #define KOCONFIGAUTHORPAGE_H
 
 #include <QWidget>
+#include <QStyledItemDelegate>
 
 #include "kritawidgets_export.h"
 
@@ -40,10 +41,29 @@ private Q_SLOTS:
     void profileChanged(int i);
     void addUser();
     void deleteUser();
+    void addContactEntry();
+    void removeContactEntry();
 
 private:
     class Private;
     Private * const d;
 };
 
+/**
+ * @brief The KoContactInfoDelegate class
+ *
+ * quick delegate subclass to allow a qcombobox for the type.
+ */
+class KoContactInfoDelegate : public QStyledItemDelegate
+{
+public:
+    KoContactInfoDelegate(QWidget *parent, QStringList contactModes);
+    ~KoContactInfoDelegate() override;
+
+public:
+    QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
+    QStringList m_contactModes;
+};
+
+
 #endif // KOCONFIGAUTHORPAGE_H
diff --git a/libs/widgets/KoConfigAuthorPage.ui b/libs/widgets/KoConfigAuthorPage.ui
index 26878bc8e8c..f693c93df64 100644
--- a/libs/widgets/KoConfigAuthorPage.ui
+++ b/libs/widgets/KoConfigAuthorPage.ui
@@ -11,103 +11,84 @@
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
+   <item row="2" column="0">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
    <item row="0" column="0">
     <layout class="QGridLayout" name="gridLayout">
      <property name="spacing">
       <number>12</number>
      </property>
-     <item row="5" column="2">
-      <widget class="QLabel" name="lblPhoneWork">
-       <property name="text">
-        <string>Wor&k Number:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>lePhoneWork</cstring>
+     <item row="2" column="3">
+      <widget class="QLineEdit" name="leInitials">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>1</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
       </widget>
      </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="lblTitleDesc">
+     <item row="3" column="1">
+      <widget class="QLineEdit" name="leCompany"/>
+     </item>
+     <item row="2" column="2">
+      <widget class="QLabel" name="lblInitialsDesc">
        <property name="text">
-        <string>Title:</string>
+        <string>Initials:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
        <property name="buddy">
-        <cstring>leTitle</cstring>
+        <cstring>leInitials</cstring>
        </property>
       </widget>
      </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="leTitle"/>
-     </item>
-     <item row="5" column="1">
-      <widget class="QLineEdit" name="lePhoneHome"/>
-     </item>
-     <item row="1" column="3">
-      <widget class="QLineEdit" name="lePosition"/>
-     </item>
-     <item row="4" column="0">
-      <widget class="QLabel" name="lblPostalDesc">
+     <item row="3" column="2">
+      <widget class="QLabel" name="lblPositionDesc">
        <property name="text">
-        <string>Postal code:</string>
+        <string>Position:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
        <property name="buddy">
-        <cstring>lePostal</cstring>
+        <cstring>lePosition</cstring>
        </property>
       </widget>
      </item>
-     <item row="4" column="3">
-      <widget class="QLineEdit" name="leCountry"/>
-     </item>
-     <item row="2" column="3">
-      <widget class="QLineEdit" name="leEmail"/>
+     <item row="1" column="3">
+      <widget class="QLineEdit" name="leLastName"/>
      </item>
-     <item row="4" column="2">
-      <widget class="QLabel" name="lblCountryDesc">
-       <property name="text">
-        <string>Country:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>leCountry</cstring>
-       </property>
-      </widget>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="leFirstName"/>
      </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="fullNameLabel">
+     <item row="1" column="0">
+      <widget class="QLabel" name="lblFirst">
        <property name="text">
-        <string>Name:</string>
+        <string>Given Name:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
       </widget>
      </item>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="leFullName">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>1</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="QLineEdit" name="lePostal"/>
+     <item row="3" column="3">
+      <widget class="QLineEdit" name="lePosition"/>
      </item>
-     <item row="0" column="3">
-      <widget class="QLineEdit" name="leInitials">
+     <item row="0" column="1" colspan="3">
+      <widget class="QLineEdit" name="leNickName">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>1</horstretch>
@@ -117,155 +98,112 @@
       </widget>
      </item>
      <item row="2" column="0">
-      <widget class="QLabel" name="lblCompanyDesc">
+      <widget class="QLabel" name="lblTitleDesc">
        <property name="text">
-        <string>Co&mpany:</string>
+        <string>Title:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
        <property name="buddy">
-        <cstring>leCompany</cstring>
+        <cstring>leTitle</cstring>
        </property>
       </widget>
      </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="lblStreetDesc">
-       <property name="text">
-        <string>Street:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>leStreet</cstring>
-       </property>
-      </widget>
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="leTitle"/>
      </item>
-     <item row="5" column="0">
-      <widget class="QLabel" name="lblPhoneHome">
+     <item row="0" column="0">
+      <widget class="QLabel" name="fullNameLabel">
        <property name="text">
-        <string>Home Number:</string>
+        <string>Nickname:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
-       <property name="buddy">
-        <cstring>lePhoneHome</cstring>
-       </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="QLineEdit" name="leCompany"/>
-     </item>
-     <item row="0" column="2">
-      <widget class="QLabel" name="lblInitialsDesc">
+     <item row="3" column="0">
+      <widget class="QLabel" name="lblCompanyDesc">
        <property name="text">
-        <string>Initials:</string>
+        <string>Co&mpany:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
        <property name="buddy">
-        <cstring>leInitials</cstring>
+        <cstring>leCompany</cstring>
        </property>
       </widget>
      </item>
-     <item row="5" column="3">
-      <widget class="QLineEdit" name="lePhoneWork"/>
-     </item>
      <item row="1" column="2">
-      <widget class="QLabel" name="lblPositionDesc">
+      <widget class="QLabel" name="LabelFamily">
        <property name="text">
-        <string>Position:</string>
+        <string>Family Name:</string>
        </property>
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
-       <property name="buddy">
-        <cstring>lePosition</cstring>
-       </property>
       </widget>
      </item>
-     <item row="3" column="3">
-      <widget class="QLineEdit" name="leCity"/>
-     </item>
-     <item row="2" column="2">
-      <widget class="QLabel" name="lblEmailDesc">
+     <item row="5" column="1">
+      <widget class="QPushButton" name="btnAdd">
        <property name="text">
-        <string>E&mail:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>leEmail</cstring>
+        <string>Add contact info</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="2">
-      <widget class="QLabel" name="lblCityDesc">
+     <item row="5" column="2">
+      <widget class="QPushButton" name="btnRemove">
        <property name="text">
-        <string>Cit&y:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>leCity</cstring>
+        <string>Remove contact info</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="1">
-      <widget class="QLineEdit" name="leStreet"/>
-     </item>
-     <item row="6" column="0">
-      <widget class="QLabel" name="lblFaxDesc">
+     <item row="4" column="0">
+      <widget class="QLabel" name="label">
        <property name="text">
-        <string>Fa&x Number:</string>
+        <string>Contact:</string>
        </property>
        <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>leFax</cstring>
+        <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
        </property>
       </widget>
      </item>
-     <item row="6" column="1">
-      <widget class="QLineEdit" name="leFax"/>
+     <item row="4" column="1" colspan="3">
+      <widget class="QTableView" name="tblContactInfo">
+       <property name="dragDropOverwriteMode">
+        <bool>false</bool>
+       </property>
+       <property name="cornerButtonEnabled">
+        <bool>false</bool>
+       </property>
+       <attribute name="horizontalHeaderStretchLastSection">
+        <bool>true</bool>
+       </attribute>
+       <attribute name="verticalHeaderVisible">
+        <bool>false</bool>
+       </attribute>
+       <attribute name="verticalHeaderStretchLastSection">
+        <bool>false</bool>
+       </attribute>
+      </widget>
      </item>
     </layout>
    </item>
-   <item row="1" column="0">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <tabstops>
-  <tabstop>leFullName</tabstop>
-  <tabstop>leInitials</tabstop>
+  <tabstop>leNickName</tabstop>
+  <tabstop>leFirstName</tabstop>
+  <tabstop>leLastName</tabstop>
   <tabstop>leTitle</tabstop>
-  <tabstop>lePosition</tabstop>
+  <tabstop>leInitials</tabstop>
   <tabstop>leCompany</tabstop>
-  <tabstop>leEmail</tabstop>
-  <tabstop>leStreet</tabstop>
-  <tabstop>leCity</tabstop>
-  <tabstop>lePostal</tabstop>
-  <tabstop>leCountry</tabstop>
-  <tabstop>lePhoneHome</tabstop>
-  <tabstop>lePhoneWork</tabstop>
-  <tabstop>leFax</tabstop>
+  <tabstop>lePosition</tabstop>
+  <tabstop>tblContactInfo</tabstop>
+  <tabstop>btnAdd</tabstop>
+  <tabstop>btnRemove</tabstop>
  </tabstops>
  <resources/>
  <connections/>
diff --git a/libs/widgets/KoDocumentInfoDlg.cpp b/libs/widgets/KoDocumentInfoDlg.cpp
index e95f71c7567..424a902afdc 100644
--- a/libs/widgets/KoDocumentInfoDlg.cpp
+++ b/libs/widgets/KoDocumentInfoDlg.cpp
@@ -207,19 +207,19 @@ void KoDocumentInfoDlg::initAboutTab()
 
 void KoDocumentInfoDlg::initAuthorTab()
 {
-    d->authorUi->fullName->setText(d->info->authorInfo("creator"));
+    d->authorUi->nickName->setText(d->info->authorInfo("creator"));
+    d->authorUi->firstName->setText(d->info->authorInfo("creator-first-name"));
+    d->authorUi->lastName->setText(d->info->authorInfo("creator-last-name"));
     d->authorUi->initials->setText(d->info->authorInfo("initial"));
     d->authorUi->title->setText(d->info->authorInfo("author-title"));
     d->authorUi->company->setText(d->info->authorInfo("company"));
-    d->authorUi->email->setText(d->info->authorInfo("email"));
-    d->authorUi->phoneWork->setText(d->info->authorInfo("telephone-work"));
-    d->authorUi->phoneHome->setText(d->info->authorInfo("telephone"));
-    d->authorUi->fax->setText(d->info->authorInfo("fax"));
-    d->authorUi->country->setText(d->info->authorInfo("country"));
-    d->authorUi->postal->setText(d->info->authorInfo("postal-code"));
-    d->authorUi->city->setText(d->info->authorInfo("city"));
-    d->authorUi->street->setText(d->info->authorInfo("street"));
     d->authorUi->position->setText(d->info->authorInfo("position"));
+    QListWidget *contact = d->authorUi->leContact;
+    Q_FOREACH(QString contactMode, d->info->authorContactInfo()) {
+        if (!contactMode.isEmpty()) {
+            contact->addItem(contactMode);
+        }
+    }
 }
 
 void KoDocumentInfoDlg::saveAboutData()
diff --git a/libs/widgets/koDocumentInfoAuthorWidget.ui b/libs/widgets/koDocumentInfoAuthorWidget.ui
index 6ce30603c10..2e677ba471d 100644
--- a/libs/widgets/koDocumentInfoAuthorWidget.ui
+++ b/libs/widgets/koDocumentInfoAuthorWidget.ui
@@ -7,31 +7,21 @@
     <x>0</x>
     <y>0</y>
     <width>450</width>
-    <height>307</height>
+    <height>382</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <property name="verticalSpacing">
     <number>8</number>
    </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="fullNameLabel">
-     <property name="text">
-      <string>Name:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
    <item row="0" column="2">
-    <widget class="QLabel" name="fullName">
+    <widget class="QLabel" name="nickName">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="1" column="0">
+   <item row="3" column="0">
     <widget class="QLabel" name="lblInitialsDesc">
      <property name="text">
       <string>Initials:</string>
@@ -41,7 +31,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="2">
+   <item row="3" column="2">
     <widget class="QLabel" name="initials">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -54,7 +44,7 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="0">
+   <item row="4" column="0">
     <widget class="QLabel" name="lblTitleDesc">
      <property name="text">
       <string>Title:</string>
@@ -64,14 +54,14 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="2">
+   <item row="4" column="2">
     <widget class="QLabel" name="title">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="3" column="0">
+   <item row="5" column="0">
     <widget class="QLabel" name="lblPositionDesc">
      <property name="text">
       <string>Position:</string>
@@ -81,14 +71,14 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="2">
+   <item row="5" column="2">
     <widget class="QLabel" name="position">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="4" column="0">
+   <item row="6" column="0">
     <widget class="QLabel" name="lblCompanyDesc">
      <property name="text">
       <string>Company:</string>
@@ -98,87 +88,7 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="0">
-    <widget class="QLabel" name="lblEmailDesc">
-     <property name="text">
-      <string>Email:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="0">
-    <widget class="QLabel" name="lblPhoneHome">
-     <property name="text">
-      <string>Telephone (home):</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="7" column="0">
-    <widget class="QLabel" name="lblPhoneWork">
-     <property name="text">
-      <string>Telephone (work):</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="0">
-    <widget class="QLabel" name="lblFaxDesc">
-     <property name="text">
-      <string>Fax:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="9" column="0">
-    <widget class="QLabel" name="lblStreetDesc">
-     <property name="text">
-      <string>Street:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="10" column="0">
-    <widget class="QLabel" name="lblPostalDesc">
-     <property name="text">
-      <string>Postal code:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="11" column="0">
-    <widget class="QLabel" name="lblCityDesc">
-     <property name="text">
-      <string>City:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="12" column="0">
-    <widget class="QLabel" name="lblCountryDesc">
-     <property name="text">
-      <string>Country:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="13" column="2">
+   <item row="8" column="2">
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -191,64 +101,49 @@
      </property>
     </spacer>
    </item>
-   <item row="4" column="2">
+   <item row="6" column="2">
     <widget class="QLabel" name="company">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="5" column="2">
-    <widget class="QLabel" name="email">
+   <item row="0" column="0">
+    <widget class="QLabel" name="fullNameLabel">
      <property name="text">
-      <string/>
+      <string>Nickname:</string>
      </property>
-    </widget>
-   </item>
-   <item row="6" column="2">
-    <widget class="QLabel" name="phoneHome">
-     <property name="text">
-      <string/>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
      </property>
     </widget>
    </item>
    <item row="7" column="2">
-    <widget class="QLabel" name="phoneWork">
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="2">
-    <widget class="QLabel" name="fax">
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
+    <widget class="QListWidget" name="leContact"/>
    </item>
-   <item row="9" column="2">
-    <widget class="QLabel" name="street">
+   <item row="2" column="0">
+    <widget class="QLabel" name="lblLastName">
      <property name="text">
-      <string/>
+      <string>Last Name:</string>
      </property>
     </widget>
    </item>
-   <item row="10" column="2">
-    <widget class="QLabel" name="postal">
+   <item row="1" column="0">
+    <widget class="QLabel" name="lblfirstname">
      <property name="text">
-      <string/>
+      <string>First Name:</string>
      </property>
     </widget>
    </item>
-   <item row="11" column="2">
-    <widget class="QLabel" name="city">
+   <item row="1" column="2">
+    <widget class="QLabel" name="firstName">
      <property name="text">
       <string/>
      </property>
     </widget>
    </item>
-   <item row="12" column="2">
-    <widget class="QLabel" name="country">
+   <item row="2" column="2">
+    <widget class="QLabel" name="lastName">
      <property name="text">
       <string/>
      </property>


More information about the kimageshop mailing list