Commit 8117079c authored by Volker Krause's avatar Volker Krause

SVN_MERGE

Merged revisions 1018081-1018082,1018425,1018515,1018557,1018577,1018635,1018771 via svnmerge from 
https://vkrause@svn.kde.org/home/kde/trunk/KDE/kdepimlibs

........
  r1018081 | vkrause | 2009-09-01 09:18:26 +0200 (Tue, 01 Sep 2009) | 4 lines
  
  Don't overwrite the formatted name if it wasn't changed at all here,
  we miss the last typed letter otherwise, when switching to custom
  display name here.
........
  r1018082 | vkrause | 2009-09-01 09:19:22 +0200 (Tue, 01 Sep 2009) | 2 lines
  
  minor unit test for the setNameFromString() method
........
  r1018425 | tokoe | 2009-09-01 19:28:10 +0200 (Tue, 01 Sep 2009) | 3 lines
  
  Fix the PasteHelper to handle the QMimeData from EntityTreeModel
  correctly.
........
  r1018515 | tokoe | 2009-09-01 21:21:02 +0200 (Tue, 01 Sep 2009) | 2 lines
  
  Do some refactoring and implement second ctor of ContactEditor
........
  r1018557 | cgiboudeaux | 2009-09-01 22:58:16 +0200 (Tue, 01 Sep 2009) | 4 lines
  
  Create an entry for akonadi-contact. This way, you can link to KDEPIMLIBS_AKONADI_CONTACT_LIBS in kdepim.
  CCMAIL: tokoe@kde.org
........
  r1018577 | winterz | 2009-09-01 23:41:24 +0200 (Tue, 01 Sep 2009) | 8 lines
  
  for displayView:
  + also show non-uri attachments
  + move the Calendar field prints to displayViewFormat(Event|Todo|Journal)
    instead of doing that in displayViewFormatHeader, because that screws-up
    the table row prints
  MERGE: e35,e4
  DO_NOT_BACKPORT:
........
  r1018635 | winterz | 2009-09-02 02:18:46 +0200 (Wed, 02 Sep 2009) | 3 lines
  
  remove TODO comments that are done.
  SVN_SILENT:
........
  r1018771 | tokoe | 2009-09-02 09:03:37 +0200 (Wed, 02 Sep 2009) | 2 lines
  
  warning--
........

svn path=/branches/work/akonadi-ports/kdepimlibs/; revision=1018773
parent 182a40ee
......@@ -113,6 +113,11 @@ QVariant ContactCompletionModel::getData( const Item &item, int column, int role
return EntityTreeModel::getData( item, column, role );
}
QVariant ContactCompletionModel::getData( const Collection &collection, int column, int role ) const
{
return EntityTreeModel::getData( collection, column, role );
}
int ContactCompletionModel::columnCount( const QModelIndex &parent ) const
{
if ( !parent.isValid() )
......
......@@ -41,6 +41,7 @@ class ContactCompletionModel : public EntityTreeModel
virtual ~ContactCompletionModel();
virtual QVariant getData( const Item &item, int column, int role = Qt::DisplayRole ) const;
virtual QVariant getData( const Collection &collection, int column, int role = Qt::DisplayRole ) const;
virtual int columnCount( const QModelIndex &parent ) const;
virtual int getColumnCount( int ) const;
......
......@@ -26,6 +26,7 @@
#include "autoqpointer_p.h"
#include "contactmetadata_p.h"
#include "contactmetadataattribute_p.h"
#include "editor/contacteditorwidget.h"
#include <akonadi/collectionfetchjob.h>
#include <akonadi/itemcreatejob.h>
......@@ -45,9 +46,18 @@ using namespace Akonadi;
class ContactEditor::Private
{
public:
Private( ContactEditor *parent )
: mParent( parent ), mMonitor( 0 ), mReadOnly( false )
Private( ContactEditor::Mode mode, AbstractContactEditorWidget *editorWidget, ContactEditor *parent )
: mParent( parent ), mMode( mode ), mMonitor( 0 ), mReadOnly( false )
{
if ( editorWidget )
mEditorWidget = editorWidget;
else
mEditorWidget = new ContactEditorWidget();
QVBoxLayout *layout = new QVBoxLayout( mParent );
layout->setMargin( 0 );
layout->setSpacing( 0 );
layout->addWidget( mEditorWidget );
}
~Private()
......@@ -177,16 +187,14 @@ void ContactEditor::Private::setupMonitor()
}
ContactEditor::ContactEditor( Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent )
: QWidget( parent ), d( new Private( this ) )
ContactEditor::ContactEditor( Mode mode, QWidget *parent )
: QWidget( parent ), d( new Private( mode, 0, this ) )
{
d->mMode = mode;
d->mEditorWidget = editorWidget;
}
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setMargin( 0 );
layout->setSpacing( 0 );
layout->addWidget( d->mEditorWidget );
ContactEditor::ContactEditor( Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent )
: QWidget( parent ), d( new Private( mode, editorWidget, this ) )
{
}
ContactEditor::~ContactEditor()
......
......@@ -67,7 +67,7 @@ class AKONADI_CONTACT_EXPORT ContactEditor : public QWidget
* @param editorWidget The contact editor widget that shall be used for editing.
* @param parent The parent widget of the editor.
*/
explicit ContactEditor( Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent = 0 );
ContactEditor( Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent = 0 );
/**
* Destroys the contact editor.
......
......@@ -22,7 +22,6 @@
#include "addressbookcombobox_p.h"
#include "contacteditor.h"
#include "editor/contacteditorwidget.h"
#include <akonadi/item.h>
......@@ -50,8 +49,10 @@ class ContactEditorDialog::Private
QGridLayout *layout = new QGridLayout( mainWidget );
mEditor = new ContactEditor( mode == ContactEditorDialog::CreateMode ? ContactEditor::CreateMode : ContactEditor::EditMode,
editorWidget ? editorWidget : new ContactEditorWidget(), q );
if ( editorWidget )
mEditor = new ContactEditor( mode == ContactEditorDialog::CreateMode ? ContactEditor::CreateMode : ContactEditor::EditMode, editorWidget, q );
else
mEditor = new ContactEditor( mode == ContactEditorDialog::CreateMode ? ContactEditor::CreateMode : ContactEditor::EditMode, q );
if ( mode == ContactEditorDialog::CreateMode ) {
QLabel *label = new QLabel( i18n( "Add to:" ), mainWidget );
......
......@@ -101,7 +101,8 @@ void DisplayNameEditWidget::changeName( const KABC::Addressee &contact )
const QString organization = mContact.organization();
mContact = contact;
mContact.setOrganization( organization );
mContact.setFormattedName( mView->text() );
if ( mDisplayType == CustomName )
mContact.setFormattedName( mView->text() );
updateView();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment