~ubuntu-branches/ubuntu/quantal/kdevplatform/quantal-proposed

« back to all changes in this revision

Viewing changes to plugins/snippet/editsnippet.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra, Fathi Boudra, Sune Vuorela
  • Date: 2010-07-22 20:36:46 UTC
  • mfrom: (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100722203646-ujxro0qx5bivjj58
Tags: 1.0.1-1
* New upstream release.

[ Fathi Boudra ]
* Add localization packages: Finnish (fi), Dutch (nl), Slovenian (sl) and
  Thai (th).
* Update debian/control:
  - bump Standards-Version to 3.9.0 (no changes needed).
  - comment turkish localization package, not shipped in this release.
* Update debian/rules: remove workaround for FindKDE4Internal.cmake default
  rpath value, fixed in kdelibs5-dev 4.4.1.

[ Sune Vuorela ]
* Remove hardcoded dependency in libsublime1 on kdelibs5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
void EditSnippet::validate()
63
63
{
64
 
    bool valid = !snippetNameEdit->text().isEmpty() && !snippetContentsEdit->document()->isEmpty();
 
64
    const QString& name = snippetNameEdit->text();
 
65
    bool valid = !name.isEmpty() && !snippetContentsEdit->document()->isEmpty();
 
66
    if (valid) {
 
67
        // make sure the snippetname includes no spaces
 
68
        for ( int i = 0; i < name.length(); ++i ) {
 
69
            if ( name.at(i).isSpace() ) {
 
70
                valid = false;
 
71
                break;
 
72
            }
 
73
        }
 
74
    }
65
75
    button(Ok)->setEnabled(valid);
66
76
    button(Apply)->setEnabled(valid);
67
77
}