[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/nepomuk-kde/simple-file-tagger
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2007-04-04 14:43:13
Message-ID: 1175697793.794289.2316.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 650428 by trueg:
sync all.
M +12 -7 mainwindow.cpp
--- trunk/playground/base/nepomuk-kde/simple-file-tagger/mainwindow.cpp #650427:650428
@@ -122,9 +122,10 @@
// check the tags the resource is tagged with
QList<Tag> l = File( m_resource.url() ).getTags();
qDebug() << "Loading " << l.count() << " tags for resource " << m_resource.url() << endl;
- QListIterator<Tag> tagIt( l );
- while( tagIt.hasNext() ) {
- const Resource& tag = tagIt.next();
+ for( QList<Tag>::iterator it = l.begin(); it != l.end(); ++it ) {
+ Tag& tag = *it;
+ if( tag.getLabels().isEmpty() )
+ tag.addLabel( KRandom::randomString( 10 ) );
if( m_tagCheckBoxes.contains(tag.getLabels().first()) )
m_tagCheckBoxes[tag.getLabels().first()]->setChecked( true );
}
@@ -155,10 +156,14 @@
void MainWindow::keyPressEvent( QKeyEvent* keyEvent )
{
- if( ( keyEvent->key() == Qt::Key_Enter ||
- keyEvent->key() == Qt::Key_Return ) &&
- keyEvent->modifiers() == Qt::ControlModifier ) {
- qApp->quit();
+ if( keyEvent->key() == Qt::Key_Enter ||
+ keyEvent->key() == Qt::Key_Return ) {
+ if ( keyEvent->modifiers() == Qt::ControlModifier ) {
+ qApp->quit();
+ }
+ else if ( m_bSaveData ) {
+ save();
+ }
}
else if( keyEvent->key() == Qt::Key_Escape ) {
m_bSaveData = false;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic