~ubuntu-branches/ubuntu/vivid/kdepim/vivid

« back to all changes in this revision

Viewing changes to messagecore/annotationdialog.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Jonathan Riddell, Rohan Garg, Scott Kitterman
  • Date: 2012-11-21 13:12:36 UTC
  • mfrom: (0.2.33)
  • Revision ID: package-import@ubuntu.com-20121121131236-32ijw9a2txrar80k
Tags: 4:4.9.80-0ubuntu1
[ Jonathan Riddell ]
* New upstream beta release

[ Rohan Garg ]
* Add nepomuk-core-dev to build-deps

[ Scott Kitterman ]
* Add new package, libpimcommon4
  - Add libpimcommon4.install
  - Add to debian/control, including kdepim-dbg and kdepim-dev depends
  - Add to kdepim-dev.install
* Remove usr/bin/backupmail and related files from kmail.install as they are
  not provided by upstream anymore
* Add usr/bin/pimsettingexporter and related files to kmail.install
* Add libnepomukwidgets-dev to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "annotationdialog.h"
21
21
 
22
 
#include <Nepomuk/Resource>
 
22
#include <Nepomuk2/Resource>
 
23
#include <Soprano/Vocabulary/NAO>
23
24
 
24
25
#include <KMessageBox>
25
26
#include <KLocale>
46
47
AnnotationEditDialog::AnnotationEditDialog( const QUrl &uri, QWidget *parent )
47
48
  : KDialog( parent ), d( new Private( uri ) )
48
49
{
49
 
  Nepomuk::Resource resource( d->mNepomukResourceUri );
 
50
  Nepomuk2::Resource resource( d->mNepomukResourceUri );
50
51
 
51
 
  d->mHasAnnotation = resource.hasProperty( QUrl( Nepomuk::Resource::descriptionUri() ) );
 
52
  d->mHasAnnotation = resource.hasProperty( QUrl( Soprano::Vocabulary::NAO::description().toString() ) );
52
53
  if ( d->mHasAnnotation ) {
53
54
    setCaption( i18n( "Edit Note" ) );
54
55
    setButtons( Ok | Cancel | User1 );
83
84
  if ( button == KDialog::Ok ) {
84
85
    bool textIsEmpty = d->mTextEdit->toPlainText().isEmpty();
85
86
    if ( !textIsEmpty ) {
86
 
      Nepomuk::Resource resource( d->mNepomukResourceUri );
 
87
      Nepomuk2::Resource resource( d->mNepomukResourceUri );
87
88
      resource.setDescription( d->mTextEdit->toPlainText() );
88
89
    } else if ( d->mHasAnnotation && textIsEmpty ) {
89
 
      Nepomuk::Resource resource( d->mNepomukResourceUri );
90
 
      resource.removeProperty( QUrl( Nepomuk::Resource::descriptionUri() ) );
 
90
      Nepomuk2::Resource resource( d->mNepomukResourceUri );
 
91
 
 
92
      resource.removeProperty( QUrl( Soprano::Vocabulary::NAO::description().toString() ) );
91
93
    }
92
94
 
93
95
    accept();
98
100
                              i18n( "Do you really want to delete this note?" ),
99
101
                              i18n( "Delete Note?" ), KGuiItem( i18n( "Delete" ), "edit-delete" ) );
100
102
    if ( answer == KMessageBox::Continue ) {
101
 
      Nepomuk::Resource resource( d->mNepomukResourceUri );
102
 
      resource.removeProperty( QUrl( Nepomuk::Resource::descriptionUri() ) );
 
103
      Nepomuk2::Resource resource( d->mNepomukResourceUri );
 
104
      resource.removeProperty( QUrl( Soprano::Vocabulary::NAO::description().toString() ) );
103
105
      accept();
104
106
    }
105
107
  }