<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -22,36 +22,36 @@
 #include &lt;config.h&gt;
 
 static const char description[] = I18N_NOOP(
-	&quot;&lt;p&gt;&lt;b&gt;Taking care of your ideas.&lt;/b&gt;&lt;/p&gt;&quot;
-	&quot;&lt;p&gt;A note-taking application that makes it easy to record ideas as you think, and quickly find them later. &quot;
-	&quot;Organizing your notes has never been so easy.&lt;/p&gt;&quot;);
+                                      &quot;&lt;p&gt;&lt;b&gt;Taking care of your ideas.&lt;/b&gt;&lt;/p&gt;&quot;
+                                      &quot;&lt;p&gt;A note-taking application that makes it easy to record ideas as you think, and quickly find them later. &quot;
+                                      &quot;Organizing your notes has never been so easy.&lt;/p&gt;&quot;);
 
-	// Or how to make order of disorganized toughts.
+// Or how to make order of disorganized toughts.
 
 AboutData::AboutData()
- : KAboutData( &quot;basket&quot;, &quot;&quot;, ki18n(&quot;BasKet Note Pads&quot;),
-   VERSION, ki18n(description), KAboutData::License_GPL_V2,
-   ki18n(&quot;(c) 2003-2007, S\303\251bastien Lao\303\273t&quot;), KLocalizedString(),
-   &quot;http://basket.kde.org/&quot;,
-   &quot;http://basket.kde.org/bugs/&quot; )
+        : KAboutData(&quot;basket&quot;, &quot;&quot;, ki18n(&quot;BasKet Note Pads&quot;),
+                     VERSION, ki18n(description), KAboutData::License_GPL_V2,
+                     ki18n(&quot;(c) 2003-2007, S\303\251bastien Lao\303\273t&quot;), KLocalizedString(),
+                     &quot;http://basket.kde.org/&quot;,
+                     &quot;http://basket.kde.org/bugs/&quot;)
 {
-	addAuthor( ki18n(&quot;Kelvie Wong&quot;),
-		   ki18n(&quot;Maintainer&quot;),
-		   &quot;kelvie@ieee.org&quot; );
+    addAuthor(ki18n(&quot;Kelvie Wong&quot;),
+              ki18n(&quot;Maintainer&quot;),
+              &quot;kelvie@ieee.org&quot;);
 
-	addAuthor( ki18n(&quot;S\303\251bastien Lao\303\273t&quot;),
-	           ki18n(&quot;Original Author&quot;),
-	           &quot;slaout@linux62.org&quot; );
+    addAuthor(ki18n(&quot;S\303\251bastien Lao\303\273t&quot;),
+              ki18n(&quot;Original Author&quot;),
+              &quot;slaout@linux62.org&quot;);
 
-	addAuthor( ki18n(&quot;Petri Damst\303\251n&quot;),
-	           ki18n(&quot;Basket encryption, Kontact integration, KnowIt importer&quot;),
-	           &quot;damu@iki.fi&quot; );
+    addAuthor(ki18n(&quot;Petri Damst\303\251n&quot;),
+              ki18n(&quot;Basket encryption, Kontact integration, KnowIt importer&quot;),
+              &quot;damu@iki.fi&quot;);
 
-	addAuthor( ki18n(&quot;Alex Gontmakher&quot;),
-	           ki18n(&quot;Baskets auto lock, save-status icon, HTML copy/paste, basket name tooltip, drop to basket name&quot;),
-	           &quot;gsasha@cs.technion.ac.il&quot; );
+    addAuthor(ki18n(&quot;Alex Gontmakher&quot;),
+              ki18n(&quot;Baskets auto lock, save-status icon, HTML copy/paste, basket name tooltip, drop to basket name&quot;),
+              &quot;gsasha@cs.technion.ac.il&quot;);
 
-	addAuthor( ki18n(&quot;Marco Martin&quot;),
-	           ki18n(&quot;Icon&quot;),
-	           &quot;m4rt@libero.it&quot; );
+    addAuthor(ki18n(&quot;Marco Martin&quot;),
+              ki18n(&quot;Icon&quot;),
+              &quot;m4rt@libero.it&quot;);
 }</diff>
      <filename>src/aboutdata.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -24,13 +24,13 @@
 #include &lt;basket_export.h&gt;
 
 /**
-	@author S&#233;bastien Lao&#251;t &lt;slaout@linux62.org&gt;
+    @author S&#233;bastien Lao&#251;t &lt;slaout@linux62.org&gt;
 */
 
 class BASKET_EXPORT AboutData : public KAboutData
 {
-  public:
-	AboutData();
+public:
+    AboutData();
 };
 
 #endif</diff>
      <filename>src/aboutdata.h</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@
 #include &quot;bnpview.h&quot;
 
 Application::Application()
- : KUniqueApplication()
+        : KUniqueApplication()
 {
 }
 
@@ -39,23 +39,23 @@ Application::~Application()
 
 int Application::newInstance()
 {
-	KUniqueApplication::newInstance();
+    KUniqueApplication::newInstance();
 
-	// Open the basket archive or template file supplied as argument:
-	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-	if (args &amp;&amp; args-&gt;count() &gt;= 1) {
-		QString fileName = args-&gt;arg(args-&gt;count() - 1);
-		if (QFile::exists(fileName)) {
-			QFileInfo fileInfo(fileName);
-			if (!fileInfo.isDir()) { // Do not mis-interpret data-folder param!
-				// Tags are not loaded until Global::bnpView::lateInit() is called.
-				// It is called 0ms after the application start.
-				BNPView::s_fileToOpen = fileName;
-				QTimer::singleShot( 100, Global::bnpView, SLOT(delayedOpenArchive()) );
-//				Global::bnpView-&gt;openArchive(fileName);
-				args-&gt;clear();
-			}
-		}
-	}
-	return 0;
+    // Open the basket archive or template file supplied as argument:
+    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+    if (args &amp;&amp; args-&gt;count() &gt;= 1) {
+        QString fileName = args-&gt;arg(args-&gt;count() - 1);
+        if (QFile::exists(fileName)) {
+            QFileInfo fileInfo(fileName);
+            if (!fileInfo.isDir()) { // Do not mis-interpret data-folder param!
+                // Tags are not loaded until Global::bnpView::lateInit() is called.
+                // It is called 0ms after the application start.
+                BNPView::s_fileToOpen = fileName;
+                QTimer::singleShot(100, Global::bnpView, SLOT(delayedOpenArchive()));
+//              Global::bnpView-&gt;openArchive(fileName);
+                args-&gt;clear();
+            }
+        }
+    }
+    return 0;
 }</diff>
      <filename>src/application.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -29,10 +29,10 @@
  */
 class Application : public KUniqueApplication
 {
-  public:
-	Application();
-	~Application();
-	int newInstance();
+public:
+    Application();
+    ~Application();
+    int newInstance();
 };
 
 #endif // APPLICATION_H</diff>
      <filename>src/application.h</filename>
    </modified>
    <modified>
      <diff>@@ -54,361 +54,361 @@
 
 void Archive::save(Basket *basket, bool withSubBaskets, const QString &amp;destination)
 {
-	QDir dir;
-	KProgressDialog dialog(0, i18n(&quot;Save as Basket Archive&quot;), i18n(&quot;Saving as basket archive. Please wait...&quot;), /*Not modal, for password dialogs!*/false);
-	dialog.showCancelButton(false);
-	dialog.setAutoClose(true);
-	dialog.show();
-	QProgressBar *progress = dialog.progressBar();
-    
+    QDir dir;
+    KProgressDialog dialog(0, i18n(&quot;Save as Basket Archive&quot;), i18n(&quot;Saving as basket archive. Please wait...&quot;), /*Not modal, for password dialogs!*/false);
+    dialog.showCancelButton(false);
+    dialog.setAutoClose(true);
+    dialog.show();
+    QProgressBar *progress = dialog.progressBar();
+
     progress-&gt;setRange(0,/*Preparation:*/1 + /*Finishing:*/1 + /*Basket:*/1 + /*SubBaskets:*/(withSubBaskets ? Global::bnpView-&gt;basketCount(Global::bnpView-&gt;listViewItemForBasket(basket)) : 0));
-	progress-&gt;setValue(0);
-
-	// Create the temporary folder:
-	QString tempFolder = Global::savesFolder() + &quot;temp-archive/&quot;;
-	dir.mkdir(tempFolder);
-
-	// Create the temporary archive file:
-	QString tempDestination = tempFolder + &quot;temp-archive.tar.gz&quot;;
-	KTar tar(tempDestination, &quot;application/x-gzip&quot;);
-	tar.open(QIODevice::WriteOnly);
-	tar.writeDir(&quot;baskets&quot;, &quot;&quot;, &quot;&quot;);
-
-    progress-&gt;setValue(progress-&gt;value()+1);        // Preparation finished
-    
-	kDebug() &lt;&lt; &quot;Preparation finished out of &quot; &lt;&lt; progress-&gt;maximum();
-
-	// Copy the baskets data into the archive:
-	QStringList backgrounds;
-	Archive::saveBasketToArchive(basket, withSubBaskets, &amp;tar, backgrounds, tempFolder, progress);
-
-	// Create a Small baskets.xml Document:
-	QDomDocument document(&quot;basketTree&quot;);
-	QDomElement root = document.createElement(&quot;basketTree&quot;);
-	document.appendChild(root);
-	Global::bnpView-&gt;saveSubHierarchy(Global::bnpView-&gt;listViewItemForBasket(basket), document, root, withSubBaskets);
-	Basket::safelySaveToFile(tempFolder + &quot;baskets.xml&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString());
-	tar.addLocalFile(tempFolder + &quot;baskets.xml&quot;, &quot;baskets/baskets.xml&quot;);
-	dir.remove(tempFolder + &quot;baskets.xml&quot;);
-
-	// Save a Small tags.xml Document:
-	QList&lt;Tag*&gt; tags;
-	listUsedTags(basket, withSubBaskets, tags);
-	Tag::saveTagsTo(tags, tempFolder + &quot;tags.xml&quot;);
-	tar.addLocalFile(tempFolder + &quot;tags.xml&quot;, &quot;tags.xml&quot;);
-	dir.remove(tempFolder + &quot;tags.xml&quot;);
-
-	// Save Tag Emblems (in case they are loaded on a computer that do not have those icons):
-	QString tempIconFile = tempFolder + &quot;icon.png&quot;;
-	for (Tag::List::iterator it = tags.begin(); it != tags.end(); ++it) {
-		State::List states = (*it)-&gt;states();
-		for (State::List::iterator it2 = states.begin(); it2 != states.end(); ++it2) {
-			State *state = (*it2);
-			QPixmap icon = KIconLoader::global()-&gt;loadIcon(
-                state-&gt;emblem(), KIconLoader::Small, 16, KIconLoader::DefaultState,
-                QStringList(), 0L, true
-                );
-			if (!icon.isNull()) {
-				icon.save(tempIconFile, &quot;PNG&quot;);
-				QString iconFileName = state-&gt;emblem().replace('/', '_');
-				tar.addLocalFile(tempIconFile, &quot;tag-emblems/&quot; + iconFileName);
-			}
-		}
-	}
-	dir.remove(tempIconFile);
-
-	// Finish Tar.Gz Exportation:
-	tar.close();
-
-	// Computing the File Preview:
-	Basket *previewBasket = basket; // FIXME: Use the first non-empty basket!
-	QPixmap previewPixmap(previewBasket-&gt;visibleWidth(), previewBasket-&gt;visibleHeight());
-	QPainter painter(&amp;previewPixmap);
-	// Save old state, and make the look clean (&quot;smile, you are filmed!&quot;):
-	NoteSelection *selection = previewBasket-&gt;selectedNotes();
-	previewBasket-&gt;unselectAll();
-	Note *focusedNote = previewBasket-&gt;focusedNote();
-	previewBasket-&gt;setFocusedNote(0);
-	previewBasket-&gt;doHoverEffects(0, Note::None);
-	// Take the screenshot:
-	previewBasket-&gt;drawContents(&amp;painter, 0, 0, previewPixmap.width(), previewPixmap.height());
-	// Go back to the old look:
-	previewBasket-&gt;selectSelection(selection);
-	previewBasket-&gt;setFocusedNote(focusedNote);
-	previewBasket-&gt;doHoverEffects();
-	// End and save our splandid painting:
-	painter.end();
-	QImage previewImage = previewPixmap.toImage();
-	const int PREVIEW_SIZE = 256;
-	previewImage = previewImage.scaled(PREVIEW_SIZE, PREVIEW_SIZE, Qt::KeepAspectRatio);
-	previewImage.save(tempFolder + &quot;preview.png&quot;, &quot;PNG&quot;);
-
-	// Finaly Save to the Real Destination file:
-	QFile file(destination);
-	if (file.open(QIODevice::WriteOnly)) {
-		ulong previewSize = QFile(tempFolder + &quot;preview.png&quot;).size();
-		ulong archiveSize = QFile(tempDestination).size();
-		QTextStream stream(&amp;file);
-		stream.setCodec(&quot;ISO-8859-1&quot;);
-		stream &lt;&lt; &quot;BasKetNP:archive\n&quot;
-		       &lt;&lt; &quot;version:0.6.1\n&quot;
-//		       &lt;&lt; &quot;read-compatible:0.6.1\n&quot;
-//		       &lt;&lt; &quot;write-compatible:0.6.1\n&quot;
-		       &lt;&lt; &quot;preview*:&quot; &lt;&lt; previewSize &lt;&lt; &quot;\n&quot;;
-
-		stream.flush();
-		// Copy the Preview File:
-		const unsigned long BUFFER_SIZE = 1024;
-		char *buffer = new char[BUFFER_SIZE];
-		long sizeRead;
-		QFile previewFile(tempFolder + &quot;preview.png&quot;);
-		if (previewFile.open(QIODevice::ReadOnly)) {
-			while ((sizeRead = previewFile.read(buffer, BUFFER_SIZE)) &gt; 0)
-				file.write(buffer, sizeRead);
-		}
-		stream &lt;&lt; &quot;archive*:&quot; &lt;&lt; archiveSize &lt;&lt; &quot;\n&quot;;
-		stream.flush();
-
-		// Copy the Archive File:
-		QFile archiveFile(tempDestination);
-		if (archiveFile.open(QIODevice::ReadOnly)) {
-			while ((sizeRead = archiveFile.read(buffer, BUFFER_SIZE)) &gt; 0)
-				file.write(buffer, sizeRead);
-		}
-		// Clean Up:
-		delete buffer;
-		buffer = 0;
-		file.close();
-	}
-
-    progress-&gt;setValue(progress-&gt;value()+1); // Finishing finished
-	kDebug() &lt;&lt; &quot;Finishing finished&quot;;
-
-	// Clean Up Everything:
-	dir.remove(tempFolder + &quot;preview.png&quot;);
-	dir.remove(tempDestination);
-	dir.rmdir(tempFolder);
+    progress-&gt;setValue(0);
+
+    // Create the temporary folder:
+    QString tempFolder = Global::savesFolder() + &quot;temp-archive/&quot;;
+    dir.mkdir(tempFolder);
+
+    // Create the temporary archive file:
+    QString tempDestination = tempFolder + &quot;temp-archive.tar.gz&quot;;
+    KTar tar(tempDestination, &quot;application/x-gzip&quot;);
+    tar.open(QIODevice::WriteOnly);
+    tar.writeDir(&quot;baskets&quot;, &quot;&quot;, &quot;&quot;);
+
+    progress-&gt;setValue(progress-&gt;value() + 1);      // Preparation finished
+
+    kDebug() &lt;&lt; &quot;Preparation finished out of &quot; &lt;&lt; progress-&gt;maximum();
+
+    // Copy the baskets data into the archive:
+    QStringList backgrounds;
+    Archive::saveBasketToArchive(basket, withSubBaskets, &amp;tar, backgrounds, tempFolder, progress);
+
+    // Create a Small baskets.xml Document:
+    QDomDocument document(&quot;basketTree&quot;);
+    QDomElement root = document.createElement(&quot;basketTree&quot;);
+    document.appendChild(root);
+    Global::bnpView-&gt;saveSubHierarchy(Global::bnpView-&gt;listViewItemForBasket(basket), document, root, withSubBaskets);
+    Basket::safelySaveToFile(tempFolder + &quot;baskets.xml&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString());
+    tar.addLocalFile(tempFolder + &quot;baskets.xml&quot;, &quot;baskets/baskets.xml&quot;);
+    dir.remove(tempFolder + &quot;baskets.xml&quot;);
+
+    // Save a Small tags.xml Document:
+    QList&lt;Tag*&gt; tags;
+    listUsedTags(basket, withSubBaskets, tags);
+    Tag::saveTagsTo(tags, tempFolder + &quot;tags.xml&quot;);
+    tar.addLocalFile(tempFolder + &quot;tags.xml&quot;, &quot;tags.xml&quot;);
+    dir.remove(tempFolder + &quot;tags.xml&quot;);
+
+    // Save Tag Emblems (in case they are loaded on a computer that do not have those icons):
+    QString tempIconFile = tempFolder + &quot;icon.png&quot;;
+    for (Tag::List::iterator it = tags.begin(); it != tags.end(); ++it) {
+        State::List states = (*it)-&gt;states();
+        for (State::List::iterator it2 = states.begin(); it2 != states.end(); ++it2) {
+            State *state = (*it2);
+            QPixmap icon = KIconLoader::global()-&gt;loadIcon(
+                               state-&gt;emblem(), KIconLoader::Small, 16, KIconLoader::DefaultState,
+                               QStringList(), 0L, true
+                           );
+            if (!icon.isNull()) {
+                icon.save(tempIconFile, &quot;PNG&quot;);
+                QString iconFileName = state-&gt;emblem().replace('/', '_');
+                tar.addLocalFile(tempIconFile, &quot;tag-emblems/&quot; + iconFileName);
+            }
+        }
+    }
+    dir.remove(tempIconFile);
+
+    // Finish Tar.Gz Exportation:
+    tar.close();
+
+    // Computing the File Preview:
+    Basket *previewBasket = basket; // FIXME: Use the first non-empty basket!
+    QPixmap previewPixmap(previewBasket-&gt;visibleWidth(), previewBasket-&gt;visibleHeight());
+    QPainter painter(&amp;previewPixmap);
+    // Save old state, and make the look clean (&quot;smile, you are filmed!&quot;):
+    NoteSelection *selection = previewBasket-&gt;selectedNotes();
+    previewBasket-&gt;unselectAll();
+    Note *focusedNote = previewBasket-&gt;focusedNote();
+    previewBasket-&gt;setFocusedNote(0);
+    previewBasket-&gt;doHoverEffects(0, Note::None);
+    // Take the screenshot:
+    previewBasket-&gt;drawContents(&amp;painter, 0, 0, previewPixmap.width(), previewPixmap.height());
+    // Go back to the old look:
+    previewBasket-&gt;selectSelection(selection);
+    previewBasket-&gt;setFocusedNote(focusedNote);
+    previewBasket-&gt;doHoverEffects();
+    // End and save our splandid painting:
+    painter.end();
+    QImage previewImage = previewPixmap.toImage();
+    const int PREVIEW_SIZE = 256;
+    previewImage = previewImage.scaled(PREVIEW_SIZE, PREVIEW_SIZE, Qt::KeepAspectRatio);
+    previewImage.save(tempFolder + &quot;preview.png&quot;, &quot;PNG&quot;);
+
+    // Finaly Save to the Real Destination file:
+    QFile file(destination);
+    if (file.open(QIODevice::WriteOnly)) {
+        ulong previewSize = QFile(tempFolder + &quot;preview.png&quot;).size();
+        ulong archiveSize = QFile(tempDestination).size();
+        QTextStream stream(&amp;file);
+        stream.setCodec(&quot;ISO-8859-1&quot;);
+        stream &lt;&lt; &quot;BasKetNP:archive\n&quot;
+        &lt;&lt; &quot;version:0.6.1\n&quot;
+//             &lt;&lt; &quot;read-compatible:0.6.1\n&quot;
+//             &lt;&lt; &quot;write-compatible:0.6.1\n&quot;
+        &lt;&lt; &quot;preview*:&quot; &lt;&lt; previewSize &lt;&lt; &quot;\n&quot;;
+
+        stream.flush();
+        // Copy the Preview File:
+        const unsigned long BUFFER_SIZE = 1024;
+        char *buffer = new char[BUFFER_SIZE];
+        long sizeRead;
+        QFile previewFile(tempFolder + &quot;preview.png&quot;);
+        if (previewFile.open(QIODevice::ReadOnly)) {
+            while ((sizeRead = previewFile.read(buffer, BUFFER_SIZE)) &gt; 0)
+                file.write(buffer, sizeRead);
+        }
+        stream &lt;&lt; &quot;archive*:&quot; &lt;&lt; archiveSize &lt;&lt; &quot;\n&quot;;
+        stream.flush();
+
+        // Copy the Archive File:
+        QFile archiveFile(tempDestination);
+        if (archiveFile.open(QIODevice::ReadOnly)) {
+            while ((sizeRead = archiveFile.read(buffer, BUFFER_SIZE)) &gt; 0)
+                file.write(buffer, sizeRead);
+        }
+        // Clean Up:
+        delete buffer;
+        buffer = 0;
+        file.close();
+    }
+
+    progress-&gt;setValue(progress-&gt;value() + 1); // Finishing finished
+    kDebug() &lt;&lt; &quot;Finishing finished&quot;;
+
+    // Clean Up Everything:
+    dir.remove(tempFolder + &quot;preview.png&quot;);
+    dir.remove(tempDestination);
+    dir.rmdir(tempFolder);
 }
 
 void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QStringList &amp;backgrounds, const QString &amp;tempFolder, QProgressBar *progress)
 {
-	// Basket need to be loaded for tags exportation.
-	// We load it NOW so that the progress bar really reflect the state of the exportation:
-	if (!basket-&gt;isLoaded()) {
-		basket-&gt;load();
-	}
-
-	QDir dir;
-	// Save basket data:
-	tar-&gt;addLocalDirectory(basket-&gt;fullPath(), &quot;baskets/&quot; + basket-&gt;folderName());
-	tar-&gt;addLocalFile(basket-&gt;fullPath() + &quot;.basket&quot;, &quot;baskets/&quot; + basket-&gt;folderName() + &quot;.basket&quot;); // The hidden files were not added
-	// Save basket icon:
-	QString tempIconFile = tempFolder + &quot;icon.png&quot;;
-	if (!basket-&gt;icon().isEmpty() &amp;&amp; basket-&gt;icon() != &quot;basket&quot;) {
-		QPixmap icon = KIconLoader::global()-&gt;loadIcon(basket-&gt;icon(), KIconLoader::Small, 16, KIconLoader::DefaultState,
-                                                               QStringList(), /*path_store=*/0L, /*canReturnNull=*/true);
-		if (!icon.isNull()) {
-			icon.save(tempIconFile, &quot;PNG&quot;);
-			QString iconFileName = basket-&gt;icon().replace('/', '_');
-			tar-&gt;addLocalFile(tempIconFile, &quot;basket-icons/&quot; + iconFileName);
-		}
-	}
-	// Save basket backgorund image:
-	QString imageName = basket-&gt;backgroundImageName();
-	if (!basket-&gt;backgroundImageName().isEmpty() &amp;&amp; !backgrounds.contains(imageName)) {
-		QString backgroundPath = Global::backgroundManager-&gt;pathForImageName(imageName);
-		if (!backgroundPath.isEmpty()) {
-			// Save the background image:
-			tar-&gt;addLocalFile(backgroundPath, &quot;backgrounds/&quot; + imageName);
-			// Save the preview image:
-			QString previewPath = Global::backgroundManager-&gt;previewPathForImageName(imageName);
-			if (!previewPath.isEmpty())
-				tar-&gt;addLocalFile(previewPath, &quot;backgrounds/previews/&quot; + imageName);
-			// Save the configuration file:
-			QString configPath = backgroundPath + &quot;.config&quot;;
-			if (dir.exists(configPath))
-				tar-&gt;addLocalFile(configPath, &quot;backgrounds/&quot; + imageName + &quot;.config&quot;);
-		}
-		backgrounds.append(imageName);
-	}
-
-    progress-&gt;setValue(progress-&gt;value()+1); // Basket exportation finished
-	kDebug() &lt;&lt; basket-&gt;basketName() &lt;&lt; &quot; finished&quot;;
-
-	// Recursively save child baskets:
-	BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
-	if (recursive) {
-		for (int i=0;i&lt;item-&gt;childCount();i++){
-			saveBasketToArchive(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), recursive, tar, backgrounds, tempFolder, progress);
-		}
-	}
+    // Basket need to be loaded for tags exportation.
+    // We load it NOW so that the progress bar really reflect the state of the exportation:
+    if (!basket-&gt;isLoaded()) {
+        basket-&gt;load();
+    }
+
+    QDir dir;
+    // Save basket data:
+    tar-&gt;addLocalDirectory(basket-&gt;fullPath(), &quot;baskets/&quot; + basket-&gt;folderName());
+    tar-&gt;addLocalFile(basket-&gt;fullPath() + &quot;.basket&quot;, &quot;baskets/&quot; + basket-&gt;folderName() + &quot;.basket&quot;); // The hidden files were not added
+    // Save basket icon:
+    QString tempIconFile = tempFolder + &quot;icon.png&quot;;
+    if (!basket-&gt;icon().isEmpty() &amp;&amp; basket-&gt;icon() != &quot;basket&quot;) {
+        QPixmap icon = KIconLoader::global()-&gt;loadIcon(basket-&gt;icon(), KIconLoader::Small, 16, KIconLoader::DefaultState,
+                       QStringList(), /*path_store=*/0L, /*canReturnNull=*/true);
+        if (!icon.isNull()) {
+            icon.save(tempIconFile, &quot;PNG&quot;);
+            QString iconFileName = basket-&gt;icon().replace('/', '_');
+            tar-&gt;addLocalFile(tempIconFile, &quot;basket-icons/&quot; + iconFileName);
+        }
+    }
+    // Save basket backgorund image:
+    QString imageName = basket-&gt;backgroundImageName();
+    if (!basket-&gt;backgroundImageName().isEmpty() &amp;&amp; !backgrounds.contains(imageName)) {
+        QString backgroundPath = Global::backgroundManager-&gt;pathForImageName(imageName);
+        if (!backgroundPath.isEmpty()) {
+            // Save the background image:
+            tar-&gt;addLocalFile(backgroundPath, &quot;backgrounds/&quot; + imageName);
+            // Save the preview image:
+            QString previewPath = Global::backgroundManager-&gt;previewPathForImageName(imageName);
+            if (!previewPath.isEmpty())
+                tar-&gt;addLocalFile(previewPath, &quot;backgrounds/previews/&quot; + imageName);
+            // Save the configuration file:
+            QString configPath = backgroundPath + &quot;.config&quot;;
+            if (dir.exists(configPath))
+                tar-&gt;addLocalFile(configPath, &quot;backgrounds/&quot; + imageName + &quot;.config&quot;);
+        }
+        backgrounds.append(imageName);
+    }
+
+    progress-&gt;setValue(progress-&gt;value() + 1); // Basket exportation finished
+    kDebug() &lt;&lt; basket-&gt;basketName() &lt;&lt; &quot; finished&quot;;
+
+    // Recursively save child baskets:
+    BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
+    if (recursive) {
+        for (int i = 0; i &lt; item-&gt;childCount(); i++) {
+            saveBasketToArchive(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), recursive, tar, backgrounds, tempFolder, progress);
+        }
+    }
 }
 
 void Archive::listUsedTags(Basket *basket, bool recursive, QList&lt;Tag*&gt; &amp;list)
 {
-	basket-&gt;listUsedTags(list);
-	BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
-	if (recursive) {
-		for (int i=0;i&lt;item-&gt;childCount();i++){
-			listUsedTags(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), recursive, list);
-		}
-	}
+    basket-&gt;listUsedTags(list);
+    BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
+    if (recursive) {
+        for (int i = 0; i &lt; item-&gt;childCount(); i++) {
+            listUsedTags(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), recursive, list);
+        }
+    }
 }
 
 void Archive::open(const QString &amp;path)
 {
-	// Create the temporar folder:
-	QString tempFolder = Global::savesFolder() + &quot;temp-archive/&quot;;
-	QDir dir;
-	dir.mkdir(tempFolder);
-	const qint64 BUFFER_SIZE = 1024;
-
-	QFile file(path);
-	if (file.open(QIODevice::ReadOnly)) {
-		QTextStream stream(&amp;file);
-		stream.setCodec(&quot;ISO-8859-1&quot;);
-		QString line = stream.readLine();
-		if (line != &quot;BasKetNP:archive&quot;) {
-			KMessageBox::error(0, i18n(&quot;This file is not a basket archive.&quot;), i18n(&quot;Basket Archive Error&quot;));
-			file.close();
-			Tools::deleteRecursively(tempFolder);
-			return;
-		}
-		QString version;
-		QStringList readCompatibleVersions;
-		QStringList writeCompatibleVersions;
-		while (!stream.atEnd()) {
-			// Get Key/Value Pair From the Line to Read:
-			line = stream.readLine();
-			int index = line.indexOf(':');
-			QString key;
-			QString value;
-			if (index &gt;= 0) {
-				key = line.left(index);
-				value = line.right(line.length() - index - 1);
-			} else {
-				key = line;
-				value = &quot;&quot;;
-			}
-			if (key == &quot;version&quot;) {
-				version = value;
-			} else if (key == &quot;read-compatible&quot;) {
-				readCompatibleVersions = value.split(&quot;;&quot;);
-			} else if (key == &quot;write-compatible&quot;) {
-				writeCompatibleVersions = value.split(&quot;;&quot;);
-			} else if (key == &quot;preview*&quot;) {
-				bool ok;
-				qint64 size = value.toULong(&amp;ok);
-				if (!ok) {
-					KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
-					file.close();
-					Tools::deleteRecursively(tempFolder);
-					return;
-				}
-				// Get the preview file:
+    // Create the temporar folder:
+    QString tempFolder = Global::savesFolder() + &quot;temp-archive/&quot;;
+    QDir dir;
+    dir.mkdir(tempFolder);
+    const qint64 BUFFER_SIZE = 1024;
+
+    QFile file(path);
+    if (file.open(QIODevice::ReadOnly)) {
+        QTextStream stream(&amp;file);
+        stream.setCodec(&quot;ISO-8859-1&quot;);
+        QString line = stream.readLine();
+        if (line != &quot;BasKetNP:archive&quot;) {
+            KMessageBox::error(0, i18n(&quot;This file is not a basket archive.&quot;), i18n(&quot;Basket Archive Error&quot;));
+            file.close();
+            Tools::deleteRecursively(tempFolder);
+            return;
+        }
+        QString version;
+        QStringList readCompatibleVersions;
+        QStringList writeCompatibleVersions;
+        while (!stream.atEnd()) {
+            // Get Key/Value Pair From the Line to Read:
+            line = stream.readLine();
+            int index = line.indexOf(':');
+            QString key;
+            QString value;
+            if (index &gt;= 0) {
+                key = line.left(index);
+                value = line.right(line.length() - index - 1);
+            } else {
+                key = line;
+                value = &quot;&quot;;
+            }
+            if (key == &quot;version&quot;) {
+                version = value;
+            } else if (key == &quot;read-compatible&quot;) {
+                readCompatibleVersions = value.split(&quot;;&quot;);
+            } else if (key == &quot;write-compatible&quot;) {
+                writeCompatibleVersions = value.split(&quot;;&quot;);
+            } else if (key == &quot;preview*&quot;) {
+                bool ok;
+                qint64 size = value.toULong(&amp;ok);
+                if (!ok) {
+                    KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
+                    file.close();
+                    Tools::deleteRecursively(tempFolder);
+                    return;
+                }
+                // Get the preview file:
 //FIXME: We do not need the preview for now
-//				QFile previewFile(tempFolder + &quot;preview.png&quot;);
-//				if (previewFile.open(QIODevice::WriteOnly)) {
-					stream.seek(stream.pos()+size);
-			} else if (key == &quot;archive*&quot;) {
-				if (version != &quot;0.6.1&quot; &amp;&amp; readCompatibleVersions.contains(&quot;0.6.1&quot;) &amp;&amp; !writeCompatibleVersions.contains(&quot;0.6.1&quot;)) {
-					KMessageBox::information(
-						0,
-						i18n(&quot;This file was created with a recent version of %1. &quot;
-						     &quot;It can be opened but not every information will be available to you. &quot;
-						     &quot;For instance, some notes may be missing because they are of a type only available in new versions. &quot;
-						     &quot;When saving the file back, consider to save it to another file, to preserve the original one.&quot;,
-							KGlobal::mainComponent().aboutData()-&gt;programName()),
-						i18n(&quot;Basket Archive Error&quot;)
-					);
-				}
-				if (version != &quot;0.6.1&quot; &amp;&amp; !readCompatibleVersions.contains(&quot;0.6.1&quot;) &amp;&amp; !writeCompatibleVersions.contains(&quot;0.6.1&quot;)) {
-					KMessageBox::error(
-						0,
-						i18n(&quot;This file was created with a recent version of %1. Please upgrade to a newer version to be able to open that file.&quot;,
-                            KGlobal::mainComponent().aboutData()-&gt;programName()),
-						i18n(&quot;Basket Archive Error&quot;)
-					);
-					file.close();
-					Tools::deleteRecursively(tempFolder);
-					return;
-				}
-
-				bool ok;
-				qint64 size = value.toULong(&amp;ok);
-				if (!ok) {
-					KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
-					file.close();
-					Tools::deleteRecursively(tempFolder);
-					return;
-				}
-
-				Global::mainWindow()-&gt;raise();
-
-				// Get the archive file:
-				QString tempArchive = tempFolder + &quot;temp-archive.tar.gz&quot;;
-				QFile archiveFile(tempArchive);
-				file.seek(stream.pos());
-				if (archiveFile.open(QIODevice::WriteOnly)) {
-					char *buffer = new char[BUFFER_SIZE];
-					qint64 sizeRead;
-					while ((sizeRead = file.read(buffer, qMin(BUFFER_SIZE, size))) &gt; 0) {
-						archiveFile.write(buffer, sizeRead);
-						size -= sizeRead;
-					}
-					archiveFile.close();
-					delete buffer;
-
-					// Extract the Archive:
-					QString extractionFolder = tempFolder + &quot;extraction/&quot;;
-					QDir dir;
-					dir.mkdir(extractionFolder);
-					KTar tar(tempArchive, &quot;application/x-gzip&quot;);
-					tar.open(QIODevice::ReadOnly);
-					tar.directory()-&gt;copyTo(extractionFolder);
-					tar.close();
-
-					// Import the Tags:
-					importTagEmblems(extractionFolder); // Import and rename tag emblems BEFORE loading them!
-					QMap&lt;QString, QString&gt; mergedStates = Tag::loadTags(extractionFolder + &quot;tags.xml&quot;);
-					QMap&lt;QString, QString&gt;::Iterator it;
-					if (mergedStates.count() &gt; 0) {
-						Tag::saveTags();
-					}
-
-					// Import the Background Images:
-					importArchivedBackgroundImages(extractionFolder);
-
-					// Import the Baskets:
-					renameBasketFolders(extractionFolder, mergedStates);
-					stream.seek(file.pos());
-
-				}
-			} else if (key.endsWith(&quot;*&quot;)) {
-				// We do not know what it is, but we should read the embedded-file in order to discard it:
-				bool ok;
-				qint64 size = value.toULong(&amp;ok);
-				if (!ok) {
-					KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
-					file.close();
-					Tools::deleteRecursively(tempFolder);
-					return;
-				}
-				// Get the archive file:
-				char *buffer = new char[BUFFER_SIZE];
-				qint64 sizeRead;
-				while ((sizeRead = file.read(buffer, qMin(BUFFER_SIZE, size))) &gt; 0) {
-					size -= sizeRead;
-				}
-				delete buffer;
-			} else {
-				// We do not know what it is, and we do not care.
-			}
-			// Analyse the Value, if Understood:
-		}
-		file.close();
-	}
-	Tools::deleteRecursively(tempFolder);
+//              QFile previewFile(tempFolder + &quot;preview.png&quot;);
+//              if (previewFile.open(QIODevice::WriteOnly)) {
+                stream.seek(stream.pos() + size);
+            } else if (key == &quot;archive*&quot;) {
+                if (version != &quot;0.6.1&quot; &amp;&amp; readCompatibleVersions.contains(&quot;0.6.1&quot;) &amp;&amp; !writeCompatibleVersions.contains(&quot;0.6.1&quot;)) {
+                    KMessageBox::information(
+                        0,
+                        i18n(&quot;This file was created with a recent version of %1. &quot;
+                             &quot;It can be opened but not every information will be available to you. &quot;
+                             &quot;For instance, some notes may be missing because they are of a type only available in new versions. &quot;
+                             &quot;When saving the file back, consider to save it to another file, to preserve the original one.&quot;,
+                             KGlobal::mainComponent().aboutData()-&gt;programName()),
+                        i18n(&quot;Basket Archive Error&quot;)
+                    );
+                }
+                if (version != &quot;0.6.1&quot; &amp;&amp; !readCompatibleVersions.contains(&quot;0.6.1&quot;) &amp;&amp; !writeCompatibleVersions.contains(&quot;0.6.1&quot;)) {
+                    KMessageBox::error(
+                        0,
+                        i18n(&quot;This file was created with a recent version of %1. Please upgrade to a newer version to be able to open that file.&quot;,
+                             KGlobal::mainComponent().aboutData()-&gt;programName()),
+                        i18n(&quot;Basket Archive Error&quot;)
+                    );
+                    file.close();
+                    Tools::deleteRecursively(tempFolder);
+                    return;
+                }
+
+                bool ok;
+                qint64 size = value.toULong(&amp;ok);
+                if (!ok) {
+                    KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
+                    file.close();
+                    Tools::deleteRecursively(tempFolder);
+                    return;
+                }
+
+                Global::mainWindow()-&gt;raise();
+
+                // Get the archive file:
+                QString tempArchive = tempFolder + &quot;temp-archive.tar.gz&quot;;
+                QFile archiveFile(tempArchive);
+                file.seek(stream.pos());
+                if (archiveFile.open(QIODevice::WriteOnly)) {
+                    char *buffer = new char[BUFFER_SIZE];
+                    qint64 sizeRead;
+                    while ((sizeRead = file.read(buffer, qMin(BUFFER_SIZE, size))) &gt; 0) {
+                        archiveFile.write(buffer, sizeRead);
+                        size -= sizeRead;
+                    }
+                    archiveFile.close();
+                    delete buffer;
+
+                    // Extract the Archive:
+                    QString extractionFolder = tempFolder + &quot;extraction/&quot;;
+                    QDir dir;
+                    dir.mkdir(extractionFolder);
+                    KTar tar(tempArchive, &quot;application/x-gzip&quot;);
+                    tar.open(QIODevice::ReadOnly);
+                    tar.directory()-&gt;copyTo(extractionFolder);
+                    tar.close();
+
+                    // Import the Tags:
+                    importTagEmblems(extractionFolder); // Import and rename tag emblems BEFORE loading them!
+                    QMap&lt;QString, QString&gt; mergedStates = Tag::loadTags(extractionFolder + &quot;tags.xml&quot;);
+                    QMap&lt;QString, QString&gt;::Iterator it;
+                    if (mergedStates.count() &gt; 0) {
+                        Tag::saveTags();
+                    }
+
+                    // Import the Background Images:
+                    importArchivedBackgroundImages(extractionFolder);
+
+                    // Import the Baskets:
+                    renameBasketFolders(extractionFolder, mergedStates);
+                    stream.seek(file.pos());
+
+                }
+            } else if (key.endsWith(&quot;*&quot;)) {
+                // We do not know what it is, but we should read the embedded-file in order to discard it:
+                bool ok;
+                qint64 size = value.toULong(&amp;ok);
+                if (!ok) {
+                    KMessageBox::error(0, i18n(&quot;This file is corrupted. It can not be opened.&quot;), i18n(&quot;Basket Archive Error&quot;));
+                    file.close();
+                    Tools::deleteRecursively(tempFolder);
+                    return;
+                }
+                // Get the archive file:
+                char *buffer = new char[BUFFER_SIZE];
+                qint64 sizeRead;
+                while ((sizeRead = file.read(buffer, qMin(BUFFER_SIZE, size))) &gt; 0) {
+                    size -= sizeRead;
+                }
+                delete buffer;
+            } else {
+                // We do not know what it is, and we do not care.
+            }
+            // Analyse the Value, if Understood:
+        }
+        file.close();
+    }
+    Tools::deleteRecursively(tempFolder);
 }
 
 /**
@@ -420,228 +420,228 @@ void Archive::open(const QString &amp;path)
  */
 void Archive::importTagEmblems(const QString &amp;extractionFolder)
 {
-	QDomDocument *document = XMLWork::openFile(&quot;basketTags&quot;, extractionFolder + &quot;tags.xml&quot;);
-	if (document == 0)
-		return;
-	QDomElement docElem = document-&gt;documentElement();
-
-	QDir dir;
-	dir.mkdir(Global::savesFolder() + &quot;tag-emblems/&quot;);
-	FormatImporter copier; // Only used to copy files synchronously
-
-	QDomNode node = docElem.firstChild();
-	while (!node.isNull()) {
-		QDomElement element = node.toElement();
-		if ( (!element.isNull()) &amp;&amp; element.tagName() == &quot;tag&quot; ) {
-			QDomNode subNode = element.firstChild();
-			while (!subNode.isNull()) {
-				QDomElement subElement = subNode.toElement();
-				if ( (!subElement.isNull()) &amp;&amp; subElement.tagName() == &quot;state&quot; ) {
-					QString emblemName = XMLWork::getElementText(subElement, &quot;emblem&quot;);
-					if (!emblemName.isEmpty()) {
-						QPixmap emblem = KIconLoader::global()-&gt;loadIcon(emblemName, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,  QStringList(), 0L, /*canReturnNull=*/true);
-						// The icon does not exists on that computer, import it:
-						if (emblem.isNull()) {
-							// Of the emblem path was eg. &quot;/home/seb/emblem.png&quot;, it was exported as &quot;tag-emblems/_home_seb_emblem.png&quot;.
-							// So we need to copy that image to &quot;~/.kde/share/apps/basket/tag-emblems/emblem.png&quot;:
-							int slashIndex = emblemName.lastIndexOf('/');
-							QString emblemFileName = (slashIndex &lt; 0 ? emblemName : emblemName.right(slashIndex - 2));
-							QString source      = extractionFolder + &quot;tag-emblems/&quot; + emblemName.replace('/', '_');
-							QString destination = Global::savesFolder() + &quot;tag-emblems/&quot; + emblemFileName;
-							if (!dir.exists(destination) &amp;&amp; dir.exists(source))
-								copier.copyFolder(source, destination);
-							// Replace the emblem path in the tags.xml copy:
-							QDomElement emblemElement = XMLWork::getElement(subElement, &quot;emblem&quot;);
-							subElement.removeChild(emblemElement);
-							XMLWork::addElement(*document, subElement, &quot;emblem&quot;, destination);
-						}
-					}
-				}
-				subNode = subNode.nextSibling();
-			}
-		}
-		node = node.nextSibling();
-	}
-	Basket::safelySaveToFile(extractionFolder + &quot;tags.xml&quot;, document-&gt;toString());
+    QDomDocument *document = XMLWork::openFile(&quot;basketTags&quot;, extractionFolder + &quot;tags.xml&quot;);
+    if (document == 0)
+        return;
+    QDomElement docElem = document-&gt;documentElement();
+
+    QDir dir;
+    dir.mkdir(Global::savesFolder() + &quot;tag-emblems/&quot;);
+    FormatImporter copier; // Only used to copy files synchronously
+
+    QDomNode node = docElem.firstChild();
+    while (!node.isNull()) {
+        QDomElement element = node.toElement();
+        if ((!element.isNull()) &amp;&amp; element.tagName() == &quot;tag&quot;) {
+            QDomNode subNode = element.firstChild();
+            while (!subNode.isNull()) {
+                QDomElement subElement = subNode.toElement();
+                if ((!subElement.isNull()) &amp;&amp; subElement.tagName() == &quot;state&quot;) {
+                    QString emblemName = XMLWork::getElementText(subElement, &quot;emblem&quot;);
+                    if (!emblemName.isEmpty()) {
+                        QPixmap emblem = KIconLoader::global()-&gt;loadIcon(emblemName, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,  QStringList(), 0L, /*canReturnNull=*/true);
+                        // The icon does not exists on that computer, import it:
+                        if (emblem.isNull()) {
+                            // Of the emblem path was eg. &quot;/home/seb/emblem.png&quot;, it was exported as &quot;tag-emblems/_home_seb_emblem.png&quot;.
+                            // So we need to copy that image to &quot;~/.kde/share/apps/basket/tag-emblems/emblem.png&quot;:
+                            int slashIndex = emblemName.lastIndexOf('/');
+                            QString emblemFileName = (slashIndex &lt; 0 ? emblemName : emblemName.right(slashIndex - 2));
+                            QString source      = extractionFolder + &quot;tag-emblems/&quot; + emblemName.replace('/', '_');
+                            QString destination = Global::savesFolder() + &quot;tag-emblems/&quot; + emblemFileName;
+                            if (!dir.exists(destination) &amp;&amp; dir.exists(source))
+                                copier.copyFolder(source, destination);
+                            // Replace the emblem path in the tags.xml copy:
+                            QDomElement emblemElement = XMLWork::getElement(subElement, &quot;emblem&quot;);
+                            subElement.removeChild(emblemElement);
+                            XMLWork::addElement(*document, subElement, &quot;emblem&quot;, destination);
+                        }
+                    }
+                }
+                subNode = subNode.nextSibling();
+            }
+        }
+        node = node.nextSibling();
+    }
+    Basket::safelySaveToFile(extractionFolder + &quot;tags.xml&quot;, document-&gt;toString());
 }
 
 void Archive::importArchivedBackgroundImages(const QString &amp;extractionFolder)
 {
-	FormatImporter copier; // Only used to copy files synchronously
-	QString destFolder = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/backgrounds/&quot;);
-
-	QDir dir(extractionFolder + &quot;backgrounds/&quot;, /*nameFilder=*/&quot;*.png&quot;, /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
-	QStringList files = dir.entryList();
-	for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
-		QString image = *it;
-		if (!Global::backgroundManager-&gt;exists(image)) {
-			// Copy images:
-			QString imageSource = extractionFolder + &quot;backgrounds/&quot; + image;
-			QString imageDest   = destFolder + image;
-			copier.copyFolder(imageSource, imageDest);
-			// Copy configuration file:
-			QString configSource = extractionFolder + &quot;backgrounds/&quot; + image + &quot;.config&quot;;
-			QString configDest   = destFolder + image;
-			if (dir.exists(configSource))
-				copier.copyFolder(configSource, configDest);
-			// Copy preview:
-			QString previewSource = extractionFolder + &quot;backgrounds/previews/&quot; + image;
-			QString previewDest   = destFolder + &quot;previews/&quot; + image;
-			if (dir.exists(previewSource)) {
-				dir.mkdir(destFolder + &quot;previews/&quot;); // Make sure the folder exists!
-				copier.copyFolder(previewSource, previewDest);
-			}
-			// Append image to database:
-			Global::backgroundManager-&gt;addImage(imageDest);
-		}
-	}
+    FormatImporter copier; // Only used to copy files synchronously
+    QString destFolder = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/backgrounds/&quot;);
+
+    QDir dir(extractionFolder + &quot;backgrounds/&quot;, /*nameFilder=*/&quot;*.png&quot;, /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
+    QStringList files = dir.entryList();
+    for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
+        QString image = *it;
+        if (!Global::backgroundManager-&gt;exists(image)) {
+            // Copy images:
+            QString imageSource = extractionFolder + &quot;backgrounds/&quot; + image;
+            QString imageDest   = destFolder + image;
+            copier.copyFolder(imageSource, imageDest);
+            // Copy configuration file:
+            QString configSource = extractionFolder + &quot;backgrounds/&quot; + image + &quot;.config&quot;;
+            QString configDest   = destFolder + image;
+            if (dir.exists(configSource))
+                copier.copyFolder(configSource, configDest);
+            // Copy preview:
+            QString previewSource = extractionFolder + &quot;backgrounds/previews/&quot; + image;
+            QString previewDest   = destFolder + &quot;previews/&quot; + image;
+            if (dir.exists(previewSource)) {
+                dir.mkdir(destFolder + &quot;previews/&quot;); // Make sure the folder exists!
+                copier.copyFolder(previewSource, previewDest);
+            }
+            // Append image to database:
+            Global::backgroundManager-&gt;addImage(imageDest);
+        }
+    }
 }
 
 void Archive::renameBasketFolders(const QString &amp;extractionFolder, QMap&lt;QString, QString&gt; &amp;mergedStates)
 {
-	QDomDocument *doc = XMLWork::openFile(&quot;basketTree&quot;, extractionFolder + &quot;baskets/baskets.xml&quot;);
-	if (doc != 0) {
-		QMap&lt;QString, QString&gt; folderMap;
-		QDomElement docElem = doc-&gt;documentElement();
-		QDomNode node = docElem.firstChild();
-		renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
-		loadExtractedBaskets(extractionFolder, node, folderMap, 0);
-	}
+    QDomDocument *doc = XMLWork::openFile(&quot;basketTree&quot;, extractionFolder + &quot;baskets/baskets.xml&quot;);
+    if (doc != 0) {
+        QMap&lt;QString, QString&gt; folderMap;
+        QDomElement docElem = doc-&gt;documentElement();
+        QDomNode node = docElem.firstChild();
+        renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
+        loadExtractedBaskets(extractionFolder, node, folderMap, 0);
+    }
 }
 
 void Archive::renameBasketFolder(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, QMap&lt;QString, QString&gt; &amp;mergedStates)
 {
-	QDomNode n = basketNode;
-	while ( ! n.isNull() ) {
-		QDomElement element = n.toElement();
-		if ( (!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot; ) {
-			QString folderName = element.attribute(&quot;folderName&quot;);
-			if (!folderName.isEmpty()) {
-				// Find a folder name:
-				QString newFolderName = BasketFactory::newFolderName();
-				folderMap[folderName] = newFolderName;
-				// Reserve the folder name:
-				QDir dir;
-				dir.mkdir(Global::basketsFolder() + newFolderName);
-				// Rename the merged tag ids:
-//				if (mergedStates.count() &gt; 0) {
-					renameMergedStatesAndBasketIcon(extractionFolder + &quot;baskets/&quot; + folderName + &quot;.basket&quot;, mergedStates, extractionFolder);
-//				}
-				// Child baskets:
-				QDomNode node = element.firstChild();
-				renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
-			}
-		}
-		n = n.nextSibling();
-	}
+    QDomNode n = basketNode;
+    while (! n.isNull()) {
+        QDomElement element = n.toElement();
+        if ((!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot;) {
+            QString folderName = element.attribute(&quot;folderName&quot;);
+            if (!folderName.isEmpty()) {
+                // Find a folder name:
+                QString newFolderName = BasketFactory::newFolderName();
+                folderMap[folderName] = newFolderName;
+                // Reserve the folder name:
+                QDir dir;
+                dir.mkdir(Global::basketsFolder() + newFolderName);
+                // Rename the merged tag ids:
+//              if (mergedStates.count() &gt; 0) {
+                renameMergedStatesAndBasketIcon(extractionFolder + &quot;baskets/&quot; + folderName + &quot;.basket&quot;, mergedStates, extractionFolder);
+//              }
+                // Child baskets:
+                QDomNode node = element.firstChild();
+                renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
+            }
+        }
+        n = n.nextSibling();
+    }
 }
 
 void Archive::renameMergedStatesAndBasketIcon(const QString &amp;fullPath, QMap&lt;QString, QString&gt; &amp;mergedStates, const QString &amp;extractionFolder)
 {
-	QDomDocument *doc = XMLWork::openFile(&quot;basket&quot;, fullPath);
-	if (doc == 0)
-		return;
-	QDomElement docElem = doc-&gt;documentElement();
-	QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
-	importBasketIcon(properties, extractionFolder);
-	QDomElement notes = XMLWork::getElement(docElem, &quot;notes&quot;);
-	if (mergedStates.count() &gt; 0)
-		renameMergedStates(notes, mergedStates);
-	Basket::safelySaveToFile(fullPath, /*&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + */doc-&gt;toString());
+    QDomDocument *doc = XMLWork::openFile(&quot;basket&quot;, fullPath);
+    if (doc == 0)
+        return;
+    QDomElement docElem = doc-&gt;documentElement();
+    QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
+    importBasketIcon(properties, extractionFolder);
+    QDomElement notes = XMLWork::getElement(docElem, &quot;notes&quot;);
+    if (mergedStates.count() &gt; 0)
+        renameMergedStates(notes, mergedStates);
+    Basket::safelySaveToFile(fullPath, /*&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + */doc-&gt;toString());
 }
 
 void Archive::importBasketIcon(QDomElement properties, const QString &amp;extractionFolder)
 {
-	QString iconName = XMLWork::getElementText(properties, &quot;icon&quot;);
-	if (!iconName.isEmpty() &amp;&amp; iconName != &quot;basket&quot;) {
-		QPixmap icon = KIconLoader::global()-&gt;loadIcon(
-            iconName, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
-            QStringList(), 0L, /*canReturnNull=*/true
-            );
-		// The icon does not exists on that computer, import it:
-		if (icon.isNull()) {
-			QDir dir;
-			dir.mkdir(Global::savesFolder() + &quot;basket-icons/&quot;);
-			FormatImporter copier; // Only used to copy files synchronously
-			// Of the icon path was eg. &quot;/home/seb/icon.png&quot;, it was exported as &quot;basket-icons/_home_seb_icon.png&quot;.
-			// So we need to copy that image to &quot;~/.kde/share/apps/basket/basket-icons/icon.png&quot;:
-			int slashIndex = iconName.lastIndexOf('/');
-			QString iconFileName = (slashIndex &lt; 0 ? iconName : iconName.right(slashIndex - 2));
-			QString source       = extractionFolder + &quot;basket-icons/&quot; + iconName.replace('/', '_');
-			QString destination = Global::savesFolder() + &quot;basket-icons/&quot; + iconFileName;
-			if (!dir.exists(destination))
-				copier.copyFolder(source, destination);
-			// Replace the emblem path in the tags.xml copy:
-			QDomElement iconElement = XMLWork::getElement(properties, &quot;icon&quot;);
-			properties.removeChild(iconElement);
-			QDomDocument document = properties.ownerDocument();
-			XMLWork::addElement(document, properties, &quot;icon&quot;, destination);
-		}
-	}
+    QString iconName = XMLWork::getElementText(properties, &quot;icon&quot;);
+    if (!iconName.isEmpty() &amp;&amp; iconName != &quot;basket&quot;) {
+        QPixmap icon = KIconLoader::global()-&gt;loadIcon(
+                           iconName, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
+                           QStringList(), 0L, /*canReturnNull=*/true
+                       );
+        // The icon does not exists on that computer, import it:
+        if (icon.isNull()) {
+            QDir dir;
+            dir.mkdir(Global::savesFolder() + &quot;basket-icons/&quot;);
+            FormatImporter copier; // Only used to copy files synchronously
+            // Of the icon path was eg. &quot;/home/seb/icon.png&quot;, it was exported as &quot;basket-icons/_home_seb_icon.png&quot;.
+            // So we need to copy that image to &quot;~/.kde/share/apps/basket/basket-icons/icon.png&quot;:
+            int slashIndex = iconName.lastIndexOf('/');
+            QString iconFileName = (slashIndex &lt; 0 ? iconName : iconName.right(slashIndex - 2));
+            QString source       = extractionFolder + &quot;basket-icons/&quot; + iconName.replace('/', '_');
+            QString destination = Global::savesFolder() + &quot;basket-icons/&quot; + iconFileName;
+            if (!dir.exists(destination))
+                copier.copyFolder(source, destination);
+            // Replace the emblem path in the tags.xml copy:
+            QDomElement iconElement = XMLWork::getElement(properties, &quot;icon&quot;);
+            properties.removeChild(iconElement);
+            QDomDocument document = properties.ownerDocument();
+            XMLWork::addElement(document, properties, &quot;icon&quot;, destination);
+        }
+    }
 }
 
 void Archive::renameMergedStates(QDomNode notes, QMap&lt;QString, QString&gt; &amp;mergedStates)
 {
-	QDomNode n = notes.firstChild();
-	while ( ! n.isNull() ) {
-		QDomElement element = n.toElement();
-		if (!element.isNull()) {
-			if (element.tagName() == &quot;group&quot; ) {
-				renameMergedStates(n, mergedStates);
-			} else if (element.tagName() == &quot;note&quot;) {
-				QString tags = XMLWork::getElementText(element, &quot;tags&quot;);
-				if (!tags.isEmpty()) {
-					QStringList tagNames = tags.split(&quot;;&quot;);
-					for (QStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) {
-						QString &amp;tag = *it;
-						if (mergedStates.contains(tag)) {
-							tag = mergedStates[tag];
-						}
-					}
-					QString newTags = tagNames.join(&quot;;&quot;);
-					QDomElement tagsElement = XMLWork::getElement(element, &quot;tags&quot;);
-					element.removeChild(tagsElement);
-					QDomDocument document = element.ownerDocument();
-					XMLWork::addElement(document, element, &quot;tags&quot;, newTags);
-				}
-			}
-		}
-		n = n.nextSibling();
-	}
+    QDomNode n = notes.firstChild();
+    while (! n.isNull()) {
+        QDomElement element = n.toElement();
+        if (!element.isNull()) {
+            if (element.tagName() == &quot;group&quot;) {
+                renameMergedStates(n, mergedStates);
+            } else if (element.tagName() == &quot;note&quot;) {
+                QString tags = XMLWork::getElementText(element, &quot;tags&quot;);
+                if (!tags.isEmpty()) {
+                    QStringList tagNames = tags.split(&quot;;&quot;);
+                    for (QStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) {
+                        QString &amp;tag = *it;
+                        if (mergedStates.contains(tag)) {
+                            tag = mergedStates[tag];
+                        }
+                    }
+                    QString newTags = tagNames.join(&quot;;&quot;);
+                    QDomElement tagsElement = XMLWork::getElement(element, &quot;tags&quot;);
+                    element.removeChild(tagsElement);
+                    QDomDocument document = element.ownerDocument();
+                    XMLWork::addElement(document, element, &quot;tags&quot;, newTags);
+                }
+            }
+        }
+        n = n.nextSibling();
+    }
 }
 
 void Archive::loadExtractedBaskets(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, Basket *parent)
 {
-	bool basketSetAsCurrent = (parent != 0);
-	QDomNode n = basketNode;
-	while ( ! n.isNull() ) {
-		QDomElement element = n.toElement();
-		if ( (!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot; ) {
-			QString folderName = element.attribute(&quot;folderName&quot;);
-			if (!folderName.isEmpty()) {
-				// Move the basket folder to its destination, while renaming it uniquely:
-				QString newFolderName = folderMap[folderName];
-				FormatImporter copier;
-				// The folder has been &quot;reserved&quot; by creating it. Avoid asking the user to override:
-				QDir dir;
-				dir.rmdir(Global::basketsFolder() + newFolderName);
-				copier.moveFolder(extractionFolder + &quot;baskets/&quot; + folderName, Global::basketsFolder() + newFolderName);
-				// Append and load the basket in the tree:
-				Basket *basket = Global::bnpView-&gt;loadBasket(newFolderName);
-				BasketListViewItem *basketItem = Global::bnpView-&gt;appendBasket(basket, (basket &amp;&amp; parent ? Global::bnpView-&gt;listViewItemForBasket(parent) : 0));
-				basketItem-&gt;setExpanded(!XMLWork::trueOrFalse(element.attribute(&quot;folded&quot;, &quot;false&quot;), false));
-				QDomElement properties = XMLWork::getElement(element, &quot;properties&quot;);
-				importBasketIcon(properties, extractionFolder); // Rename the icon fileName if necessary
-				basket-&gt;loadProperties(properties);
-				// Open the first basket of the archive:
-				if (!basketSetAsCurrent) {
-					Global::bnpView-&gt;setCurrentBasket(basket);
-					basketSetAsCurrent = true;
-				}
-				QDomNode node = element.firstChild();
-				loadExtractedBaskets(extractionFolder, node, folderMap, basket);
-			}
-		}
-		n = n.nextSibling();
-	}
+    bool basketSetAsCurrent = (parent != 0);
+    QDomNode n = basketNode;
+    while (! n.isNull()) {
+        QDomElement element = n.toElement();
+        if ((!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot;) {
+            QString folderName = element.attribute(&quot;folderName&quot;);
+            if (!folderName.isEmpty()) {
+                // Move the basket folder to its destination, while renaming it uniquely:
+                QString newFolderName = folderMap[folderName];
+                FormatImporter copier;
+                // The folder has been &quot;reserved&quot; by creating it. Avoid asking the user to override:
+                QDir dir;
+                dir.rmdir(Global::basketsFolder() + newFolderName);
+                copier.moveFolder(extractionFolder + &quot;baskets/&quot; + folderName, Global::basketsFolder() + newFolderName);
+                // Append and load the basket in the tree:
+                Basket *basket = Global::bnpView-&gt;loadBasket(newFolderName);
+                BasketListViewItem *basketItem = Global::bnpView-&gt;appendBasket(basket, (basket &amp;&amp; parent ? Global::bnpView-&gt;listViewItemForBasket(parent) : 0));
+                basketItem-&gt;setExpanded(!XMLWork::trueOrFalse(element.attribute(&quot;folded&quot;, &quot;false&quot;), false));
+                QDomElement properties = XMLWork::getElement(element, &quot;properties&quot;);
+                importBasketIcon(properties, extractionFolder); // Rename the icon fileName if necessary
+                basket-&gt;loadProperties(properties);
+                // Open the first basket of the archive:
+                if (!basketSetAsCurrent) {
+                    Global::bnpView-&gt;setCurrentBasket(basket);
+                    basketSetAsCurrent = true;
+                }
+                QDomNode node = element.firstChild();
+                loadExtractedBaskets(extractionFolder, node, folderMap, basket);
+            }
+        }
+        n = n.nextSibling();
+    }
 }</diff>
      <filename>src/archive.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -38,22 +38,22 @@ class KProgress;
  */
 class Archive
 {
-  public:
-	static void save(Basket *basket, bool withSubBaskets, const QString &amp;destination);
-	static void open(const QString &amp;path);
-  private:
-	// Convenient Methods for Saving:
-	static void saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QStringList &amp;backgrounds, const QString &amp;tempFolder, QProgressBar *progress);
-	static void listUsedTags(Basket *basket, bool recursive, QList&lt;Tag*&gt; &amp;list);
-	// Convenient Methods for Loading:
-	static void renameBasketFolders(const QString &amp;extractionFolder, QMap&lt;QString, QString&gt; &amp;mergedStates);
-	static void renameBasketFolder(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, QMap&lt;QString, QString&gt; &amp;mergedStates);
-	static void renameMergedStatesAndBasketIcon(const QString &amp;fullPath, QMap&lt;QString, QString&gt; &amp;mergedStates, const QString &amp;extractionFolder);
-	static void renameMergedStates(QDomNode notes, QMap&lt;QString, QString&gt; &amp;mergedStates);
-	static void importBasketIcon(QDomElement properties, const QString &amp;extractionFolder);
-	static void loadExtractedBaskets(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, Basket *parent);
-	static void importTagEmblems(const QString &amp;extractionFolder);
-	static void importArchivedBackgroundImages(const QString &amp;extractionFolder);
+public:
+    static void save(Basket *basket, bool withSubBaskets, const QString &amp;destination);
+    static void open(const QString &amp;path);
+private:
+    // Convenient Methods for Saving:
+    static void saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QStringList &amp;backgrounds, const QString &amp;tempFolder, QProgressBar *progress);
+    static void listUsedTags(Basket *basket, bool recursive, QList&lt;Tag*&gt; &amp;list);
+    // Convenient Methods for Loading:
+    static void renameBasketFolders(const QString &amp;extractionFolder, QMap&lt;QString, QString&gt; &amp;mergedStates);
+    static void renameBasketFolder(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, QMap&lt;QString, QString&gt; &amp;mergedStates);
+    static void renameMergedStatesAndBasketIcon(const QString &amp;fullPath, QMap&lt;QString, QString&gt; &amp;mergedStates, const QString &amp;extractionFolder);
+    static void renameMergedStates(QDomNode notes, QMap&lt;QString, QString&gt; &amp;mergedStates);
+    static void importBasketIcon(QDomElement properties, const QString &amp;extractionFolder);
+    static void loadExtractedBaskets(const QString &amp;extractionFolder, QDomNode &amp;basketNode, QMap&lt;QString, QString&gt; &amp;folderMap, Basket *parent);
+    static void importTagEmblems(const QString &amp;extractionFolder);
+    static void importArchivedBackgroundImages(const QString &amp;extractionFolder);
 };
 
 #endif</diff>
      <filename>src/archive.h</filename>
    </modified>
    <modified>
      <diff>@@ -35,56 +35,56 @@
 
 BackgroundEntry::BackgroundEntry(const QString &amp;location)
 {
-	this-&gt;location = location;
-	name           = KUrl(location).fileName();
-	tiled          = false;
-	pixmap         = 0;
-	preview        = 0;
-	customersCount = 0;
+    this-&gt;location = location;
+    name           = KUrl(location).fileName();
+    tiled          = false;
+    pixmap         = 0;
+    preview        = 0;
+    customersCount = 0;
 }
 
 BackgroundEntry::~BackgroundEntry()
 {
-	delete pixmap;
-	delete preview;
+    delete pixmap;
+    delete preview;
 }
 
 /** class OpaqueBackgroundEntry: */
 
 OpaqueBackgroundEntry::OpaqueBackgroundEntry(const QString &amp;name, const QColor &amp;color)
 {
-	this-&gt;name     = name;
-	this-&gt;color    = color;
-	pixmap         = 0;
-	customersCount = 0;
+    this-&gt;name     = name;
+    this-&gt;color    = color;
+    pixmap         = 0;
+    customersCount = 0;
 }
 
 OpaqueBackgroundEntry::~OpaqueBackgroundEntry()
 {
-	delete pixmap;
+    delete pixmap;
 }
 
 /** class BackgroundManager: */
 
 BackgroundManager::BackgroundManager()
 {
-///	kDebug() &lt;&lt; &quot;BackgroundManager: Found the following background images in  &quot;;
-	QStringList directories = KGlobal::dirs()-&gt;resourceDirs(&quot;data&quot;); // eg. { &quot;/home/seb/.kde/share/apps/&quot;, &quot;/usr/share/apps/&quot; }
-	// For each folder:
-	for (QStringList::Iterator it = directories.begin(); it != directories.end(); ++it) {
-		// For each file in those directories:
-		QDir dir(*it + &quot;basket/backgrounds/&quot;, /*nameFilder=*/&quot;*.png&quot;, /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
-///		kDebug() &lt;&lt; *it + &quot;basket/backgrounds/  &quot;;
-		QStringList files = dir.entryList();
-		for (QStringList::Iterator it2 = files.begin(); it2 != files.end(); ++it2) // TODO: If an image name is present in two folders?
-			addImage(*it + &quot;basket/backgrounds/&quot; + *it2);
-	}
-
-///	kDebug() &lt;&lt; &quot;:&quot;;
-///	for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
-///		kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; (*it)-&gt;location &lt;&lt; &quot;  [ref: &quot; &lt;&lt; (*it)-&gt;name &lt;&lt; &quot;]&quot;;
-
-	connect( &amp;m_garbageTimer, SIGNAL(timeout()), this, SLOT(doGarbage()) );
+/// kDebug() &lt;&lt; &quot;BackgroundManager: Found the following background images in  &quot;;
+    QStringList directories = KGlobal::dirs()-&gt;resourceDirs(&quot;data&quot;); // eg. { &quot;/home/seb/.kde/share/apps/&quot;, &quot;/usr/share/apps/&quot; }
+    // For each folder:
+    for (QStringList::Iterator it = directories.begin(); it != directories.end(); ++it) {
+        // For each file in those directories:
+        QDir dir(*it + &quot;basket/backgrounds/&quot;, /*nameFilder=*/&quot;*.png&quot;, /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
+///     kDebug() &lt;&lt; *it + &quot;basket/backgrounds/  &quot;;
+        QStringList files = dir.entryList();
+        for (QStringList::Iterator it2 = files.begin(); it2 != files.end(); ++it2) // TODO: If an image name is present in two folders?
+            addImage(*it + &quot;basket/backgrounds/&quot; + *it2);
+    }
+
+/// kDebug() &lt;&lt; &quot;:&quot;;
+/// for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
+///     kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; (*it)-&gt;location &lt;&lt; &quot;  [ref: &quot; &lt;&lt; (*it)-&gt;name &lt;&lt; &quot;]&quot;;
+
+    connect(&amp;m_garbageTimer, SIGNAL(timeout()), this, SLOT(doGarbage()));
 }
 
 BackgroundManager::~BackgroundManager()
@@ -93,303 +93,303 @@ BackgroundManager::~BackgroundManager()
 
 void BackgroundManager::addImage(const QString &amp;fullPath)
 {
-	m_backgroundsList.append(new BackgroundEntry(fullPath));
+    m_backgroundsList.append(new BackgroundEntry(fullPath));
 }
 
 BackgroundEntry* BackgroundManager::backgroundEntryFor(const QString &amp;image)
 {
-	for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
-		if ((*it)-&gt;name == image)
-			return *it;
-	return 0;
+    for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
+        if ((*it)-&gt;name == image)
+            return *it;
+    return 0;
 }
 
 OpaqueBackgroundEntry* BackgroundManager::opaqueBackgroundEntryFor(const QString &amp;image, const QColor &amp;color)
 {
-	for (OpaqueBackgroundsList::Iterator it = m_opaqueBackgroundsList.begin(); it != m_opaqueBackgroundsList.end(); ++it)
-		if ((*it)-&gt;name == image &amp;&amp; (*it)-&gt;color == color)
-			return *it;
-	return 0;
+    for (OpaqueBackgroundsList::Iterator it = m_opaqueBackgroundsList.begin(); it != m_opaqueBackgroundsList.end(); ++it)
+        if ((*it)-&gt;name == image &amp;&amp; (*it)-&gt;color == color)
+            return *it;
+    return 0;
 }
 
 bool BackgroundManager::subscribe(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
-	if (entry) {
-		// If it's the first time something subscribe to this image:
-		if (!entry-&gt;pixmap) {
-			// Try to load the pixmap:
-			entry-&gt;pixmap = new QPixmap(entry-&gt;location);
-			// Try to figure out if it's a tiled background image or not (default to NO):
-			KConfig config(entry-&gt;location + &quot;.config&quot;, KConfig::SimpleConfig);
-			KConfigGroup configGroup = config.group(&quot;BasKet Background Image Configuration&quot;);
-			entry-&gt;tiled = configGroup.readEntry(&quot;tiled&quot;, false);
-		}
-		// Return if the image loading has failed:
-		if (entry-&gt;pixmap-&gt;isNull()) {
-///			kDebug() &lt;&lt; &quot;BackgroundManager: Failed to load &quot; &lt;&lt; entry-&gt;location;
-			return false;
-		}
-		// Success: effectively subscribe:
-		++entry-&gt;customersCount;
-		return true;
-	} else {
-		// Don't exist: subscription failed:
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested unexisting image: &quot; &lt;&lt; image;
-		return false;
-	}
+    BackgroundEntry *entry = backgroundEntryFor(image);
+    if (entry) {
+        // If it's the first time something subscribe to this image:
+        if (!entry-&gt;pixmap) {
+            // Try to load the pixmap:
+            entry-&gt;pixmap = new QPixmap(entry-&gt;location);
+            // Try to figure out if it's a tiled background image or not (default to NO):
+            KConfig config(entry-&gt;location + &quot;.config&quot;, KConfig::SimpleConfig);
+            KConfigGroup configGroup = config.group(&quot;BasKet Background Image Configuration&quot;);
+            entry-&gt;tiled = configGroup.readEntry(&quot;tiled&quot;, false);
+        }
+        // Return if the image loading has failed:
+        if (entry-&gt;pixmap-&gt;isNull()) {
+///         kDebug() &lt;&lt; &quot;BackgroundManager: Failed to load &quot; &lt;&lt; entry-&gt;location;
+            return false;
+        }
+        // Success: effectively subscribe:
+        ++entry-&gt;customersCount;
+        return true;
+    } else {
+        // Don't exist: subscription failed:
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested unexisting image: &quot; &lt;&lt; image;
+        return false;
+    }
 }
 
 bool BackgroundManager::subscribe(const QString &amp;image, const QColor &amp;color)
 {
-	BackgroundEntry *backgroundEntry = backgroundEntryFor(image);
-
-	// First, if the image doesn't exist, isn't subscribed, or failed to load then we don't go further:
-	if (!backgroundEntry || !backgroundEntry-&gt;pixmap || backgroundEntry-&gt;pixmap-&gt;isNull()) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)...&quot;;
-		return false;
-	}
-
-	OpaqueBackgroundEntry *opaqueBackgroundEntry = opaqueBackgroundEntryFor(image, color);
-
-	// If this couple is requested for the first time or it haven't been subscribed for a long time enough, create it:
-	if (!opaqueBackgroundEntry) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Computing (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)...&quot;;
-		opaqueBackgroundEntry = new OpaqueBackgroundEntry(image, color);
-		opaqueBackgroundEntry-&gt;pixmap = new QPixmap(backgroundEntry-&gt;pixmap-&gt;size());
-		opaqueBackgroundEntry-&gt;pixmap-&gt;fill(color);
-		QPainter painter(opaqueBackgroundEntry-&gt;pixmap);
-		painter.drawPixmap(0, 0, *(backgroundEntry-&gt;pixmap));
-		painter.end();
-		m_opaqueBackgroundsList.append(opaqueBackgroundEntry);
-	}
-
-	// We are now sure the entry exist, do the subscription:
-	++opaqueBackgroundEntry-&gt;customersCount;
-	return true;
+    BackgroundEntry *backgroundEntry = backgroundEntryFor(image);
+
+    // First, if the image doesn't exist, isn't subscribed, or failed to load then we don't go further:
+    if (!backgroundEntry || !backgroundEntry-&gt;pixmap || backgroundEntry-&gt;pixmap-&gt;isNull()) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)...&quot;;
+        return false;
+    }
+
+    OpaqueBackgroundEntry *opaqueBackgroundEntry = opaqueBackgroundEntryFor(image, color);
+
+    // If this couple is requested for the first time or it haven't been subscribed for a long time enough, create it:
+    if (!opaqueBackgroundEntry) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Computing (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)...&quot;;
+        opaqueBackgroundEntry = new OpaqueBackgroundEntry(image, color);
+        opaqueBackgroundEntry-&gt;pixmap = new QPixmap(backgroundEntry-&gt;pixmap-&gt;size());
+        opaqueBackgroundEntry-&gt;pixmap-&gt;fill(color);
+        QPainter painter(opaqueBackgroundEntry-&gt;pixmap);
+        painter.drawPixmap(0, 0, *(backgroundEntry-&gt;pixmap));
+        painter.end();
+        m_opaqueBackgroundsList.append(opaqueBackgroundEntry);
+    }
+
+    // We are now sure the entry exist, do the subscription:
+    ++opaqueBackgroundEntry-&gt;customersCount;
+    return true;
 }
 
 void BackgroundManager::unsubscribe(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
+    BackgroundEntry *entry = backgroundEntryFor(image);
 
-	if (!entry) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Wanted to unsuscribe a not subscribed image: &quot; &lt;&lt; image;
-		return;
-	}
+    if (!entry) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Wanted to unsuscribe a not subscribed image: &quot; &lt;&lt; image;
+        return;
+    }
 
-	--entry-&gt;customersCount;
-	if (entry-&gt;customersCount &lt;= 0)
-		requestDelayedGarbage();
+    --entry-&gt;customersCount;
+    if (entry-&gt;customersCount &lt;= 0)
+        requestDelayedGarbage();
 }
 
 void BackgroundManager::unsubscribe(const QString &amp;image, const QColor &amp;color)
 {
-	OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
+    OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
 
-	if (!entry) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Wanted to unsuscribe a not subscribed colored image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)&quot;;
-		return;
-	}
+    if (!entry) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Wanted to unsuscribe a not subscribed colored image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)&quot;;
+        return;
+    }
 
-	--entry-&gt;customersCount;
-	if (entry-&gt;customersCount &lt;= 0)
-		requestDelayedGarbage();
+    --entry-&gt;customersCount;
+    if (entry-&gt;customersCount &lt;= 0)
+        requestDelayedGarbage();
 }
 
 QPixmap* BackgroundManager::pixmap(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
+    BackgroundEntry *entry = backgroundEntryFor(image);
 
-	if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: &quot; &lt;&lt; image;
-		return 0;
-	}
+    if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: &quot; &lt;&lt; image;
+        return 0;
+    }
 
-	return entry-&gt;pixmap;
+    return entry-&gt;pixmap;
 }
 
 QPixmap* BackgroundManager::opaquePixmap(const QString &amp;image, const QColor &amp;color)
 {
-	OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
+    OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
 
-	if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed colored image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)&quot;;
-		return 0;
-	}
+    if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed colored image: (&quot; &lt;&lt; image &lt;&lt; &quot;,&quot; &lt;&lt; color.name() &lt;&lt; &quot;)&quot;;
+        return 0;
+    }
 
-	return entry-&gt;pixmap;
+    return entry-&gt;pixmap;
 }
 
 bool BackgroundManager::tiled(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
+    BackgroundEntry *entry = backgroundEntryFor(image);
 
-	if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: &quot; &lt;&lt; image;
-		return false;
-	}
+    if (!entry || !entry-&gt;pixmap || entry-&gt;pixmap-&gt;isNull()) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested an unexisting or unsubscribed image: &quot; &lt;&lt; image;
+        return false;
+    }
 
-	return entry-&gt;tiled;
+    return entry-&gt;tiled;
 }
 
 bool BackgroundManager::exists(const QString &amp;image)
 {
-	for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
-		if ((*it)-&gt;name == image)
-			return true;
-	return false;
+    for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
+        if ((*it)-&gt;name == image)
+            return true;
+    return false;
 }
 
 QStringList BackgroundManager::imageNames()
 {
-	QStringList list;
-	for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
-		list.append((*it)-&gt;name);
-	return list;
+    QStringList list;
+    for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
+        list.append((*it)-&gt;name);
+    return list;
 }
 
 QPixmap* BackgroundManager::preview(const QString &amp;image)
 {
-	static const int    MAX_WIDTH  = 100;
-	static const int    MAX_HEIGHT = 75;
-	static const QColor PREVIEW_BG = Qt::white;
-
-	BackgroundEntry *entry = backgroundEntryFor(image);
-
-	if (!entry) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Requested the preview of an unexisting image: &quot; &lt;&lt; image;
-		return false;
-	}
-
-	// The easiest way: already computed:
-	if (entry-&gt;preview)
-		return entry-&gt;preview;
-
-	// Then, try to load the preview from file:
-	QString previewPath = KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot; + entry-&gt;name);
-	QPixmap *previewPixmap = new QPixmap(previewPath);
-	// Success:
-	if (!previewPixmap-&gt;isNull()) {
-///		kDebug() &lt;&lt; &quot;BackgroundManager: Loaded image preview for &quot; &lt;&lt; entry-&gt;location &lt;&lt; &quot; from file &quot; &lt;&lt; previewPath;
-		entry-&gt;preview = previewPixmap;
-		return entry-&gt;preview;
-	}
-
-	// We failed? Then construct it:
-	// Note: if a preview is requested, it's because the user is currently choosing an image.
-	// Since we need that image to create the preview, we keep the image in memory.
-	// Then, it will already be loaded when user press [OK] in the background image chooser.
-	// BUT we also delay a garbage because we don't want EVERY images to be loaded if the user use only a few of them, of course:
-
-	// Already used? Good: we don't have to load it...
-	if (!entry-&gt;pixmap) {
-		// Note: it's a code duplication from BackgroundManager::subscribe(const QString &amp;image),
-		// Because, as we are loading the pixmap we ALSO need to know if it's a tile or not, in case that image will soon be used (and not destroyed by the garbager):
-		entry-&gt;pixmap = new QPixmap(entry-&gt;location);
-		// Try to figure out if it's a tiled background image or not (default to NO):
-		KConfig config(entry-&gt;location + &quot;.config&quot;);
-		KConfigGroup configGroup = config.group(&quot;BasKet Background Image Configuration&quot;);
-		entry-&gt;tiled = configGroup.readEntry(&quot;tiled&quot;, false);
-	}
-
-	// The image cannot be loaded, we failed:
-	if (entry-&gt;pixmap-&gt;isNull())
-		return 0;
-
-	// Good that we are still alive: entry-&gt;pixmap contains the pixmap to rescale down for the preview:
-	// Compute new size:
-	int width  = entry-&gt;pixmap-&gt;width();
-	int height = entry-&gt;pixmap-&gt;height();
-	if (width &gt; MAX_WIDTH) {
-		height = height * MAX_WIDTH / width;
-		width  = MAX_WIDTH;
-	}
-	if (height &gt; MAX_HEIGHT) {
-		width  = width * MAX_HEIGHT / height;
-		height = MAX_HEIGHT;
-	}
-	// And create the resulting pixmap:
-	QPixmap *result = new QPixmap(width, height);
-	result-&gt;fill(PREVIEW_BG);
-	QImage imageToScale = entry-&gt;pixmap-&gt;toImage();
-	QPixmap pmScaled = QPixmap::fromImage(imageToScale.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
-	QPainter painter(result);
-	painter.drawPixmap(0, 0, pmScaled);
-	painter.end();
-
-	// Saving it to file for later:
-	QString folder = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot;);
-	result-&gt;save(folder + entry-&gt;name, &quot;PNG&quot;);
-
-	// Ouf! That's done:
-	entry-&gt;preview = result;
-	requestDelayedGarbage();
-	return entry-&gt;preview;
+    static const int    MAX_WIDTH  = 100;
+    static const int    MAX_HEIGHT = 75;
+    static const QColor PREVIEW_BG = Qt::white;
+
+    BackgroundEntry *entry = backgroundEntryFor(image);
+
+    if (!entry) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Requested the preview of an unexisting image: &quot; &lt;&lt; image;
+        return false;
+    }
+
+    // The easiest way: already computed:
+    if (entry-&gt;preview)
+        return entry-&gt;preview;
+
+    // Then, try to load the preview from file:
+    QString previewPath = KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot; + entry-&gt;name);
+    QPixmap *previewPixmap = new QPixmap(previewPath);
+    // Success:
+    if (!previewPixmap-&gt;isNull()) {
+///     kDebug() &lt;&lt; &quot;BackgroundManager: Loaded image preview for &quot; &lt;&lt; entry-&gt;location &lt;&lt; &quot; from file &quot; &lt;&lt; previewPath;
+        entry-&gt;preview = previewPixmap;
+        return entry-&gt;preview;
+    }
+
+    // We failed? Then construct it:
+    // Note: if a preview is requested, it's because the user is currently choosing an image.
+    // Since we need that image to create the preview, we keep the image in memory.
+    // Then, it will already be loaded when user press [OK] in the background image chooser.
+    // BUT we also delay a garbage because we don't want EVERY images to be loaded if the user use only a few of them, of course:
+
+    // Already used? Good: we don't have to load it...
+    if (!entry-&gt;pixmap) {
+        // Note: it's a code duplication from BackgroundManager::subscribe(const QString &amp;image),
+        // Because, as we are loading the pixmap we ALSO need to know if it's a tile or not, in case that image will soon be used (and not destroyed by the garbager):
+        entry-&gt;pixmap = new QPixmap(entry-&gt;location);
+        // Try to figure out if it's a tiled background image or not (default to NO):
+        KConfig config(entry-&gt;location + &quot;.config&quot;);
+        KConfigGroup configGroup = config.group(&quot;BasKet Background Image Configuration&quot;);
+        entry-&gt;tiled = configGroup.readEntry(&quot;tiled&quot;, false);
+    }
+
+    // The image cannot be loaded, we failed:
+    if (entry-&gt;pixmap-&gt;isNull())
+        return 0;
+
+    // Good that we are still alive: entry-&gt;pixmap contains the pixmap to rescale down for the preview:
+    // Compute new size:
+    int width  = entry-&gt;pixmap-&gt;width();
+    int height = entry-&gt;pixmap-&gt;height();
+    if (width &gt; MAX_WIDTH) {
+        height = height * MAX_WIDTH / width;
+        width  = MAX_WIDTH;
+    }
+    if (height &gt; MAX_HEIGHT) {
+        width  = width * MAX_HEIGHT / height;
+        height = MAX_HEIGHT;
+    }
+    // And create the resulting pixmap:
+    QPixmap *result = new QPixmap(width, height);
+    result-&gt;fill(PREVIEW_BG);
+    QImage imageToScale = entry-&gt;pixmap-&gt;toImage();
+    QPixmap pmScaled = QPixmap::fromImage(imageToScale.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+    QPainter painter(result);
+    painter.drawPixmap(0, 0, pmScaled);
+    painter.end();
+
+    // Saving it to file for later:
+    QString folder = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot;);
+    result-&gt;save(folder + entry-&gt;name, &quot;PNG&quot;);
+
+    // Ouf! That's done:
+    entry-&gt;preview = result;
+    requestDelayedGarbage();
+    return entry-&gt;preview;
 }
 
 QString BackgroundManager::pathForImageName(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
-	if (entry == 0)
-		return &quot;&quot;;
-	else
-		return entry-&gt;location;
+    BackgroundEntry *entry = backgroundEntryFor(image);
+    if (entry == 0)
+        return &quot;&quot;;
+    else
+        return entry-&gt;location;
 }
 
 QString BackgroundManager::previewPathForImageName(const QString &amp;image)
 {
-	BackgroundEntry *entry = backgroundEntryFor(image);
-	if (entry == 0)
-		return &quot;&quot;;
-	else {
-		QString previewPath = KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot; + entry-&gt;name);
-		QDir dir;
-		if (!dir.exists(previewPath))
-			return &quot;&quot;;
-		else
-			return previewPath;
-	}
+    BackgroundEntry *entry = backgroundEntryFor(image);
+    if (entry == 0)
+        return &quot;&quot;;
+    else {
+        QString previewPath = KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/backgrounds/previews/&quot; + entry-&gt;name);
+        QDir dir;
+        if (!dir.exists(previewPath))
+            return &quot;&quot;;
+        else
+            return previewPath;
+    }
 }
 
 void BackgroundManager::requestDelayedGarbage()
 {
-	static const int DELAY = 60/*seconds*/;
+    static const int DELAY = 60/*seconds*/;
 
-	if (!m_garbageTimer.isActive()) {
-		m_garbageTimer.setSingleShot(true);
-		m_garbageTimer.start(DELAY * 1000/*ms*/);
-	}
+    if (!m_garbageTimer.isActive()) {
+        m_garbageTimer.setSingleShot(true);
+        m_garbageTimer.start(DELAY * 1000/*ms*/);
+    }
 }
 
 void BackgroundManager::doGarbage()
 {
-///	kDebug() &lt;&lt; &quot;BackgroundManager: Doing garbage...&quot;;
-
-///	kDebug() &lt;&lt; &quot;BackgroundManager: Images:&quot;;
-	for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it) {
-		BackgroundEntry *entry = *it;
-///		kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; entry-&gt;name &lt;&lt; &quot;: used &quot; &lt;&lt; entry-&gt;customersCount &lt;&lt; &quot; times&quot;;
-		if (entry-&gt;customersCount &lt;= 0 &amp;&amp; entry-&gt;pixmap) {
-///			kDebug() &lt;&lt; &quot; [Deleted cached pixmap]&quot;;
-			delete entry-&gt;pixmap;
-			entry-&gt;pixmap = 0;
-		}
-///		kDebug();
-	}
-
-///	kDebug() &lt;&lt; &quot;BackgroundManager: Opaque Cached Images:&quot;;
-	for (OpaqueBackgroundsList::Iterator it = m_opaqueBackgroundsList.begin(); it != m_opaqueBackgroundsList.end(); ) {
-		OpaqueBackgroundEntry *entry = *it;
-///		kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; entry-&gt;name &lt;&lt; &quot;,&quot; &lt;&lt; entry-&gt;color.name() &lt;&lt; &quot;: used &quot; &lt;&lt; entry-&gt;customersCount &lt;&lt; &quot; times&quot;;
-		if (entry-&gt;customersCount &lt;= 0) {
-///			kDebug() &lt;&lt; &quot; [Deleted entry]&quot;;
-			delete entry-&gt;pixmap;
-			entry-&gt;pixmap = 0;
-			it = m_opaqueBackgroundsList.erase(it);
-		} else
-			++it;
-///		kDebug();
-	}
+/// kDebug() &lt;&lt; &quot;BackgroundManager: Doing garbage...&quot;;
+
+/// kDebug() &lt;&lt; &quot;BackgroundManager: Images:&quot;;
+    for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it) {
+        BackgroundEntry *entry = *it;
+///     kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; entry-&gt;name &lt;&lt; &quot;: used &quot; &lt;&lt; entry-&gt;customersCount &lt;&lt; &quot; times&quot;;
+        if (entry-&gt;customersCount &lt;= 0 &amp;&amp; entry-&gt;pixmap) {
+///         kDebug() &lt;&lt; &quot; [Deleted cached pixmap]&quot;;
+            delete entry-&gt;pixmap;
+            entry-&gt;pixmap = 0;
+        }
+///     kDebug();
+    }
+
+/// kDebug() &lt;&lt; &quot;BackgroundManager: Opaque Cached Images:&quot;;
+    for (OpaqueBackgroundsList::Iterator it = m_opaqueBackgroundsList.begin(); it != m_opaqueBackgroundsList.end();) {
+        OpaqueBackgroundEntry *entry = *it;
+///     kDebug() &lt;&lt; &quot;* &quot; &lt;&lt; entry-&gt;name &lt;&lt; &quot;,&quot; &lt;&lt; entry-&gt;color.name() &lt;&lt; &quot;: used &quot; &lt;&lt; entry-&gt;customersCount &lt;&lt; &quot; times&quot;;
+        if (entry-&gt;customersCount &lt;= 0) {
+///         kDebug() &lt;&lt; &quot; [Deleted entry]&quot;;
+            delete entry-&gt;pixmap;
+            entry-&gt;pixmap = 0;
+            it = m_opaqueBackgroundsList.erase(it);
+        } else
+            ++it;
+///     kDebug();
+    }
 }
 </diff>
      <filename>src/backgroundmanager.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -34,18 +34,18 @@
   */
 class BackgroundEntry
 {
-	friend class BackgroundManager;
+    friend class BackgroundManager;
 
-  protected:
-	BackgroundEntry(const QString &amp;location);
-	~BackgroundEntry();
+protected:
+    BackgroundEntry(const QString &amp;location);
+    ~BackgroundEntry();
 
-	QString  name;
-	QString  location;
-	bool     tiled;    /// &lt;&lt; Only valid after some object subscribed to this image! Because it's only read at this time.
-	QPixmap *pixmap;   /// &lt;&lt; Only valid (non-null) after some object subscribed to this image! Because it's only read at this time.
-	QPixmap *preview;  /// &lt;&lt; Only valid (non-null) after some object requested the preview.
-	int      customersCount;
+    QString  name;
+    QString  location;
+    bool     tiled;    /// &lt;&lt; Only valid after some object subscribed to this image! Because it's only read at this time.
+    QPixmap *pixmap;   /// &lt;&lt; Only valid (non-null) after some object subscribed to this image! Because it's only read at this time.
+    QPixmap *preview;  /// &lt;&lt; Only valid (non-null) after some object requested the preview.
+    int      customersCount;
 };
 
 /** A node in the list of opaque background images (with a background color applyed to an image) of BackgroundManager.
@@ -54,16 +54,16 @@ class BackgroundEntry
   */
 class OpaqueBackgroundEntry
 {
-	friend class BackgroundManager;
+    friend class BackgroundManager;
 
-  protected:
-	OpaqueBackgroundEntry(const QString &amp;name, const QColor &amp;color);
-	~OpaqueBackgroundEntry();
+protected:
+    OpaqueBackgroundEntry(const QString &amp;name, const QColor &amp;color);
+    ~OpaqueBackgroundEntry();
 
-	QString  name;
-	QColor   color;
-	QPixmap *pixmap;
-	int      customersCount;
+    QString  name;
+    QColor   color;
+    QPixmap *pixmap;
+    int      customersCount;
 };
 
 /** Manage the list of background images.
@@ -87,46 +87,46 @@ class OpaqueBackgroundEntry
   */
 class BackgroundManager : private QObject
 {
-  Q_OBJECT
-  private:
-	/// LIST OF IMAGES:
-	typedef QList&lt;BackgroundEntry*&gt;       BackgroundsList;
-	typedef QList&lt;OpaqueBackgroundEntry*&gt; OpaqueBackgroundsList;
+    Q_OBJECT
+private:
+    /// LIST OF IMAGES:
+    typedef QList&lt;BackgroundEntry*&gt;       BackgroundsList;
+    typedef QList&lt;OpaqueBackgroundEntry*&gt; OpaqueBackgroundsList;
 
-  public:
-	/// CONTRUCTOR AND DESTRUCTOR:
-	BackgroundManager();
-	~BackgroundManager();
-	/// SUBSCRIPTION TO IMAGES:
-	bool subscribe(const QString &amp;image); /// &lt;&lt; @Return true if the loading is a success. In the counter-case, calling methods below is unsafe with this @p image name.
-	bool subscribe(const QString &amp;image, const QColor &amp;color); /// &lt;&lt; Idem.
-	void unsubscribe(const QString &amp;image);
-	void unsubscribe(const QString &amp;image, const QColor &amp;color);
-	/// GETTING THE IMAGES AND PROPERTIES:
-	QPixmap* pixmap(const QString &amp;image);
-	QPixmap* opaquePixmap(const QString &amp;image, const QColor &amp;color);
-	bool tiled(const QString &amp;image);
-	/// LIST OF IMAGES AND PREVIEWS:
-	bool exists(const QString &amp;image);
-	QStringList imageNames();
-	QPixmap* preview(const QString &amp;image);
-	/// USED FOR EXPORTATION:
-	QString pathForImageName(const QString &amp;image); /// &lt;&lt; It is STRONGLY advised to not use those two methods unless it's to copy (export) the images or something like that...
-	QString previewPathForImageName(const QString &amp;image);
-	/// USED FOR IMPORTATION:
-	void addImage(const QString &amp;fullPath);
+public:
+    /// CONTRUCTOR AND DESTRUCTOR:
+    BackgroundManager();
+    ~BackgroundManager();
+    /// SUBSCRIPTION TO IMAGES:
+    bool subscribe(const QString &amp;image); /// &lt;&lt; @Return true if the loading is a success. In the counter-case, calling methods below is unsafe with this @p image name.
+    bool subscribe(const QString &amp;image, const QColor &amp;color); /// &lt;&lt; Idem.
+    void unsubscribe(const QString &amp;image);
+    void unsubscribe(const QString &amp;image, const QColor &amp;color);
+    /// GETTING THE IMAGES AND PROPERTIES:
+    QPixmap* pixmap(const QString &amp;image);
+    QPixmap* opaquePixmap(const QString &amp;image, const QColor &amp;color);
+    bool tiled(const QString &amp;image);
+    /// LIST OF IMAGES AND PREVIEWS:
+    bool exists(const QString &amp;image);
+    QStringList imageNames();
+    QPixmap* preview(const QString &amp;image);
+    /// USED FOR EXPORTATION:
+    QString pathForImageName(const QString &amp;image); /// &lt;&lt; It is STRONGLY advised to not use those two methods unless it's to copy (export) the images or something like that...
+    QString previewPathForImageName(const QString &amp;image);
+    /// USED FOR IMPORTATION:
+    void addImage(const QString &amp;fullPath);
 
-  private:
-	BackgroundEntry*       backgroundEntryFor(const QString &amp;image);
-	OpaqueBackgroundEntry* opaqueBackgroundEntryFor(const QString &amp;image, const QColor &amp;color);
+private:
+    BackgroundEntry*       backgroundEntryFor(const QString &amp;image);
+    OpaqueBackgroundEntry* opaqueBackgroundEntryFor(const QString &amp;image, const QColor &amp;color);
 
-  private:
-	BackgroundsList       m_backgroundsList;
-	OpaqueBackgroundsList m_opaqueBackgroundsList;
-	QTimer                m_garbageTimer;
-  private slots:
-	void requestDelayedGarbage();
-	void doGarbage();
+private:
+    BackgroundsList       m_backgroundsList;
+    OpaqueBackgroundsList m_opaqueBackgroundsList;
+    QTimer                m_garbageTimer;
+private slots:
+    void requestDelayedGarbage();
+    void doGarbage();
 };
 
 #endif // BACKGROUNDMANAGER_H</diff>
      <filename>src/backgroundmanager.h</filename>
    </modified>
    <modified>
      <diff>@@ -58,73 +58,73 @@ const QString backupMagicFolder = &quot;BasKet-Note-Pads_Backup&quot;;
 /** class BackupDialog: */
 
 BackupDialog::BackupDialog(QWidget *parent, const char *name)
-     : KDialog(parent)
+        : KDialog(parent)
 {
-	setObjectName(name);
-	setModal(true);
-	setCaption(i18n(&quot;Backup &amp; Restore&quot;));
-	setButtons(KDialog::Close);
-	setDefaultButton(KDialog::Close);
-	showButtonSeparator(false);
-
-	KVBox *page  = new KVBox(this);
-	setMainWidget(page);
-
-//	page-&gt;setSpacing(spacingHint());
-
-	QString savesFolder = Global::savesFolder();
-	savesFolder = savesFolder.left(savesFolder.length() - 1); // savesFolder ends with &quot;/&quot;
-
-	QGroupBox *folderGroup = new QGroupBox(i18n(&quot;Save Folder&quot;), page);
-	QVBoxLayout* folderGroupLayout = new QVBoxLayout;
-	folderGroup-&gt;setLayout(folderGroupLayout);
-	folderGroupLayout-&gt;addWidget(new QLabel(&quot;&lt;qt&gt;&lt;nobr&gt;&quot; + i18n(&quot;Your baskets are currently stored in that folder:&lt;br&gt;&lt;b&gt;%1&lt;/b&gt;&quot;,savesFolder), folderGroup));
-	QWidget *folderWidget = new QWidget;
-	folderGroupLayout-&gt;addWidget(folderWidget);
-
-	QHBoxLayout *folderLayout = new QHBoxLayout(folderWidget);
-        folderLayout-&gt;setContentsMargins(0, 0, 0, 0);
-
-	QPushButton *moveFolder = new QPushButton(i18n(&quot;&amp;Move to Another Folder...&quot;),      folderWidget);
-	QPushButton *useFolder  = new QPushButton(i18n(&quot;&amp;Use Another Existing Folder...&quot;), folderWidget);
-	HelpLabel *helpLabel = new HelpLabel(i18n(&quot;Why to do that?&quot;), i18n(
-		&quot;&lt;p&gt;You can move the folder where %1 store your baskets to:&lt;/p&gt;&lt;ul&gt;&quot;
-		&quot;&lt;li&gt;Store your baskets in a visible place in your home folder, like ~/Notes or ~/Baskets, so you can manually backup them when you want.&lt;/li&gt;&quot;
-		&quot;&lt;li&gt;Store your baskets on a server to share them between two computers.&lt;br&gt;&quot;
-		&quot;In this case, mount the shared-folder to the local file system and ask %1 to use that mount point.&lt;br&gt;&quot;
-		&quot;Warning: you should not run %1 at the same time on both computers, or you risk to loss data while the two applications are desynced.&lt;/li&gt;&quot;
-		&quot;&lt;/ul&gt;&lt;p&gt;Please remember that you should not change the content of that folder manually (eg. adding a file in a basket folder will not add that file to the basket).&lt;/p&gt;&quot;,
-			KGlobal::mainComponent().aboutData()-&gt;programName()),
-		folderWidget);
-	folderLayout-&gt;addWidget(moveFolder);
-	folderLayout-&gt;addWidget(useFolder);
-	folderLayout-&gt;addWidget(helpLabel);
-	folderLayout-&gt;addStretch();
-	connect( moveFolder, SIGNAL(clicked()), this, SLOT(moveToAnotherFolder())      );
-	connect( useFolder,  SIGNAL(clicked()), this, SLOT(useAnotherExistingFolder()) );
-
-	QGroupBox *backupGroup = new QGroupBox(i18n(&quot;Backups&quot;), page);
-	QVBoxLayout* backupGroupLayout = new QVBoxLayout;
-	backupGroup-&gt;setLayout(backupGroupLayout);
-	QWidget *backupWidget = new QWidget;
-	backupGroupLayout-&gt;addWidget(backupWidget);
-
-	QHBoxLayout *backupLayout = new QHBoxLayout(backupWidget);
-        backupLayout-&gt;setContentsMargins(0, 0, 0, 0);
-
-	QPushButton *backupButton  = new QPushButton(i18n(&quot;&amp;Backup...&quot;),           backupWidget);
-	QPushButton *restoreButton = new QPushButton(i18n(&quot;&amp;Restore a Backup...&quot;), backupWidget);
-	m_lastBackup = new QLabel(&quot;&quot;, backupWidget);
-	backupLayout-&gt;addWidget(backupButton);
-	backupLayout-&gt;addWidget(restoreButton);
-	backupLayout-&gt;addWidget(m_lastBackup);
-	backupLayout-&gt;addStretch();
-	connect( backupButton,  SIGNAL(clicked()), this, SLOT(backup())  );
-	connect( restoreButton, SIGNAL(clicked()), this, SLOT(restore()) );
-
-	populateLastBackup();
-
-	(new QWidget(page))-&gt;setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    setObjectName(name);
+    setModal(true);
+    setCaption(i18n(&quot;Backup &amp; Restore&quot;));
+    setButtons(KDialog::Close);
+    setDefaultButton(KDialog::Close);
+    showButtonSeparator(false);
+
+    KVBox *page  = new KVBox(this);
+    setMainWidget(page);
+
+//  page-&gt;setSpacing(spacingHint());
+
+    QString savesFolder = Global::savesFolder();
+    savesFolder = savesFolder.left(savesFolder.length() - 1); // savesFolder ends with &quot;/&quot;
+
+    QGroupBox *folderGroup = new QGroupBox(i18n(&quot;Save Folder&quot;), page);
+    QVBoxLayout* folderGroupLayout = new QVBoxLayout;
+    folderGroup-&gt;setLayout(folderGroupLayout);
+    folderGroupLayout-&gt;addWidget(new QLabel(&quot;&lt;qt&gt;&lt;nobr&gt;&quot; + i18n(&quot;Your baskets are currently stored in that folder:&lt;br&gt;&lt;b&gt;%1&lt;/b&gt;&quot;, savesFolder), folderGroup));
+    QWidget *folderWidget = new QWidget;
+    folderGroupLayout-&gt;addWidget(folderWidget);
+
+    QHBoxLayout *folderLayout = new QHBoxLayout(folderWidget);
+    folderLayout-&gt;setContentsMargins(0, 0, 0, 0);
+
+    QPushButton *moveFolder = new QPushButton(i18n(&quot;&amp;Move to Another Folder...&quot;),      folderWidget);
+    QPushButton *useFolder  = new QPushButton(i18n(&quot;&amp;Use Another Existing Folder...&quot;), folderWidget);
+    HelpLabel *helpLabel = new HelpLabel(i18n(&quot;Why to do that?&quot;), i18n(
+                                             &quot;&lt;p&gt;You can move the folder where %1 store your baskets to:&lt;/p&gt;&lt;ul&gt;&quot;
+                                             &quot;&lt;li&gt;Store your baskets in a visible place in your home folder, like ~/Notes or ~/Baskets, so you can manually backup them when you want.&lt;/li&gt;&quot;
+                                             &quot;&lt;li&gt;Store your baskets on a server to share them between two computers.&lt;br&gt;&quot;
+                                             &quot;In this case, mount the shared-folder to the local file system and ask %1 to use that mount point.&lt;br&gt;&quot;
+                                             &quot;Warning: you should not run %1 at the same time on both computers, or you risk to loss data while the two applications are desynced.&lt;/li&gt;&quot;
+                                             &quot;&lt;/ul&gt;&lt;p&gt;Please remember that you should not change the content of that folder manually (eg. adding a file in a basket folder will not add that file to the basket).&lt;/p&gt;&quot;,
+                                             KGlobal::mainComponent().aboutData()-&gt;programName()),
+                                         folderWidget);
+    folderLayout-&gt;addWidget(moveFolder);
+    folderLayout-&gt;addWidget(useFolder);
+    folderLayout-&gt;addWidget(helpLabel);
+    folderLayout-&gt;addStretch();
+    connect(moveFolder, SIGNAL(clicked()), this, SLOT(moveToAnotherFolder()));
+    connect(useFolder,  SIGNAL(clicked()), this, SLOT(useAnotherExistingFolder()));
+
+    QGroupBox *backupGroup = new QGroupBox(i18n(&quot;Backups&quot;), page);
+    QVBoxLayout* backupGroupLayout = new QVBoxLayout;
+    backupGroup-&gt;setLayout(backupGroupLayout);
+    QWidget *backupWidget = new QWidget;
+    backupGroupLayout-&gt;addWidget(backupWidget);
+
+    QHBoxLayout *backupLayout = new QHBoxLayout(backupWidget);
+    backupLayout-&gt;setContentsMargins(0, 0, 0, 0);
+
+    QPushButton *backupButton  = new QPushButton(i18n(&quot;&amp;Backup...&quot;),           backupWidget);
+    QPushButton *restoreButton = new QPushButton(i18n(&quot;&amp;Restore a Backup...&quot;), backupWidget);
+    m_lastBackup = new QLabel(&quot;&quot;, backupWidget);
+    backupLayout-&gt;addWidget(backupButton);
+    backupLayout-&gt;addWidget(restoreButton);
+    backupLayout-&gt;addWidget(m_lastBackup);
+    backupLayout-&gt;addStretch();
+    connect(backupButton,  SIGNAL(clicked()), this, SLOT(backup()));
+    connect(restoreButton, SIGNAL(clicked()), this, SLOT(restore()));
+
+    populateLastBackup();
+
+    (new QWidget(page))-&gt;setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 }
 
 BackupDialog::~BackupDialog()
@@ -133,190 +133,190 @@ BackupDialog::~BackupDialog()
 
 void BackupDialog::populateLastBackup()
 {
-	QString lastBackupText = i18n(&quot;Last backup: never&quot;);
-	if (Settings::lastBackup().isValid())
-		lastBackupText = i18n(&quot;Last backup: %1&quot;,Settings::lastBackup().toString(Qt::LocalDate));
+    QString lastBackupText = i18n(&quot;Last backup: never&quot;);
+    if (Settings::lastBackup().isValid())
+        lastBackupText = i18n(&quot;Last backup: %1&quot;, Settings::lastBackup().toString(Qt::LocalDate));
 
-	m_lastBackup-&gt;setText(lastBackupText);
+    m_lastBackup-&gt;setText(lastBackupText);
 }
 
 void BackupDialog::moveToAnotherFolder()
 {
-	KUrl selectedURL = KDirSelectDialog::selectDirectory(
-		/*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
-		/*caption=*/i18n(&quot;Choose a Folder Where to Move Baskets&quot;));
-
-	if (!selectedURL.isEmpty()) {
-		QString folder = selectedURL.path();
-		QDir dir(folder);
-		// The folder should not exists, or be empty (because KDirSelectDialog will likely create it anyway):
-		if (dir.exists()) {
-			// Get the content of the folder:
-			QStringList content = dir.entryList();
-			if (content.count() &gt; 2) { // &quot;.&quot; and &quot;..&quot;
-				int result = KMessageBox::questionYesNo(
-					0,
-					&quot;&lt;qt&gt;&quot; + i18n(&quot;The folder &lt;b&gt;%1&lt;/b&gt; is not empty. Do you want to override it?&quot;, folder),
-					i18n(&quot;Override Folder?&quot;),
-					KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
-				);
-				if (result == KMessageBox::No)
-					return;
-			}
-			Tools::deleteRecursively(folder);
-		}
-		FormatImporter copier;
-		copier.moveFolder(Global::savesFolder(), folder);
-		Backup::setFolderAndRestart(folder, i18n(&quot;Your baskets have been successfully moved to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
-	}
+    KUrl selectedURL = KDirSelectDialog::selectDirectory(
+                           /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
+                           /*caption=*/i18n(&quot;Choose a Folder Where to Move Baskets&quot;));
+
+    if (!selectedURL.isEmpty()) {
+        QString folder = selectedURL.path();
+        QDir dir(folder);
+        // The folder should not exists, or be empty (because KDirSelectDialog will likely create it anyway):
+        if (dir.exists()) {
+            // Get the content of the folder:
+            QStringList content = dir.entryList();
+            if (content.count() &gt; 2) { // &quot;.&quot; and &quot;..&quot;
+                int result = KMessageBox::questionYesNo(
+                                 0,
+                                 &quot;&lt;qt&gt;&quot; + i18n(&quot;The folder &lt;b&gt;%1&lt;/b&gt; is not empty. Do you want to override it?&quot;, folder),
+                                 i18n(&quot;Override Folder?&quot;),
+                                 KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
+                             );
+                if (result == KMessageBox::No)
+                    return;
+            }
+            Tools::deleteRecursively(folder);
+        }
+        FormatImporter copier;
+        copier.moveFolder(Global::savesFolder(), folder);
+        Backup::setFolderAndRestart(folder, i18n(&quot;Your baskets have been successfully moved to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
+    }
 }
 
 void BackupDialog::useAnotherExistingFolder()
 {
-	KUrl selectedURL = KDirSelectDialog::selectDirectory(
-		/*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
-		/*caption=*/i18n(&quot;Choose an Existing Folder to Store Baskets&quot;));
+    KUrl selectedURL = KDirSelectDialog::selectDirectory(
+                           /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
+                           /*caption=*/i18n(&quot;Choose an Existing Folder to Store Baskets&quot;));
 
-	if (!selectedURL.isEmpty()) {
-		Backup::setFolderAndRestart(selectedURL.path(), i18n(&quot;Your basket save folder has been successfuly changed to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
-	}
+    if (!selectedURL.isEmpty()) {
+        Backup::setFolderAndRestart(selectedURL.path(), i18n(&quot;Your basket save folder has been successfuly changed to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
+    }
 }
 
 void BackupDialog::backup()
 {
-	QDir dir;
-
-	// Compute a default file name &amp; path (eg. &quot;Baskets_2007-01-31.tar.gz&quot;):
-	KConfig *config = KGlobal::config().data();
-	KConfigGroup configGroup(config,&quot;Backups&quot;);
-	QString folder = configGroup.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
-	QString fileName = i18np(&quot;Backup filename (without extension), %1 is the date&quot;, &quot;Baskets_%1&quot;,QDate::currentDate().toString(Qt::ISODate));
-	QString url = folder + fileName;
-
-	// Ask a file name &amp; path to the user:
-	QString filter = &quot;*.tar.gz|&quot; + i18n(&quot;Tar Archives Compressed by Gzip&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
-	QString destination = url;
-	for (bool askAgain = true; askAgain; ) {
-		// Ask:
-		destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n(&quot;Backup Baskets&quot;));
-		// User canceled?
-		if (destination.isEmpty())
-			return;
-		// File already existing? Ask for overriding:
-		if (dir.exists(destination)) {
-			int result = KMessageBox::questionYesNoCancel(
-				0,
-				&quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
-                    KUrl(destination).fileName()),
-				i18n(&quot;Override File?&quot;),
-				KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
-			);
-			if (result == KMessageBox::Cancel)
-				return;
-			else if (result == KMessageBox::Yes)
-				askAgain = false;
-		} else
-			askAgain = false;
-	}
-
-	KProgressDialog dialog(0, i18n(&quot;Backup Baskets&quot;), i18n(&quot;Backing up baskets. Please wait...&quot;));
-	dialog.setModal( true );
-	dialog.setAllowCancel(false);
-	dialog.setAutoClose(true);
-	dialog.show();
-	QProgressBar *progress = dialog.progressBar();
-	progress-&gt;setRange(0, 0/*Busy/Undefined*/);
-	progress-&gt;setValue(0);
-	progress-&gt;setTextVisible(false);
-
-	BackupThread thread(destination, Global::savesFolder());
-	thread.start();
-	while (thread.isRunning()) {
-		progress-&gt;setValue(progress-&gt;value()+1); // Or else, the animation is not played!
-		kapp-&gt;processEvents();
-		usleep(300); // Not too long because if the backup process is finished, we wait for nothing
-	}
-
-	Settings::setLastBackup(QDate::currentDate());
-	Settings::saveConfig();
-	populateLastBackup();
+    QDir dir;
+
+    // Compute a default file name &amp; path (eg. &quot;Baskets_2007-01-31.tar.gz&quot;):
+    KConfig *config = KGlobal::config().data();
+    KConfigGroup configGroup(config, &quot;Backups&quot;);
+    QString folder = configGroup.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
+    QString fileName = i18np(&quot;Backup filename (without extension), %1 is the date&quot;, &quot;Baskets_%1&quot;, QDate::currentDate().toString(Qt::ISODate));
+    QString url = folder + fileName;
+
+    // Ask a file name &amp; path to the user:
+    QString filter = &quot;*.tar.gz|&quot; + i18n(&quot;Tar Archives Compressed by Gzip&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
+    QString destination = url;
+    for (bool askAgain = true; askAgain;) {
+        // Ask:
+        destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n(&quot;Backup Baskets&quot;));
+        // User canceled?
+        if (destination.isEmpty())
+            return;
+        // File already existing? Ask for overriding:
+        if (dir.exists(destination)) {
+            int result = KMessageBox::questionYesNoCancel(
+                             0,
+                             &quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
+                                           KUrl(destination).fileName()),
+                             i18n(&quot;Override File?&quot;),
+                             KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
+                         );
+            if (result == KMessageBox::Cancel)
+                return;
+            else if (result == KMessageBox::Yes)
+                askAgain = false;
+        } else
+            askAgain = false;
+    }
+
+    KProgressDialog dialog(0, i18n(&quot;Backup Baskets&quot;), i18n(&quot;Backing up baskets. Please wait...&quot;));
+    dialog.setModal(true);
+    dialog.setAllowCancel(false);
+    dialog.setAutoClose(true);
+    dialog.show();
+    QProgressBar *progress = dialog.progressBar();
+    progress-&gt;setRange(0, 0/*Busy/Undefined*/);
+    progress-&gt;setValue(0);
+    progress-&gt;setTextVisible(false);
+
+    BackupThread thread(destination, Global::savesFolder());
+    thread.start();
+    while (thread.isRunning()) {
+        progress-&gt;setValue(progress-&gt;value() + 1); // Or else, the animation is not played!
+        kapp-&gt;processEvents();
+        usleep(300); // Not too long because if the backup process is finished, we wait for nothing
+    }
+
+    Settings::setLastBackup(QDate::currentDate());
+    Settings::saveConfig();
+    populateLastBackup();
 }
 
 void BackupDialog::restore()
 {
-	// Get last backup folder:
-	KConfig *config = KGlobal::config().data();
-	KConfigGroup configGroup(config,&quot;Backups&quot;);
-	QString folder = configGroup.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
-
-	// Ask a file name to the user:
-	QString filter = &quot;*.tar.gz|&quot; + i18n(&quot;Tar Archives Compressed by Gzip&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
-	QString path = KFileDialog::getOpenFileName(folder, filter, this, i18n(&quot;Open Basket Archive&quot;));
-	if (path.isEmpty()) // User has canceled
-		return;
-
-	// Before replacing the basket data folder with the backup content, we safely backup the current baskets to the home folder.
-	// So if the backup is corrupted or something goes wrong while restoring (power cut...) the user will be able to restore the old working data:
-	QString safetyPath = Backup::newSafetyFolder();
-	FormatImporter copier;
-	copier.moveFolder(Global::savesFolder(), safetyPath);
-
-	// Add the README file for user to cancel a bad restoration:
-	QString readmePath = safetyPath + i18n(&quot;README.txt&quot;);
-	QFile file(readmePath);
-	if (file.open(QIODevice::WriteOnly)) {
-		QTextStream stream(&amp;file);
-		stream &lt;&lt; i18n(&quot;This is a safety copy of your baskets like they were before you started to restore the backup %1.&quot;, KUrl(path).fileName()) + &quot;\n\n&quot;
-		       &lt;&lt; i18n(&quot;If the restoration was a success and you restored what you wanted to restore, you can remove this folder.&quot;) + &quot;\n\n&quot;
-		       &lt;&lt; i18n(&quot;If something went wrong during the restoration process, you can re-use this folder to store your baskets and nothing will be lost.&quot;) + &quot;\n\n&quot;
-		       &lt;&lt; i18n(&quot;Choose \&quot;Basket\&quot; -&gt; \&quot;Backup &amp; Restore...\&quot; -&gt; \&quot;Use Another Existing Folder...\&quot; and select that folder.&quot;) + &quot;\n&quot;;
-		file.close();
-	}
-
-	QString message =
-		&quot;&lt;p&gt;&lt;nobr&gt;&quot; + i18n(&quot;Restoring &lt;b&gt;%1&lt;/b&gt;. Please wait...&quot;, KUrl(path).fileName()) + &quot;&lt;/nobr&gt;&lt;/p&gt;&lt;p&gt;&quot; +
-		i18n(&quot;If something goes wrong during the restoration process, read the file &lt;b&gt;%1&lt;/b&gt;.&quot;, readmePath);
-
-	KProgressDialog *dialog = new KProgressDialog(0, i18n(&quot;Restore Baskets&quot;), message);
-	dialog-&gt;setModal(/*modal=*/true);
-	dialog-&gt;setAllowCancel(false);
-	dialog-&gt;setAutoClose(true);
-	dialog-&gt;show();
-	QProgressBar *progress = dialog-&gt;progressBar();
-	progress-&gt;setRange(0, 0/*Busy/Undefined*/);
-	progress-&gt;setValue(0);
-	progress-&gt;setTextVisible(false);
-
-	// Uncompress:
-	RestoreThread thread(path, Global::savesFolder());
-	thread.start();
-	while (thread.isRunning()) {
-		progress-&gt;setValue(progress-&gt;value()+1); // Or else, the animation is not played!
-		kapp-&gt;processEvents();
-		usleep(300); // Not too long because if the restore process is finished, we wait for nothing
-	}
-
-	dialog-&gt;hide(); // The restore is finished, do not continue to show it while telling the user the application is going to be restarted
-	delete dialog; // If we only hidden it, it reappeared just after having restored a small backup... Very strange.
-	dialog = 0;    // This was annoying since it is modal and the &quot;BasKet Note Pads is going to be restarted&quot; message was not reachable.
-	//kapp-&gt;processEvents();
-
-	// Check for errors:
-	if (!thread.success()) {
-		// Restore the old baskets:
-		QDir dir;
-		dir.remove(readmePath);
-		copier.moveFolder(safetyPath, Global::savesFolder());
-		// Tell the user:
-		KMessageBox::error(0, i18n(&quot;This archive is either not a backup of baskets or is corrupted. It cannot be imported. Your old baskets have been preserved instead.&quot;), i18n(&quot;Restore Error&quot;));
-		return;
-	}
-
-	// Note: The safety backup is not removed now because the code can has been wrong, somehow, or the user perhapse restored an older backup by error...
-	//       The restore process will not be called very often (it is possible it will only be called once or twice arround the world during the next years).
-	//       So it is rare enough to force the user to remove the safety folder, but keep him in control and let him safely recover from restoration errors.
-
-	Backup::setFolderAndRestart(Global::savesFolder()/*No change*/, i18n(&quot;Your backup has been successfuly restored to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
+    // Get last backup folder:
+    KConfig *config = KGlobal::config().data();
+    KConfigGroup configGroup(config, &quot;Backups&quot;);
+    QString folder = configGroup.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
+
+    // Ask a file name to the user:
+    QString filter = &quot;*.tar.gz|&quot; + i18n(&quot;Tar Archives Compressed by Gzip&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
+    QString path = KFileDialog::getOpenFileName(folder, filter, this, i18n(&quot;Open Basket Archive&quot;));
+    if (path.isEmpty()) // User has canceled
+        return;
+
+    // Before replacing the basket data folder with the backup content, we safely backup the current baskets to the home folder.
+    // So if the backup is corrupted or something goes wrong while restoring (power cut...) the user will be able to restore the old working data:
+    QString safetyPath = Backup::newSafetyFolder();
+    FormatImporter copier;
+    copier.moveFolder(Global::savesFolder(), safetyPath);
+
+    // Add the README file for user to cancel a bad restoration:
+    QString readmePath = safetyPath + i18n(&quot;README.txt&quot;);
+    QFile file(readmePath);
+    if (file.open(QIODevice::WriteOnly)) {
+        QTextStream stream(&amp;file);
+        stream &lt;&lt; i18n(&quot;This is a safety copy of your baskets like they were before you started to restore the backup %1.&quot;, KUrl(path).fileName()) + &quot;\n\n&quot;
+        &lt;&lt; i18n(&quot;If the restoration was a success and you restored what you wanted to restore, you can remove this folder.&quot;) + &quot;\n\n&quot;
+        &lt;&lt; i18n(&quot;If something went wrong during the restoration process, you can re-use this folder to store your baskets and nothing will be lost.&quot;) + &quot;\n\n&quot;
+        &lt;&lt; i18n(&quot;Choose \&quot;Basket\&quot; -&gt; \&quot;Backup &amp; Restore...\&quot; -&gt; \&quot;Use Another Existing Folder...\&quot; and select that folder.&quot;) + &quot;\n&quot;;
+        file.close();
+    }
+
+    QString message =
+        &quot;&lt;p&gt;&lt;nobr&gt;&quot; + i18n(&quot;Restoring &lt;b&gt;%1&lt;/b&gt;. Please wait...&quot;, KUrl(path).fileName()) + &quot;&lt;/nobr&gt;&lt;/p&gt;&lt;p&gt;&quot; +
+        i18n(&quot;If something goes wrong during the restoration process, read the file &lt;b&gt;%1&lt;/b&gt;.&quot;, readmePath);
+
+    KProgressDialog *dialog = new KProgressDialog(0, i18n(&quot;Restore Baskets&quot;), message);
+    dialog-&gt;setModal(/*modal=*/true);
+    dialog-&gt;setAllowCancel(false);
+    dialog-&gt;setAutoClose(true);
+    dialog-&gt;show();
+    QProgressBar *progress = dialog-&gt;progressBar();
+    progress-&gt;setRange(0, 0/*Busy/Undefined*/);
+    progress-&gt;setValue(0);
+    progress-&gt;setTextVisible(false);
+
+    // Uncompress:
+    RestoreThread thread(path, Global::savesFolder());
+    thread.start();
+    while (thread.isRunning()) {
+        progress-&gt;setValue(progress-&gt;value() + 1); // Or else, the animation is not played!
+        kapp-&gt;processEvents();
+        usleep(300); // Not too long because if the restore process is finished, we wait for nothing
+    }
+
+    dialog-&gt;hide(); // The restore is finished, do not continue to show it while telling the user the application is going to be restarted
+    delete dialog; // If we only hidden it, it reappeared just after having restored a small backup... Very strange.
+    dialog = 0;    // This was annoying since it is modal and the &quot;BasKet Note Pads is going to be restarted&quot; message was not reachable.
+    //kapp-&gt;processEvents();
+
+    // Check for errors:
+    if (!thread.success()) {
+        // Restore the old baskets:
+        QDir dir;
+        dir.remove(readmePath);
+        copier.moveFolder(safetyPath, Global::savesFolder());
+        // Tell the user:
+        KMessageBox::error(0, i18n(&quot;This archive is either not a backup of baskets or is corrupted. It cannot be imported. Your old baskets have been preserved instead.&quot;), i18n(&quot;Restore Error&quot;));
+        return;
+    }
+
+    // Note: The safety backup is not removed now because the code can has been wrong, somehow, or the user perhapse restored an older backup by error...
+    //       The restore process will not be called very often (it is possible it will only be called once or twice arround the world during the next years).
+    //       So it is rare enough to force the user to remove the safety folder, but keep him in control and let him safely recover from restoration errors.
+
+    Backup::setFolderAndRestart(Global::savesFolder()/*No change*/, i18n(&quot;Your backup has been successfuly restored to &lt;b&gt;%1&lt;/b&gt;. %2 is going to be restarted to take this change into account.&quot;));
 }
 
 /** class Backup: */
@@ -327,109 +327,109 @@ QString Backup::binaryPath = &quot;&quot;;
 
 void Backup::figureOutBinaryPath(const char *argv0, QApplication &amp;app)
 {
-	/*
-	   The application can be launched by two ways:
-	   - Globaly (app.applicationFilePath() is good)
-	   - In KDevelop or with an absolute path (app.applicationFilePath() is wrong)
-	   This function is called at the very start of main() so that the current directory has not been changed yet.
-
-	   Command line (argv[0])   QDir(argv[0]).canonicalPath()                   app.applicationFilePath()
-	   ======================   =============================================   =========================
-	   &quot;basket&quot;                 &quot;&quot;                                              &quot;/opt/kde3/bin/basket&quot;
-	   &quot;./src/.libs/basket&quot;     &quot;/home/seb/prog/basket/debug/src/.lib/basket&quot;   &quot;/opt/kde3/bin/basket&quot;
-	*/
-
-	binaryPath = QDir(argv0).canonicalPath();
-	if (binaryPath.isEmpty())
-		binaryPath = app.applicationFilePath();
+    /*
+       The application can be launched by two ways:
+       - Globaly (app.applicationFilePath() is good)
+       - In KDevelop or with an absolute path (app.applicationFilePath() is wrong)
+       This function is called at the very start of main() so that the current directory has not been changed yet.
+
+       Command line (argv[0])   QDir(argv[0]).canonicalPath()                   app.applicationFilePath()
+       ======================   =============================================   =========================
+       &quot;basket&quot;                 &quot;&quot;                                              &quot;/opt/kde3/bin/basket&quot;
+       &quot;./src/.libs/basket&quot;     &quot;/home/seb/prog/basket/debug/src/.lib/basket&quot;   &quot;/opt/kde3/bin/basket&quot;
+    */
+
+    binaryPath = QDir(argv0).canonicalPath();
+    if (binaryPath.isEmpty())
+        binaryPath = app.applicationFilePath();
 }
 
 void Backup::setFolderAndRestart(const QString &amp;folder, const QString &amp;message)
 {
-	// Set the folder:
-	Settings::setDataFolder(folder);
-	Settings::saveConfig();
-
-	// Rassure the user that the application main window disapearition is not a crash, but a normal restart.
-	// This is important for users to trust the application in such a critical phase and understands what's happening:
-	KMessageBox::information(
-		0,
-		&quot;&lt;qt&gt;&quot; + message.arg(
-			(folder.endsWith(&quot;/&quot;) ? folder.left(folder.length() - 1) : folder),
-			KGlobal::mainComponent().aboutData()-&gt;programName()),
-		i18n(&quot;Restart&quot;)
-	);
-
-	// Restart the application:
-	KRun::runCommand(binaryPath, KGlobal::mainComponent().aboutData()-&gt;programName(), KGlobal::mainComponent().aboutData()-&gt;programName(),0);
-	exit(0);
+    // Set the folder:
+    Settings::setDataFolder(folder);
+    Settings::saveConfig();
+
+    // Rassure the user that the application main window disapearition is not a crash, but a normal restart.
+    // This is important for users to trust the application in such a critical phase and understands what's happening:
+    KMessageBox::information(
+        0,
+        &quot;&lt;qt&gt;&quot; + message.arg(
+            (folder.endsWith(&quot;/&quot;) ? folder.left(folder.length() - 1) : folder),
+            KGlobal::mainComponent().aboutData()-&gt;programName()),
+        i18n(&quot;Restart&quot;)
+    );
+
+    // Restart the application:
+    KRun::runCommand(binaryPath, KGlobal::mainComponent().aboutData()-&gt;programName(), KGlobal::mainComponent().aboutData()-&gt;programName(), 0);
+    exit(0);
 }
 
 QString Backup::newSafetyFolder()
 {
-	QDir dir;
-	QString fullPath;
+    QDir dir;
+    QString fullPath;
 
-	fullPath = QDir::homePath() + &quot;/&quot; + i18nc(&quot;Safety folder name before restoring a basket data archive&quot;, &quot;Baskets Before Restoration&quot;) + &quot;/&quot;;
-	if (!dir.exists(fullPath))
-		return fullPath;
+    fullPath = QDir::homePath() + &quot;/&quot; + i18nc(&quot;Safety folder name before restoring a basket data archive&quot;, &quot;Baskets Before Restoration&quot;) + &quot;/&quot;;
+    if (!dir.exists(fullPath))
+        return fullPath;
 
-	for (int i = 2; ; ++i) {
-		fullPath = QDir::homePath() + &quot;/&quot; + i18nc(&quot;Safety folder name before restoring a basket data archive&quot;, &quot;Baskets Before Restoration (%1)&quot;, i) + &quot;/&quot;;
-		if (!dir.exists(fullPath))
-			return fullPath;
-	}
+    for (int i = 2; ; ++i) {
+        fullPath = QDir::homePath() + &quot;/&quot; + i18nc(&quot;Safety folder name before restoring a basket data archive&quot;, &quot;Baskets Before Restoration (%1)&quot;, i) + &quot;/&quot;;
+        if (!dir.exists(fullPath))
+            return fullPath;
+    }
 
-	return &quot;&quot;;
+    return &quot;&quot;;
 }
 
 /** class BackupThread: */
 
 BackupThread::BackupThread(const QString &amp;tarFile, const QString &amp;folderToBackup)
- : m_tarFile(tarFile), m_folderToBackup(folderToBackup)
+        : m_tarFile(tarFile), m_folderToBackup(folderToBackup)
 {
 }
 
 void BackupThread::run()
 {
-	KTar tar(m_tarFile, &quot;application/x-gzip&quot;);
-	tar.open(QIODevice::WriteOnly);
-	tar.addLocalDirectory(m_folderToBackup, backupMagicFolder);
-	// KArchive does not add hidden files. Basket description files (&quot;.basket&quot;) are hidden, we add them manually:
-	QDir dir(m_folderToBackup + &quot;baskets/&quot;);
-	QStringList baskets = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
-	for (QStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it) {
-		tar.addLocalFile(
-			m_folderToBackup + &quot;baskets/&quot; + *it + &quot;/.basket&quot;,
-			backupMagicFolder + &quot;/baskets/&quot; + *it + &quot;/.basket&quot;
-		);
-	}
-	// We finished:
-	tar.close();
+    KTar tar(m_tarFile, &quot;application/x-gzip&quot;);
+    tar.open(QIODevice::WriteOnly);
+    tar.addLocalDirectory(m_folderToBackup, backupMagicFolder);
+    // KArchive does not add hidden files. Basket description files (&quot;.basket&quot;) are hidden, we add them manually:
+    QDir dir(m_folderToBackup + &quot;baskets/&quot;);
+    QStringList baskets = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
+    for (QStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it) {
+        tar.addLocalFile(
+            m_folderToBackup + &quot;baskets/&quot; + *it + &quot;/.basket&quot;,
+            backupMagicFolder + &quot;/baskets/&quot; + *it + &quot;/.basket&quot;
+        );
+    }
+    // We finished:
+    tar.close();
 }
 
 /** class RestoreThread: */
 
 RestoreThread::RestoreThread(const QString &amp;tarFile, const QString &amp;destFolder)
- : m_tarFile(tarFile), m_destFolder(destFolder)
+        : m_tarFile(tarFile), m_destFolder(destFolder)
 {
 }
 
 void RestoreThread::run()
 {
-	m_success = false;
-	KTar tar(m_tarFile, &quot;application/x-gzip&quot;);
-	tar.open(QIODevice::ReadOnly);
-	if (tar.isOpen()) {
-		const KArchiveDirectory *directory = tar.directory();
-		if (directory-&gt;entries().contains(backupMagicFolder)) {
-			const KArchiveEntry *entry = directory-&gt;entry(backupMagicFolder);
-			if (entry-&gt;isDirectory()) {
-				((const KArchiveDirectory*) entry)-&gt;copyTo(m_destFolder);
-				m_success = true;
-			}
-		}
-		tar.close();
-	}
+    m_success = false;
+    KTar tar(m_tarFile, &quot;application/x-gzip&quot;);
+    tar.open(QIODevice::ReadOnly);
+    if (tar.isOpen()) {
+        const KArchiveDirectory *directory = tar.directory();
+        if (directory-&gt;entries().contains(backupMagicFolder)) {
+            const KArchiveEntry *entry = directory-&gt;entry(backupMagicFolder);
+            if (entry-&gt;isDirectory()) {
+                ((const KArchiveDirectory*) entry)-&gt;copyTo(m_destFolder);
+                m_success = true;
+            }
+        }
+        tar.close();
+    }
 }
 </diff>
      <filename>src/backup.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -34,18 +34,18 @@
  */
 class BackupDialog : public KDialog
 {
-  Q_OBJECT
-  public:
-	BackupDialog(QWidget *parent = 0, const char *name = 0);
-	~BackupDialog();
-  private slots:
-	void moveToAnotherFolder();
-	void useAnotherExistingFolder();
-	void backup();
-	void restore();
-	void populateLastBackup();
-  private:
-	QLabel *m_lastBackup;
+    Q_OBJECT
+public:
+    BackupDialog(QWidget *parent = 0, const char *name = 0);
+    ~BackupDialog();
+private slots:
+    void moveToAnotherFolder();
+    void useAnotherExistingFolder();
+    void backup();
+    void restore();
+    void populateLastBackup();
+private:
+    QLabel *m_lastBackup;
 };
 
 /**
@@ -53,37 +53,39 @@ class BackupDialog : public KDialog
  */
 class BASKET_EXPORT Backup
 {
-  public:
-	static void figureOutBinaryPath(const char *argv0, QApplication &amp;app);
-	static void setFolderAndRestart(const QString &amp;folder, const QString &amp;message);
-	static QString newSafetyFolder();
+public:
+    static void figureOutBinaryPath(const char *argv0, QApplication &amp;app);
+    static void setFolderAndRestart(const QString &amp;folder, const QString &amp;message);
+    static QString newSafetyFolder();
 
-  private:
-	static QString binaryPath;
+private:
+    static QString binaryPath;
 };
 
 class BackupThread : public QThread
 {
-  public:
-	BackupThread(const QString &amp;tarFile, const QString &amp;folderToBackup);
-  protected:
-	virtual void run();
-  private:
-	QString m_tarFile;
-	QString m_folderToBackup;
+public:
+    BackupThread(const QString &amp;tarFile, const QString &amp;folderToBackup);
+protected:
+    virtual void run();
+private:
+    QString m_tarFile;
+    QString m_folderToBackup;
 };
 
 class RestoreThread : public QThread
 {
-  public:
-	RestoreThread(const QString &amp;tarFile, const QString &amp;destFolder);
-	inline bool success() { return m_success; }
-  protected:
-	virtual void run();
-  private:
-	QString m_tarFile;
-	QString m_destFolder;
-	bool m_success;
+public:
+    RestoreThread(const QString &amp;tarFile, const QString &amp;destFolder);
+    inline bool success() {
+        return m_success;
+    }
+protected:
+    virtual void run();
+private:
+    QString m_tarFile;
+    QString m_destFolder;
+    bool m_success;
 };
 
 #endif // BACKUP_H</diff>
      <filename>src/backup.h</filename>
    </modified>
    <modified>
      <diff>@@ -105,116 +105,115 @@
 
 NoteSelection* NoteSelection::nextStacked()
 {
-	// First, search in the childs:
-	if (firstChild){
-		if (firstChild-&gt;note &amp;&amp; firstChild-&gt;note-&gt;content())
-			return firstChild;
-		else
-			return firstChild-&gt;nextStacked();
-	}
-	// Then, in the next:
-	if (next){
-		if (next-&gt;note &amp;&amp; next-&gt;note-&gt;content())
-			return next;
-		else
-			return next-&gt;nextStacked();
-	}
-	// And finally, in the parent:
-	NoteSelection *node = parent;
-	while (node){
-		if (node-&gt;next){
-			if (node-&gt;next-&gt;note &amp;&amp; node-&gt;next-&gt;note-&gt;content())
-				return node-&gt;next;
-			else
-				return node-&gt;next-&gt;nextStacked();
-		}
-		else
-			node = node-&gt;parent;
-	}
-	// Not found:
-	return 0;
+    // First, search in the childs:
+    if (firstChild) {
+        if (firstChild-&gt;note &amp;&amp; firstChild-&gt;note-&gt;content())
+            return firstChild;
+        else
+            return firstChild-&gt;nextStacked();
+    }
+    // Then, in the next:
+    if (next) {
+        if (next-&gt;note &amp;&amp; next-&gt;note-&gt;content())
+            return next;
+        else
+            return next-&gt;nextStacked();
+    }
+    // And finally, in the parent:
+    NoteSelection *node = parent;
+    while (node) {
+        if (node-&gt;next) {
+            if (node-&gt;next-&gt;note &amp;&amp; node-&gt;next-&gt;note-&gt;content())
+                return node-&gt;next;
+            else
+                return node-&gt;next-&gt;nextStacked();
+        } else
+            node = node-&gt;parent;
+    }
+    // Not found:
+    return 0;
 }
 
 NoteSelection* NoteSelection::firstStacked()
 {
-	if (!this)
-		return 0;
+    if (!this)
+        return 0;
 
-	if (note &amp;&amp; note-&gt;content())
-		return this;
-	else
-		return nextStacked();
+    if (note &amp;&amp; note-&gt;content())
+        return this;
+    else
+        return nextStacked();
 }
 
 void NoteSelection::append(NoteSelection *node)
 {
-	if (!this || !node)
-		return;
+    if (!this || !node)
+        return;
 
-	if (firstChild) {
-		NoteSelection *last = firstChild;
-		while (last-&gt;next)
-			last = last-&gt;next;
-		last-&gt;next = node;
-	} else
-		firstChild = node;
+    if (firstChild) {
+        NoteSelection *last = firstChild;
+        while (last-&gt;next)
+            last = last-&gt;next;
+        last-&gt;next = node;
+    } else
+        firstChild = node;
 
-	while (node) {
-		node-&gt;parent = this;
-		node = node-&gt;next;
-	}
+    while (node) {
+        node-&gt;parent = this;
+        node = node-&gt;next;
+    }
 }
 
 int NoteSelection::count()
 {
-	if (!this)
-		return 0;
+    if (!this)
+        return 0;
 
-	int count = 0;
+    int count = 0;
 
-	for (NoteSelection *node = this; node; node = node-&gt;next)
-		if (node-&gt;note &amp;&amp; node-&gt;note-&gt;content())
-			++count;
-		else
-			count += node-&gt;firstChild-&gt;count();
+    for (NoteSelection *node = this; node; node = node-&gt;next)
+        if (node-&gt;note &amp;&amp; node-&gt;note-&gt;content())
+            ++count;
+        else
+            count += node-&gt;firstChild-&gt;count();
 
-	return count;
+    return count;
 }
 
 QList&lt;Note*&gt; NoteSelection::parentGroups()
 {
-	QList&lt;Note*&gt; groups;
+    QList&lt;Note*&gt; groups;
 
-	// For each note:
-	for (NoteSelection *node = firstStacked(); node; node = node-&gt;nextStacked())
-		// For each parent groups of the note:
-		for (Note *note = node-&gt;note-&gt;parentNote(); note; note = note-&gt;parentNote())
-			// Add it (if it was not already in the list):
-			if (!note-&gt;isColumn() &amp;&amp; !groups.contains(note))
-				groups.append(note);
+    // For each note:
+    for (NoteSelection *node = firstStacked(); node; node = node-&gt;nextStacked())
+        // For each parent groups of the note:
+        for (Note * note = node-&gt;note-&gt;parentNote(); note; note = note-&gt;parentNote())
+            // Add it (if it was not already in the list):
+            if (!note-&gt;isColumn() &amp;&amp; !groups.contains(note))
+                groups.append(note);
 
-	return groups;
+    return groups;
 }
 
 /** Class DecoratedBasket: */
 
 DecoratedBasket::DecoratedBasket(QWidget *parent, const QString &amp;folderName, Qt::WFlags fl)
- : QWidget(parent, fl)
+        : QWidget(parent, fl)
 {
-	m_layout = new QVBoxLayout(this);
-	m_filter = new FilterBar(this);
-	m_basket = new Basket(this, folderName);
-	m_layout-&gt;addWidget(m_basket);
-	setFilterBarPosition(Settings::filterOnTop());
+    m_layout = new QVBoxLayout(this);
+    m_filter = new FilterBar(this);
+    m_basket = new Basket(this, folderName);
+    m_layout-&gt;addWidget(m_basket);
+    setFilterBarPosition(Settings::filterOnTop());
 
-	m_filter-&gt;hide();
-	m_basket-&gt;setFocus(); // To avoid the filter bar have focus on load
+    m_filter-&gt;hide();
+    m_basket-&gt;setFocus(); // To avoid the filter bar have focus on load
 
-	connect( m_filter, SIGNAL(newFilter(const FilterData&amp;)), m_basket, SLOT(newFilter(const FilterData&amp;)) );
+    connect(m_filter, SIGNAL(newFilter(const FilterData&amp;)), m_basket, SLOT(newFilter(const FilterData&amp;)));
 
-	connect( m_basket, SIGNAL(postMessage(const QString&amp;)),      Global::bnpView, SLOT(postStatusbarMessage(const QString&amp;)) );
-	connect( m_basket, SIGNAL(setStatusBarText(const QString&amp;)), Global::bnpView, SLOT(setStatusBarHint(const QString&amp;))     );
-	connect( m_basket, SIGNAL(resetStatusBarText()),             Global::bnpView, SLOT(updateStatusBarHint())                );
+    connect(m_basket, SIGNAL(postMessage(const QString&amp;)),      Global::bnpView, SLOT(postStatusbarMessage(const QString&amp;)));
+    connect(m_basket, SIGNAL(setStatusBarText(const QString&amp;)), Global::bnpView, SLOT(setStatusBarHint(const QString&amp;)));
+    connect(m_basket, SIGNAL(resetStatusBarText()),             Global::bnpView, SLOT(updateStatusBarHint()));
 }
 
 DecoratedBasket::~DecoratedBasket()
@@ -223,92 +222,92 @@ DecoratedBasket::~DecoratedBasket()
 
 void DecoratedBasket::setFilterBarPosition(bool onTop)
 {
-	m_layout-&gt;removeWidget(m_filter);
-	if (onTop) {
-		m_layout-&gt;insertWidget(0, m_filter);
-		setTabOrder(this/*(QWidget*)parent()*/, m_filter);
-		setTabOrder(m_filter, m_basket);
-		setTabOrder(m_basket, (QWidget*)parent());
-	} else {
-		m_layout-&gt;addWidget(m_filter);
-		setTabOrder(this/*(QWidget*)parent()*/, m_basket);
-		setTabOrder(m_basket, m_filter);
-		setTabOrder(m_filter, (QWidget*)parent());
-	}
+    m_layout-&gt;removeWidget(m_filter);
+    if (onTop) {
+        m_layout-&gt;insertWidget(0, m_filter);
+        setTabOrder(this/*(QWidget*)parent()*/, m_filter);
+        setTabOrder(m_filter, m_basket);
+        setTabOrder(m_basket, (QWidget*)parent());
+    } else {
+        m_layout-&gt;addWidget(m_filter);
+        setTabOrder(this/*(QWidget*)parent()*/, m_basket);
+        setTabOrder(m_basket, m_filter);
+        setTabOrder(m_filter, (QWidget*)parent());
+    }
 }
 
 void DecoratedBasket::setFilterBarVisible(bool show, bool switchFocus)
 {
-//	m_basket-&gt;setShowFilterBar(true);//show);
-//	m_basket-&gt;save();
-	// In this order (m_basket and then m_filter) because setShown(false)
-	//  will call resetFilter() that will update actions, and then check the
-	//  Ctrl+F action whereas it should be unchecked
-	//  FIXME: It's very uggly all those things
-	m_filter-&gt;setVisible(show);
-	if (show) {
-		if (switchFocus)
-			m_filter-&gt;setEditFocus();
-	} else if (m_filter-&gt;hasEditFocus())
-		m_basket-&gt;setFocus();
+//  m_basket-&gt;setShowFilterBar(true);//show);
+//  m_basket-&gt;save();
+    // In this order (m_basket and then m_filter) because setShown(false)
+    //  will call resetFilter() that will update actions, and then check the
+    //  Ctrl+F action whereas it should be unchecked
+    //  FIXME: It's very uggly all those things
+    m_filter-&gt;setVisible(show);
+    if (show) {
+        if (switchFocus)
+            m_filter-&gt;setEditFocus();
+    } else if (m_filter-&gt;hasEditFocus())
+        m_basket-&gt;setFocus();
 }
 
 void DecoratedBasket::resetFilter()
 {
-	m_filter-&gt;reset();
+    m_filter-&gt;reset();
 }
 
 /** Class TransparentWidget */
 
 //TODO: Why was Qt::WNoAutoErase used here?
 TransparentWidget::TransparentWidget(Basket *basket)
- : QWidget(basket-&gt;viewport()), m_basket(basket)
+        : QWidget(basket-&gt;viewport()), m_basket(basket)
 {
-	setFocusPolicy(Qt::NoFocus);
-	setMouseTracking(true); // To receive mouseMoveEvents
+    setFocusPolicy(Qt::NoFocus);
+    setMouseTracking(true); // To receive mouseMoveEvents
 
-	basket-&gt;viewport()-&gt;installEventFilter(this);
+    basket-&gt;viewport()-&gt;installEventFilter(this);
 }
 
 /*void TransparentWidget::reparent(QWidget *parent, Qt::WFlags f, const QPoint &amp;p, bool showIt)
 {
-	QWidget::reparent(parent, Qt::WNoAutoErase, p, showIt);
+    QWidget::reparent(parent, Qt::WNoAutoErase, p, showIt);
 }*/
 
 void TransparentWidget::setPosition(int x, int y)
 {
-	m_x = x;
-	m_y = y;
+    m_x = x;
+    m_y = y;
 }
 
 void TransparentWidget::paintEvent(QPaintEvent*event)
 {
-	QWidget::paintEvent(event);
-	QPainter painter(this);
+    QWidget::paintEvent(event);
+    QPainter painter(this);
 
-//	painter.save();
-	painter.translate(-m_x, -m_y);
-	m_basket-&gt;drawContents(&amp;painter, m_x, m_y, width(), height());
+//  painter.save();
+    painter.translate(-m_x, -m_y);
+    m_basket-&gt;drawContents(&amp;painter, m_x, m_y, width(), height());
 
-//	painter.restore();
-//	painter.setPen(Qt::blue);
-//	painter.drawRect(0, 0, width(), height());
+//  painter.restore();
+//  painter.setPen(Qt::blue);
+//  painter.drawRect(0, 0, width(), height());
 }
 
 void TransparentWidget::mouseMoveEvent(QMouseEvent *event)
 {
-	QMouseEvent *translated = new QMouseEvent(QEvent::MouseMove, event-&gt;pos() + QPoint(m_x, m_y), event-&gt;button(), event-&gt;buttons(), event-&gt;modifiers());
-	m_basket-&gt;contentsMouseMoveEvent(translated);
-	delete translated;
+    QMouseEvent *translated = new QMouseEvent(QEvent::MouseMove, event-&gt;pos() + QPoint(m_x, m_y), event-&gt;button(), event-&gt;buttons(), event-&gt;modifiers());
+    m_basket-&gt;contentsMouseMoveEvent(translated);
+    delete translated;
 }
 
 bool TransparentWidget::eventFilter(QObject */*object*/, QEvent *event)
 {
-	// If the parent basket viewport has changed, we should change too:
-	if (event-&gt;type() == QEvent::Paint)
-		update();
+    // If the parent basket viewport has changed, we should change too:
+    if (event-&gt;type() == QEvent::Paint)
+        update();
 
-	return false; // Event not consumed, in every cases (because it's only a notification)!
+    return false; // Event not consumed, in every cases (because it's only a notification)!
 }
 
 /** Class Basket: */
@@ -318,9 +317,9 @@ const int Basket::FRAME_DELAY = 50/*1500*/; // Delay between two animation &quot;fram
 /*
  * Convenient function (defined in note.cpp !):
  */
-void drawGradient( QPainter *p, const QColor &amp;colorTop, const QColor &amp; colorBottom,
-                   int x, int y, int w, int h,
-                   bool sunken, bool horz, bool flat  );
+void drawGradient(QPainter *p, const QColor &amp;colorTop, const QColor &amp; colorBottom,
+                  int x, int y, int w, int h,
+                  bool sunken, bool horz, bool flat);
 
 /*
  * Defined in note.cpp:
@@ -329,969 +328,968 @@ extern void substractRectOnAreas(const QRect &amp;rectToSubstract, QList&lt;QRect&gt; &amp;are
 
 void debugZone(int zone)
 {
-	QString s;
-	switch (zone) {
-		case Note::Handle:        s = &quot;Handle&quot;;              break;
-		case Note::Group:         s = &quot;Group&quot;;               break;
-		case Note::TagsArrow:     s = &quot;TagsArrow&quot;;           break;
-		case Note::Custom0:       s = &quot;Custom0&quot;;             break;
-		case Note::GroupExpander: s = &quot;GroupExpander&quot;;       break;
-		case Note::Content:       s = &quot;Content&quot;;             break;
-		case Note::Link:          s = &quot;Link&quot;;                break;
-		case Note::TopInsert:     s = &quot;TopInsert&quot;;           break;
-		case Note::TopGroup:      s = &quot;TopGroup&quot;;            break;
-		case Note::BottomInsert:  s = &quot;BottomInsert&quot;;        break;
-		case Note::BottomGroup:   s = &quot;BottomGroup&quot;;         break;
-		case Note::BottomColumn:  s = &quot;BottomColumn&quot;;        break;
-		case Note::None:          s = &quot;None&quot;;                break;
-		default:
-			if (zone == Note::Emblem0)
-				s = &quot;Emblem0&quot;;
-			else
-				s = &quot;Emblem0+&quot; + QString::number(zone - Note::Emblem0);
-			break;
-	}
-	kDebug() &lt;&lt; s;
+    QString s;
+    switch (zone) {
+    case Note::Handle:        s = &quot;Handle&quot;;              break;
+    case Note::Group:         s = &quot;Group&quot;;               break;
+    case Note::TagsArrow:     s = &quot;TagsArrow&quot;;           break;
+    case Note::Custom0:       s = &quot;Custom0&quot;;             break;
+    case Note::GroupExpander: s = &quot;GroupExpander&quot;;       break;
+    case Note::Content:       s = &quot;Content&quot;;             break;
+    case Note::Link:          s = &quot;Link&quot;;                break;
+    case Note::TopInsert:     s = &quot;TopInsert&quot;;           break;
+    case Note::TopGroup:      s = &quot;TopGroup&quot;;            break;
+    case Note::BottomInsert:  s = &quot;BottomInsert&quot;;        break;
+    case Note::BottomGroup:   s = &quot;BottomGroup&quot;;         break;
+    case Note::BottomColumn:  s = &quot;BottomColumn&quot;;        break;
+    case Note::None:          s = &quot;None&quot;;                break;
+    default:
+        if (zone == Note::Emblem0)
+            s = &quot;Emblem0&quot;;
+        else
+            s = &quot;Emblem0+&quot; + QString::number(zone - Note::Emblem0);
+        break;
+    }
+    kDebug() &lt;&lt; s;
 }
 
 #define FOR_EACH_NOTE(noteVar) \
-	for (Note *noteVar = firstNote(); noteVar; noteVar = noteVar-&gt;next())
+    for (Note *noteVar = firstNote(); noteVar; noteVar = noteVar-&gt;next())
 
 void Basket::prependNoteIn(Note *note, Note *in)
 {
-	if (!note)
-		// No note to prepend:
-		return;
+    if (!note)
+        // No note to prepend:
+        return;
 
-	if (in) {
-		// The normal case:
-		preparePlug(note);
+    if (in) {
+        // The normal case:
+        preparePlug(note);
 
-		Note *last = note-&gt;lastSibling();
+        Note *last = note-&gt;lastSibling();
 
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(in);
-//		note-&gt;setPrev(0L);
-		last-&gt;setNext(in-&gt;firstChild());
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(in);
+//      note-&gt;setPrev(0L);
+        last-&gt;setNext(in-&gt;firstChild());
 
-		if (in-&gt;firstChild())
-			in-&gt;firstChild()-&gt;setPrev(last);
+        if (in-&gt;firstChild())
+            in-&gt;firstChild()-&gt;setPrev(last);
 
-		in-&gt;setFirstChild(note);
+        in-&gt;setFirstChild(note);
 
-		if (m_loaded)
-			signalCountsChanged();
-	} else
-		// Prepend it directly in the basket:
-		appendNoteBefore(note, firstNote());
+        if (m_loaded)
+            signalCountsChanged();
+    } else
+        // Prepend it directly in the basket:
+        appendNoteBefore(note, firstNote());
 }
 
 void Basket::appendNoteIn(Note *note, Note *in)
 {
-	if (!note)
-		// No note to append:
-		return;
+    if (!note)
+        // No note to append:
+        return;
 
-	if (in) {
-		// The normal case:
-		preparePlug(note);
+    if (in) {
+        // The normal case:
+        preparePlug(note);
 
-//		Note *last = note-&gt;lastSibling();
-		Note *lastChild = in-&gt;lastChild();
+//      Note *last = note-&gt;lastSibling();
+        Note *lastChild = in-&gt;lastChild();
 
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(in);
-		note-&gt;setPrev(lastChild);
-//		last-&gt;setNext(0L);
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(in);
+        note-&gt;setPrev(lastChild);
+//      last-&gt;setNext(0L);
 
-		if (!in-&gt;firstChild())
-			in-&gt;setFirstChild(note);
+        if (!in-&gt;firstChild())
+            in-&gt;setFirstChild(note);
 
-		if (lastChild)
-			lastChild-&gt;setNext(note);
+        if (lastChild)
+            lastChild-&gt;setNext(note);
 
-		if (m_loaded)
-			signalCountsChanged();
-	} else
-		// Prepend it directly in the basket:
-		appendNoteAfter(note, lastNote());
+        if (m_loaded)
+            signalCountsChanged();
+    } else
+        // Prepend it directly in the basket:
+        appendNoteAfter(note, lastNote());
 }
 
 void Basket::appendNoteAfter(Note *note, Note *after)
 {
-	if (!note)
-		// No note to append:
-		return;
-
-	if (!after)
-		// By default, insert after the last note:
-		after = lastNote();
-
-	if (m_loaded &amp;&amp; after &amp;&amp; !after-&gt;isFree() &amp;&amp; !after-&gt;isColumn())
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;inheritTagsOf(after);
-
-//	if (!alreadyInBasket)
-	preparePlug(note);
-
-	Note *last = note-&gt;lastSibling();
-	if (after) {
-		// The normal case:
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(after-&gt;parentNote());
-		note-&gt;setPrev(after);
-		last-&gt;setNext(after-&gt;next());
-		after-&gt;setNext(note);
-		if (last-&gt;next())
-			last-&gt;next()-&gt;setPrev(last);
-	} else {
-		// There is no note in the basket:
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(0);
-		m_firstNote = note;
-//		note-&gt;setPrev(0);
-//		last-&gt;setNext(0);
-	}
-
-//	if (!alreadyInBasket)
-	if (m_loaded)
-		signalCountsChanged();
+    if (!note)
+        // No note to append:
+        return;
+
+    if (!after)
+        // By default, insert after the last note:
+        after = lastNote();
+
+    if (m_loaded &amp;&amp; after &amp;&amp; !after-&gt;isFree() &amp;&amp; !after-&gt;isColumn())
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;inheritTagsOf(after);
+
+//  if (!alreadyInBasket)
+    preparePlug(note);
+
+    Note *last = note-&gt;lastSibling();
+    if (after) {
+        // The normal case:
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(after-&gt;parentNote());
+        note-&gt;setPrev(after);
+        last-&gt;setNext(after-&gt;next());
+        after-&gt;setNext(note);
+        if (last-&gt;next())
+            last-&gt;next()-&gt;setPrev(last);
+    } else {
+        // There is no note in the basket:
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(0);
+        m_firstNote = note;
+//      note-&gt;setPrev(0);
+//      last-&gt;setNext(0);
+    }
+
+//  if (!alreadyInBasket)
+    if (m_loaded)
+        signalCountsChanged();
 }
 
 void Basket::appendNoteBefore(Note *note, Note *before)
 {
-	if (!note)
-		// No note to append:
-		return;
-
-	if (!before)
-		// By default, insert before the first note:
-		before = firstNote();
-
-	if (m_loaded &amp;&amp; before &amp;&amp; !before-&gt;isFree() &amp;&amp; !before-&gt;isColumn())
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;inheritTagsOf(before);
-
-	preparePlug(note);
-
-	Note *last = note-&gt;lastSibling();
-	if (before) {
-		// The normal case:
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(before-&gt;parentNote());
-		note-&gt;setPrev(before-&gt;prev());
-		last-&gt;setNext(before);
-		before-&gt;setPrev(last);
-		if (note-&gt;prev())
-			note-&gt;prev()-&gt;setNext(note);
-		else {
-			if (note-&gt;parentNote())
-				note-&gt;parentNote()-&gt;setFirstChild(note);
-			else
-				m_firstNote = note;
-		}
-	} else {
-		// There is no note in the basket:
-		for (Note *n = note; n; n = n-&gt;next())
-			n-&gt;setParentNote(0);
-		m_firstNote = note;
-//		note-&gt;setPrev(0);
-//		last-&gt;setNext(0);
-	}
-
-	if (m_loaded)
-		signalCountsChanged();
+    if (!note)
+        // No note to append:
+        return;
+
+    if (!before)
+        // By default, insert before the first note:
+        before = firstNote();
+
+    if (m_loaded &amp;&amp; before &amp;&amp; !before-&gt;isFree() &amp;&amp; !before-&gt;isColumn())
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;inheritTagsOf(before);
+
+    preparePlug(note);
+
+    Note *last = note-&gt;lastSibling();
+    if (before) {
+        // The normal case:
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(before-&gt;parentNote());
+        note-&gt;setPrev(before-&gt;prev());
+        last-&gt;setNext(before);
+        before-&gt;setPrev(last);
+        if (note-&gt;prev())
+            note-&gt;prev()-&gt;setNext(note);
+        else {
+            if (note-&gt;parentNote())
+                note-&gt;parentNote()-&gt;setFirstChild(note);
+            else
+                m_firstNote = note;
+        }
+    } else {
+        // There is no note in the basket:
+        for (Note *n = note; n; n = n-&gt;next())
+            n-&gt;setParentNote(0);
+        m_firstNote = note;
+//      note-&gt;setPrev(0);
+//      last-&gt;setNext(0);
+    }
+
+    if (m_loaded)
+        signalCountsChanged();
 }
 
 DecoratedBasket* Basket::decoration()
 {
-	return (DecoratedBasket*)parent();
+    return (DecoratedBasket*)parent();
 }
 
 void Basket::preparePlug(Note *note)
 {
-	// Select only the new notes, compute the new notes count and the new number of found notes:
-	if (m_loaded)
-		unselectAll();
-	int count  = 0;
-	int founds = 0;
-	Note *last = 0;
-	for (Note *n = note; n; n = n-&gt;next()) {
-		if (m_loaded)
-			n-&gt;setSelectedRecursively(true); // Notes should have a parent basket (and they have, so that's OK).
-		count  += n-&gt;count();
-		founds += n-&gt;newFilter(decoration()-&gt;filterData());
-		last = n;
-	}
-	m_count += count;
-	m_countFounds += founds;
-
-	// Focus the last inserted note:
-	if (m_loaded &amp;&amp; last) {
-		setFocusedNote(last);
-		m_startOfShiftSelectionNote = (last-&gt;isGroup() ? last-&gt;lastRealChild() : last);
-	}
-
-	// If some notes don't match (are hidden), tell it to the user:
-	if (m_loaded &amp;&amp; founds &lt; count) {
-		if      (count == 1)          postMessage( i18n(&quot;The new note does not match the filter and is hidden.&quot;)  );
-		else if (founds == count - 1) postMessage( i18n(&quot;A new note does not match the filter and is hidden.&quot;)    );
-		else if (founds &gt; 0)          postMessage( i18n(&quot;Some new notes do not match the filter and are hidden.&quot;) );
-		else                          postMessage( i18n(&quot;The new notes do not match the filter and are hidden.&quot;)  );
-	}
+    // Select only the new notes, compute the new notes count and the new number of found notes:
+    if (m_loaded)
+        unselectAll();
+    int count  = 0;
+    int founds = 0;
+    Note *last = 0;
+    for (Note *n = note; n; n = n-&gt;next()) {
+        if (m_loaded)
+            n-&gt;setSelectedRecursively(true); // Notes should have a parent basket (and they have, so that's OK).
+        count  += n-&gt;count();
+        founds += n-&gt;newFilter(decoration()-&gt;filterData());
+        last = n;
+    }
+    m_count += count;
+    m_countFounds += founds;
+
+    // Focus the last inserted note:
+    if (m_loaded &amp;&amp; last) {
+        setFocusedNote(last);
+        m_startOfShiftSelectionNote = (last-&gt;isGroup() ? last-&gt;lastRealChild() : last);
+    }
+
+    // If some notes don't match (are hidden), tell it to the user:
+    if (m_loaded &amp;&amp; founds &lt; count) {
+        if (count == 1)          postMessage(i18n(&quot;The new note does not match the filter and is hidden.&quot;));
+        else if (founds == count - 1) postMessage(i18n(&quot;A new note does not match the filter and is hidden.&quot;));
+        else if (founds &gt; 0)          postMessage(i18n(&quot;Some new notes do not match the filter and are hidden.&quot;));
+        else                          postMessage(i18n(&quot;The new notes do not match the filter and are hidden.&quot;));
+    }
 }
 
 void Basket::unplugNote(Note *note)
 {
-	// If there is nothing to do...
-	if (!note)
-		return;
-
-//	if (!willBeReplugged) {
-	note-&gt;setSelectedRecursively(false); // To removeSelectedNote() and decrease the selectedsCount.
-	m_count -= note-&gt;count();
-	m_countFounds -= note-&gt;newFilter(decoration()-&gt;filterData());
-	signalCountsChanged();
-//	}
-
-	// If it was the first note, change the first note:
-	if (m_firstNote == note)
-		m_firstNote = note-&gt;next();
-
-	// Change previous and next notes:
-	if (note-&gt;prev())
-		note-&gt;prev()-&gt;setNext(note-&gt;next());
-	if (note-&gt;next())
-		note-&gt;next()-&gt;setPrev(note-&gt;prev());
-
-	if (note-&gt;parentNote()) {
-		// If it was the first note of a group, change the first note of the group:
-		if (note-&gt;parentNote()-&gt;firstChild() == note)
-			note-&gt;parentNote()-&gt;setFirstChild( note-&gt;next() );
-
-		if (!note-&gt;parentNote()-&gt;isColumn()) {
-			// Ungroup if still 0 note inside parent group:
-			if ( ! note-&gt;parentNote()-&gt;firstChild() )
-				unplugNote(note-&gt;parentNote()); // TODO delete
-
-			// Ungroup if still 1 note inside parent group:
-			else if ( ! note-&gt;parentNote()-&gt;firstChild()-&gt;next() )
-				ungroupNote(note-&gt;parentNote());
-		}
-	}
+    // If there is nothing to do...
+    if (!note)
+        return;
+
+//  if (!willBeReplugged) {
+    note-&gt;setSelectedRecursively(false); // To removeSelectedNote() and decrease the selectedsCount.
+    m_count -= note-&gt;count();
+    m_countFounds -= note-&gt;newFilter(decoration()-&gt;filterData());
+    signalCountsChanged();
+//  }
+
+    // If it was the first note, change the first note:
+    if (m_firstNote == note)
+        m_firstNote = note-&gt;next();
+
+    // Change previous and next notes:
+    if (note-&gt;prev())
+        note-&gt;prev()-&gt;setNext(note-&gt;next());
+    if (note-&gt;next())
+        note-&gt;next()-&gt;setPrev(note-&gt;prev());
+
+    if (note-&gt;parentNote()) {
+        // If it was the first note of a group, change the first note of the group:
+        if (note-&gt;parentNote()-&gt;firstChild() == note)
+            note-&gt;parentNote()-&gt;setFirstChild(note-&gt;next());
+
+        if (!note-&gt;parentNote()-&gt;isColumn()) {
+            // Ungroup if still 0 note inside parent group:
+            if (! note-&gt;parentNote()-&gt;firstChild())
+                unplugNote(note-&gt;parentNote()); // TODO delete
+
+            // Ungroup if still 1 note inside parent group:
+            else if (! note-&gt;parentNote()-&gt;firstChild()-&gt;next())
+                ungroupNote(note-&gt;parentNote());
+        }
+    }
 
-	note-&gt;setParentNote(0);
-	note-&gt;setPrev(0);
-	note-&gt;setNext(0);
+    note-&gt;setParentNote(0);
+    note-&gt;setPrev(0);
+    note-&gt;setNext(0);
 
-//	recomputeBlankRects(); // FIXME: called too much time. It's here because when dragging and moving a note to another basket and then go back to the original basket, the note is deleted but the note rect is not painter anymore.
+//  recomputeBlankRects(); // FIXME: called too much time. It's here because when dragging and moving a note to another basket and then go back to the original basket, the note is deleted but the note rect is not painter anymore.
 }
 
 void Basket::ungroupNote(Note *group)
 {
-	Note *note            = group-&gt;firstChild();
-	Note *lastGroupedNote = group;
-	Note *nextNote;
+    Note *note            = group-&gt;firstChild();
+    Note *lastGroupedNote = group;
+    Note *nextNote;
 
-	// Move all notes after the group (not before, to avoid to change m_firstNote or group-&gt;m_firstChild):
-	while (note) {
-		nextNote = note-&gt;next();
+    // Move all notes after the group (not before, to avoid to change m_firstNote or group-&gt;m_firstChild):
+    while (note) {
+        nextNote = note-&gt;next();
 
-		if (lastGroupedNote-&gt;next())
-			lastGroupedNote-&gt;next()-&gt;setPrev(note);
-		note-&gt;setNext(lastGroupedNote-&gt;next());
-		lastGroupedNote-&gt;setNext(note);
-		note-&gt;setParentNote(group-&gt;parentNote());
-		note-&gt;setPrev(lastGroupedNote);
+        if (lastGroupedNote-&gt;next())
+            lastGroupedNote-&gt;next()-&gt;setPrev(note);
+        note-&gt;setNext(lastGroupedNote-&gt;next());
+        lastGroupedNote-&gt;setNext(note);
+        note-&gt;setParentNote(group-&gt;parentNote());
+        note-&gt;setPrev(lastGroupedNote);
 
-		note-&gt;setGroupWidth(group-&gt;groupWidth() - Note::GROUP_WIDTH);
-		lastGroupedNote = note;
-		note = nextNote;
-	}
+        note-&gt;setGroupWidth(group-&gt;groupWidth() - Note::GROUP_WIDTH);
+        lastGroupedNote = note;
+        note = nextNote;
+    }
 
-	// Unplug the group:
-	group-&gt;setFirstChild(0);
-	unplugNote(group); // TODO: delete
+    // Unplug the group:
+    group-&gt;setFirstChild(0);
+    unplugNote(group); // TODO: delete
 
-	relayoutNotes(true);
+    relayoutNotes(true);
 }
 
 void Basket::groupNoteBefore(Note *note, Note *with)
 {
-	if (!note || !with)
-		// No note to group or nowhere to group it:
-		return;
+    if (!note || !with)
+        // No note to group or nowhere to group it:
+        return;
 
-//	if (m_loaded &amp;&amp; before &amp;&amp; !with-&gt;isFree() &amp;&amp; !with-&gt;isColumn())
-	for (Note *n = note; n; n = n-&gt;next())
-		n-&gt;inheritTagsOf(with);
+//  if (m_loaded &amp;&amp; before &amp;&amp; !with-&gt;isFree() &amp;&amp; !with-&gt;isColumn())
+    for (Note *n = note; n; n = n-&gt;next())
+        n-&gt;inheritTagsOf(with);
 
-	preparePlug(note);
+    preparePlug(note);
 
-	Note *last = note-&gt;lastSibling();
+    Note *last = note-&gt;lastSibling();
 
-	Note *group = new Note(this);
-	group-&gt;setPrev(with-&gt;prev());
-	group-&gt;setNext(with-&gt;next());
-	group-&gt;setX(with-&gt;x());
-	group-&gt;setY(with-&gt;y());
-	if (with-&gt;parentNote() &amp;&amp; with-&gt;parentNote()-&gt;firstChild() == with)
-		with-&gt;parentNote()-&gt;setFirstChild(group);
-	else if (m_firstNote == with)
-		m_firstNote = group;
-	group-&gt;setParentNote(with-&gt;parentNote());
-	group-&gt;setFirstChild(note);
-	group-&gt;setGroupWidth(with-&gt;groupWidth() + Note::GROUP_WIDTH);
+    Note *group = new Note(this);
+    group-&gt;setPrev(with-&gt;prev());
+    group-&gt;setNext(with-&gt;next());
+    group-&gt;setX(with-&gt;x());
+    group-&gt;setY(with-&gt;y());
+    if (with-&gt;parentNote() &amp;&amp; with-&gt;parentNote()-&gt;firstChild() == with)
+        with-&gt;parentNote()-&gt;setFirstChild(group);
+    else if (m_firstNote == with)
+        m_firstNote = group;
+    group-&gt;setParentNote(with-&gt;parentNote());
+    group-&gt;setFirstChild(note);
+    group-&gt;setGroupWidth(with-&gt;groupWidth() + Note::GROUP_WIDTH);
 
-	if (with-&gt;prev())
-		with-&gt;prev()-&gt;setNext(group);
-	if (with-&gt;next())
-		with-&gt;next()-&gt;setPrev(group);
-	with-&gt;setParentNote(group);
-	with-&gt;setPrev(last);
-	with-&gt;setNext(0L);
+    if (with-&gt;prev())
+        with-&gt;prev()-&gt;setNext(group);
+    if (with-&gt;next())
+        with-&gt;next()-&gt;setPrev(group);
+    with-&gt;setParentNote(group);
+    with-&gt;setPrev(last);
+    with-&gt;setNext(0L);
 
-	for (Note *n = note; n; n = n-&gt;next())
-		n-&gt;setParentNote(group);
-//	note-&gt;setPrev(0L);
-	last-&gt;setNext(with);
+    for (Note *n = note; n; n = n-&gt;next())
+        n-&gt;setParentNote(group);
+//  note-&gt;setPrev(0L);
+    last-&gt;setNext(with);
 
-	if (m_loaded)
-		signalCountsChanged();
+    if (m_loaded)
+        signalCountsChanged();
 }
 
 void Basket::groupNoteAfter(Note *note, Note *with)
 {
-	if (!note || !with)
-		// No note to group or nowhere to group it:
-		return;
+    if (!note || !with)
+        // No note to group or nowhere to group it:
+        return;
 
-//	if (m_loaded &amp;&amp; before &amp;&amp; !with-&gt;isFree() &amp;&amp; !with-&gt;isColumn())
-	for (Note *n = note; n; n = n-&gt;next())
-		n-&gt;inheritTagsOf(with);
+//  if (m_loaded &amp;&amp; before &amp;&amp; !with-&gt;isFree() &amp;&amp; !with-&gt;isColumn())
+    for (Note *n = note; n; n = n-&gt;next())
+        n-&gt;inheritTagsOf(with);
 
-	preparePlug(note);
+    preparePlug(note);
 
-//	Note *last = note-&gt;lastSibling();
+//  Note *last = note-&gt;lastSibling();
 
-	Note *group = new Note(this);
-	group-&gt;setPrev(with-&gt;prev());
-	group-&gt;setNext(with-&gt;next());
-	group-&gt;setX(with-&gt;x());
-	group-&gt;setY(with-&gt;y());
-	if (with-&gt;parentNote() &amp;&amp; with-&gt;parentNote()-&gt;firstChild() == with)
-		with-&gt;parentNote()-&gt;setFirstChild(group);
-	else if (m_firstNote == with)
-		m_firstNote = group;
-	group-&gt;setParentNote(with-&gt;parentNote());
-	group-&gt;setFirstChild(with);
-	group-&gt;setGroupWidth(with-&gt;groupWidth() + Note::GROUP_WIDTH);
+    Note *group = new Note(this);
+    group-&gt;setPrev(with-&gt;prev());
+    group-&gt;setNext(with-&gt;next());
+    group-&gt;setX(with-&gt;x());
+    group-&gt;setY(with-&gt;y());
+    if (with-&gt;parentNote() &amp;&amp; with-&gt;parentNote()-&gt;firstChild() == with)
+        with-&gt;parentNote()-&gt;setFirstChild(group);
+    else if (m_firstNote == with)
+        m_firstNote = group;
+    group-&gt;setParentNote(with-&gt;parentNote());
+    group-&gt;setFirstChild(with);
+    group-&gt;setGroupWidth(with-&gt;groupWidth() + Note::GROUP_WIDTH);
 
-	if (with-&gt;prev())
-		with-&gt;prev()-&gt;setNext(group);
-	if (with-&gt;next())
-		with-&gt;next()-&gt;setPrev(group);
-	with-&gt;setParentNote(group);
-	with-&gt;setPrev(0L);
-	with-&gt;setNext(note);
+    if (with-&gt;prev())
+        with-&gt;prev()-&gt;setNext(group);
+    if (with-&gt;next())
+        with-&gt;next()-&gt;setPrev(group);
+    with-&gt;setParentNote(group);
+    with-&gt;setPrev(0L);
+    with-&gt;setNext(note);
 
-	for (Note *n = note; n; n = n-&gt;next())
-		n-&gt;setParentNote(group);
-	note-&gt;setPrev(with);
-//	last-&gt;setNext(0L);
+    for (Note *n = note; n; n = n-&gt;next())
+        n-&gt;setParentNote(group);
+    note-&gt;setPrev(with);
+//  last-&gt;setNext(0L);
 
-	if (m_loaded)
-		signalCountsChanged();
+    if (m_loaded)
+        signalCountsChanged();
 }
 
 void Basket::loadNotes(const QDomElement &amp;notes, Note *parent)
 {
-	Note *note;
-	for (QDomNode n = notes.firstChild(); !n.isNull(); n = n.nextSibling()) {
-		QDomElement e = n.toElement();
-		if (e.isNull()) // Cannot handle that!
-			continue;
-		note = 0;
-		// Load a Group:
-		if (e.tagName() == &quot;group&quot;) {
-			note = new Note(this);      // 1. Create the group...
-			loadNotes(e, note);         // 3. ... And populate it with child notes.
-			int noteCount = note-&gt;count();
-			if (noteCount &gt; 0 || (parent == 0 &amp;&amp; !isFreeLayout())) { // But don't remove columns!
-				appendNoteIn(note, parent); // 2. ... Insert it... FIXME: Initially, the if() the insrtion was the step 2. Was it on purpose?
-				// The notes in the group are counted two times (it's why appendNoteIn() was called before loadNotes):
-				m_count       -= noteCount;// TODO: Recompute note count every time noteCount() is emitted!
-				m_countFounds -= noteCount;
-			}
-		}
-		// Load a Content-Based Note:
-		if (e.tagName() == &quot;note&quot; || e.tagName() == &quot;item&quot;) { // Keep compatible with 0.6.0 Alpha 1
-			note = new Note(this);      // Create the note...
-			NoteFactory__loadNode(XMLWork::getElement(e, &quot;content&quot;), e.attribute(&quot;type&quot;), note, /*lazyLoad=*/m_finishLoadOnFirstShow); // ... Populate it with content...
-			if (e.attribute(&quot;type&quot;) == &quot;text&quot;)
-				m_shouldConvertPlainTextNotes = true; // Convert Pre-0.6.0 baskets: plain text notes should be converted to rich text ones once all is loaded!
-			appendNoteIn(note, parent); // ... And insert it.
-			// Load dates:
-			if (e.hasAttribute(&quot;added&quot;))
-				note-&gt;setAddedDate(           QDateTime::fromString(e.attribute(&quot;added&quot;),            Qt::ISODate));
-			if (e.hasAttribute(&quot;lastModification&quot;))
-				note-&gt;setLastModificationDate(QDateTime::fromString(e.attribute(&quot;lastModification&quot;), Qt::ISODate));
-		}
-		// If we successfully loaded a note:
-		if (note) {
-			// Free Note Properties:
-			if (note-&gt;isFree()) {
-				int x = e.attribute(&quot;x&quot;).toInt();
-				int y = e.attribute(&quot;y&quot;).toInt();
-				note-&gt;setX(x &lt; 0 ? 0 : x);
-				note-&gt;setY(y &lt; 0 ? 0 : y);
-			}
-			// Resizeable Note Properties:
-			if (note-&gt;hasResizer() || note-&gt;isColumn())
-				note-&gt;setGroupWidth(e.attribute(&quot;width&quot;, &quot;200&quot;).toInt());
-			// Group Properties:
-			if (note-&gt;isGroup() &amp;&amp; !note-&gt;isColumn() &amp;&amp; XMLWork::trueOrFalse(e.attribute(&quot;folded&quot;, &quot;false&quot;)))
-				note-&gt;toggleFolded(false);
-			// Tags:
-			if (note-&gt;content()) {
-				QString tagsString = XMLWork::getElementText(e, &quot;tags&quot;, &quot;&quot;);
-				QStringList tagsId = tagsString.split(&quot;;&quot;);
-				for (QStringList::iterator it = tagsId.begin(); it != tagsId.end(); ++it) {
-					State *state = Tag::stateForId(*it);
-					if (state)
-						note-&gt;addState(state, /*orReplace=*/true);
-				}
-			}
-		}
-//		kapp-&gt;processEvents();
-	}
+    Note *note;
+    for (QDomNode n = notes.firstChild(); !n.isNull(); n = n.nextSibling()) {
+        QDomElement e = n.toElement();
+        if (e.isNull()) // Cannot handle that!
+            continue;
+        note = 0;
+        // Load a Group:
+        if (e.tagName() == &quot;group&quot;) {
+            note = new Note(this);      // 1. Create the group...
+            loadNotes(e, note);         // 3. ... And populate it with child notes.
+            int noteCount = note-&gt;count();
+            if (noteCount &gt; 0 || (parent == 0 &amp;&amp; !isFreeLayout())) { // But don't remove columns!
+                appendNoteIn(note, parent); // 2. ... Insert it... FIXME: Initially, the if() the insrtion was the step 2. Was it on purpose?
+                // The notes in the group are counted two times (it's why appendNoteIn() was called before loadNotes):
+                m_count       -= noteCount;// TODO: Recompute note count every time noteCount() is emitted!
+                m_countFounds -= noteCount;
+            }
+        }
+        // Load a Content-Based Note:
+        if (e.tagName() == &quot;note&quot; || e.tagName() == &quot;item&quot;) { // Keep compatible with 0.6.0 Alpha 1
+            note = new Note(this);      // Create the note...
+            NoteFactory__loadNode(XMLWork::getElement(e, &quot;content&quot;), e.attribute(&quot;type&quot;), note, /*lazyLoad=*/m_finishLoadOnFirstShow); // ... Populate it with content...
+            if (e.attribute(&quot;type&quot;) == &quot;text&quot;)
+                m_shouldConvertPlainTextNotes = true; // Convert Pre-0.6.0 baskets: plain text notes should be converted to rich text ones once all is loaded!
+            appendNoteIn(note, parent); // ... And insert it.
+            // Load dates:
+            if (e.hasAttribute(&quot;added&quot;))
+                note-&gt;setAddedDate(QDateTime::fromString(e.attribute(&quot;added&quot;),            Qt::ISODate));
+            if (e.hasAttribute(&quot;lastModification&quot;))
+                note-&gt;setLastModificationDate(QDateTime::fromString(e.attribute(&quot;lastModification&quot;), Qt::ISODate));
+        }
+        // If we successfully loaded a note:
+        if (note) {
+            // Free Note Properties:
+            if (note-&gt;isFree()) {
+                int x = e.attribute(&quot;x&quot;).toInt();
+                int y = e.attribute(&quot;y&quot;).toInt();
+                note-&gt;setX(x &lt; 0 ? 0 : x);
+                note-&gt;setY(y &lt; 0 ? 0 : y);
+            }
+            // Resizeable Note Properties:
+            if (note-&gt;hasResizer() || note-&gt;isColumn())
+                note-&gt;setGroupWidth(e.attribute(&quot;width&quot;, &quot;200&quot;).toInt());
+            // Group Properties:
+            if (note-&gt;isGroup() &amp;&amp; !note-&gt;isColumn() &amp;&amp; XMLWork::trueOrFalse(e.attribute(&quot;folded&quot;, &quot;false&quot;)))
+                note-&gt;toggleFolded(false);
+            // Tags:
+            if (note-&gt;content()) {
+                QString tagsString = XMLWork::getElementText(e, &quot;tags&quot;, &quot;&quot;);
+                QStringList tagsId = tagsString.split(&quot;;&quot;);
+                for (QStringList::iterator it = tagsId.begin(); it != tagsId.end(); ++it) {
+                    State *state = Tag::stateForId(*it);
+                    if (state)
+                        note-&gt;addState(state, /*orReplace=*/true);
+                }
+            }
+        }
+//      kapp-&gt;processEvents();
+    }
 }
 
 void Basket::saveNotes(QDomDocument &amp;document, QDomElement &amp;element, Note *parent)
 {
-	Note *note = (parent ? parent-&gt;firstChild() : firstNote());
-	while (note) {
-		// Create Element:
-		QDomElement noteElement = document.createElement(note-&gt;isGroup() ? &quot;group&quot; : &quot;note&quot;);
-		element.appendChild(noteElement);
-		// Free Note Properties:
-		if (note-&gt;isFree()) {
-			noteElement.setAttribute(&quot;x&quot;, note-&gt;finalX());
-			noteElement.setAttribute(&quot;y&quot;, note-&gt;finalY());
-		}
-		// Resizeable Note Properties:
-		if (note-&gt;hasResizer())
-			noteElement.setAttribute(&quot;width&quot;, note-&gt;groupWidth());
-		// Group Properties:
-		if (note-&gt;isGroup() &amp;&amp; !note-&gt;isColumn())
-			noteElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(note-&gt;isFolded()));
-		// Save Content:
-		if (note-&gt;content()) {
-			// Save Dates:
-			noteElement.setAttribute(&quot;added&quot;,            note-&gt;addedDate().toString(Qt::ISODate)           );
-			noteElement.setAttribute(&quot;lastModification&quot;, note-&gt;lastModificationDate().toString(Qt::ISODate));
-			// Save Content:
-			noteElement.setAttribute(&quot;type&quot;, note-&gt;content()-&gt;lowerTypeName());
-			QDomElement content = document.createElement(&quot;content&quot;);
-			noteElement.appendChild(content);
-			note-&gt;content()-&gt;saveToNode(document, content);
-			// Save Tags:
-			if (note-&gt;states().count() &gt; 0) {
-				QString tags;
-				for (State::List::iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
-					tags += (tags.isEmpty() ? &quot;&quot; : &quot;;&quot;) + (*it)-&gt;id();
-				XMLWork::addElement(document, noteElement, &quot;tags&quot;, tags);
-			}
-		} else
-			// Save Child Notes:
-			saveNotes(document, noteElement, note);
-		// Go to the Next One:
-		note = note-&gt;next();
-	}
+    Note *note = (parent ? parent-&gt;firstChild() : firstNote());
+    while (note) {
+        // Create Element:
+        QDomElement noteElement = document.createElement(note-&gt;isGroup() ? &quot;group&quot; : &quot;note&quot;);
+        element.appendChild(noteElement);
+        // Free Note Properties:
+        if (note-&gt;isFree()) {
+            noteElement.setAttribute(&quot;x&quot;, note-&gt;finalX());
+            noteElement.setAttribute(&quot;y&quot;, note-&gt;finalY());
+        }
+        // Resizeable Note Properties:
+        if (note-&gt;hasResizer())
+            noteElement.setAttribute(&quot;width&quot;, note-&gt;groupWidth());
+        // Group Properties:
+        if (note-&gt;isGroup() &amp;&amp; !note-&gt;isColumn())
+            noteElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(note-&gt;isFolded()));
+        // Save Content:
+        if (note-&gt;content()) {
+            // Save Dates:
+            noteElement.setAttribute(&quot;added&quot;,            note-&gt;addedDate().toString(Qt::ISODate));
+            noteElement.setAttribute(&quot;lastModification&quot;, note-&gt;lastModificationDate().toString(Qt::ISODate));
+            // Save Content:
+            noteElement.setAttribute(&quot;type&quot;, note-&gt;content()-&gt;lowerTypeName());
+            QDomElement content = document.createElement(&quot;content&quot;);
+            noteElement.appendChild(content);
+            note-&gt;content()-&gt;saveToNode(document, content);
+            // Save Tags:
+            if (note-&gt;states().count() &gt; 0) {
+                QString tags;
+                for (State::List::iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
+                    tags += (tags.isEmpty() ? &quot;&quot; : &quot;;&quot;) + (*it)-&gt;id();
+                XMLWork::addElement(document, noteElement, &quot;tags&quot;, tags);
+            }
+        } else
+            // Save Child Notes:
+            saveNotes(document, noteElement, note);
+        // Go to the Next One:
+        note = note-&gt;next();
+    }
 }
 
 void Basket::loadProperties(const QDomElement &amp;properties)
 {
-	// Compute Default Values for When Loading the Properties:
-	QString defaultBackgroundColor = (backgroundColorSetting().isValid() ? backgroundColorSetting().name() : &quot;&quot;);
-	QString defaultTextColor       = (textColorSetting().isValid()       ? textColorSetting().name()       : &quot;&quot;);
-
-	// Load the Properties:
-	QString icon = XMLWork::getElementText(properties, &quot;icon&quot;, this-&gt;icon() );
-	QString name = XMLWork::getElementText(properties, &quot;name&quot;, basketName() );
-
-	QDomElement appearance = XMLWork::getElement(properties, &quot;appearance&quot;);
-	// In 0.6.0-Alpha versions, there was a typo error: &quot;backround&quot; instead of &quot;background&quot;
-	QString backgroundImage       = appearance.attribute( &quot;backgroundImage&quot;, appearance.attribute( &quot;backroundImage&quot;, backgroundImageName()  ) );
-	QString backgroundColorString = appearance.attribute( &quot;backgroundColor&quot;, appearance.attribute( &quot;backroundColor&quot;, defaultBackgroundColor ) );
-	QString textColorString       = appearance.attribute( &quot;textColor&quot;,      defaultTextColor       );
-	QColor  backgroundColor = (backgroundColorString.isEmpty() ? QColor() : QColor(backgroundColorString));
-	QColor  textColor       = (textColorString.isEmpty()       ? QColor() : QColor(textColorString)      );
-
-	QDomElement disposition = XMLWork::getElement(properties, &quot;disposition&quot;);
-	bool free        = XMLWork::trueOrFalse( disposition.attribute( &quot;free&quot;,        XMLWork::trueOrFalse(isFreeLayout())   ) );
-	int  columnCount =                       disposition.attribute( &quot;columnCount&quot;, QString::number(this-&gt;columnsCount())  ).toInt();
-	bool mindMap     = XMLWork::trueOrFalse( disposition.attribute( &quot;mindMap&quot;,     XMLWork::trueOrFalse(isMindMap())      ) );
-
-	QDomElement shortcut = XMLWork::getElement(properties, &quot;shortcut&quot;);
-	QString actionStrings[] = { &quot;show&quot;, &quot;globalShow&quot;, &quot;globalSwitch&quot; };
-	KShortcut combination  = KShortcut(shortcut.attribute(
-						   &quot;combination&quot;,
-						   m_action-&gt;shortcut().primary().toString()));
-	QString   actionString =            shortcut.attribute( &quot;action&quot; );
-	int action = shortcutAction();
-	if (actionString == actionStrings[0]) action = 0;
-	if (actionString == actionStrings[1]) action = 1;
-	if (actionString == actionStrings[2]) action = 2;
-
-	QDomElement protection = XMLWork::getElement(properties, &quot;protection&quot;);
-	m_encryptionType = protection.attribute( &quot;type&quot; ).toInt();
-	m_encryptionKey = protection.attribute( &quot;key&quot; );
-
-	// Apply the Properties:
-	setDisposition((free ? (mindMap ? 2 : 1) : 0), columnCount);
-	setShortcut(combination, action);
-	setAppearance(icon, name, backgroundImage, backgroundColor, textColor); // Will emit propertiesChanged(this)
+    // Compute Default Values for When Loading the Properties:
+    QString defaultBackgroundColor = (backgroundColorSetting().isValid() ? backgroundColorSetting().name() : &quot;&quot;);
+    QString defaultTextColor       = (textColorSetting().isValid()       ? textColorSetting().name()       : &quot;&quot;);
+
+    // Load the Properties:
+    QString icon = XMLWork::getElementText(properties, &quot;icon&quot;, this-&gt;icon());
+    QString name = XMLWork::getElementText(properties, &quot;name&quot;, basketName());
+
+    QDomElement appearance = XMLWork::getElement(properties, &quot;appearance&quot;);
+    // In 0.6.0-Alpha versions, there was a typo error: &quot;backround&quot; instead of &quot;background&quot;
+    QString backgroundImage       = appearance.attribute(&quot;backgroundImage&quot;, appearance.attribute(&quot;backroundImage&quot;, backgroundImageName()));
+    QString backgroundColorString = appearance.attribute(&quot;backgroundColor&quot;, appearance.attribute(&quot;backroundColor&quot;, defaultBackgroundColor));
+    QString textColorString       = appearance.attribute(&quot;textColor&quot;,      defaultTextColor);
+    QColor  backgroundColor = (backgroundColorString.isEmpty() ? QColor() : QColor(backgroundColorString));
+    QColor  textColor       = (textColorString.isEmpty()       ? QColor() : QColor(textColorString));
+
+    QDomElement disposition = XMLWork::getElement(properties, &quot;disposition&quot;);
+    bool free        = XMLWork::trueOrFalse(disposition.attribute(&quot;free&quot;,        XMLWork::trueOrFalse(isFreeLayout())));
+    int  columnCount =                       disposition.attribute(&quot;columnCount&quot;, QString::number(this-&gt;columnsCount())).toInt();
+    bool mindMap     = XMLWork::trueOrFalse(disposition.attribute(&quot;mindMap&quot;,     XMLWork::trueOrFalse(isMindMap())));
+
+    QDomElement shortcut = XMLWork::getElement(properties, &quot;shortcut&quot;);
+    QString actionStrings[] = { &quot;show&quot;, &quot;globalShow&quot;, &quot;globalSwitch&quot; };
+    KShortcut combination  = KShortcut(shortcut.attribute(
+                                           &quot;combination&quot;,
+                                           m_action-&gt;shortcut().primary().toString()));
+    QString   actionString =            shortcut.attribute(&quot;action&quot;);
+    int action = shortcutAction();
+    if (actionString == actionStrings[0]) action = 0;
+    if (actionString == actionStrings[1]) action = 1;
+    if (actionString == actionStrings[2]) action = 2;
+
+    QDomElement protection = XMLWork::getElement(properties, &quot;protection&quot;);
+    m_encryptionType = protection.attribute(&quot;type&quot;).toInt();
+    m_encryptionKey = protection.attribute(&quot;key&quot;);
+
+    // Apply the Properties:
+    setDisposition((free ? (mindMap ? 2 : 1) : 0), columnCount);
+    setShortcut(combination, action);
+    setAppearance(icon, name, backgroundImage, backgroundColor, textColor); // Will emit propertiesChanged(this)
 }
 
 void Basket::saveProperties(QDomDocument &amp;document, QDomElement &amp;properties)
 {
-	XMLWork::addElement( document, properties, &quot;name&quot;, basketName() );
-	XMLWork::addElement( document, properties, &quot;icon&quot;, icon()       );
+    XMLWork::addElement(document, properties, &quot;name&quot;, basketName());
+    XMLWork::addElement(document, properties, &quot;icon&quot;, icon());
 
-	QDomElement appearance = document.createElement(&quot;appearance&quot;);
-	properties.appendChild(appearance);
-	appearance.setAttribute( &quot;backgroundImage&quot;, backgroundImageName() );
-	appearance.setAttribute( &quot;backgroundColor&quot;, backgroundColorSetting().isValid() ? backgroundColorSetting().name() : &quot;&quot; );
-	appearance.setAttribute( &quot;textColor&quot;,       textColorSetting().isValid()       ? textColorSetting().name()       : &quot;&quot; );
+    QDomElement appearance = document.createElement(&quot;appearance&quot;);
+    properties.appendChild(appearance);
+    appearance.setAttribute(&quot;backgroundImage&quot;, backgroundImageName());
+    appearance.setAttribute(&quot;backgroundColor&quot;, backgroundColorSetting().isValid() ? backgroundColorSetting().name() : &quot;&quot;);
+    appearance.setAttribute(&quot;textColor&quot;,       textColorSetting().isValid()       ? textColorSetting().name()       : &quot;&quot;);
 
-	QDomElement disposition = document.createElement(&quot;disposition&quot;);
-	properties.appendChild(disposition);
-	disposition.setAttribute( &quot;free&quot;,        XMLWork::trueOrFalse(isFreeLayout()) );
-	disposition.setAttribute( &quot;columnCount&quot;, QString::number(columnsCount())      );
-	disposition.setAttribute( &quot;mindMap&quot;,     XMLWork::trueOrFalse(isMindMap())    );
+    QDomElement disposition = document.createElement(&quot;disposition&quot;);
+    properties.appendChild(disposition);
+    disposition.setAttribute(&quot;free&quot;,        XMLWork::trueOrFalse(isFreeLayout()));
+    disposition.setAttribute(&quot;columnCount&quot;, QString::number(columnsCount()));
+    disposition.setAttribute(&quot;mindMap&quot;,     XMLWork::trueOrFalse(isMindMap()));
 
-	QDomElement shortcut = document.createElement(&quot;shortcut&quot;);
-	properties.appendChild(shortcut);
-	QString actionStrings[] = { &quot;show&quot;, &quot;globalShow&quot;, &quot;globalSwitch&quot; };
-	shortcut.setAttribute( &quot;combination&quot;, m_action-&gt;shortcut().primary().toString());
-	shortcut.setAttribute( &quot;action&quot;,      actionStrings[shortcutAction()]         );
+    QDomElement shortcut = document.createElement(&quot;shortcut&quot;);
+    properties.appendChild(shortcut);
+    QString actionStrings[] = { &quot;show&quot;, &quot;globalShow&quot;, &quot;globalSwitch&quot; };
+    shortcut.setAttribute(&quot;combination&quot;, m_action-&gt;shortcut().primary().toString());
+    shortcut.setAttribute(&quot;action&quot;,      actionStrings[shortcutAction()]);
 
-	QDomElement protection = document.createElement(&quot;protection&quot;);
-	properties.appendChild(protection);
-	protection.setAttribute( &quot;type&quot;, m_encryptionType );
-	protection.setAttribute( &quot;key&quot;,  m_encryptionKey );
+    QDomElement protection = document.createElement(&quot;protection&quot;);
+    properties.appendChild(protection);
+    protection.setAttribute(&quot;type&quot;, m_encryptionType);
+    protection.setAttribute(&quot;key&quot;,  m_encryptionKey);
 }
 
 void Basket::subscribeBackgroundImages()
 {
-	if (!m_backgroundImageName.isEmpty()) {
-		Global::backgroundManager-&gt;subscribe(m_backgroundImageName);
-		Global::backgroundManager-&gt;subscribe(m_backgroundImageName, this-&gt;backgroundColor());
-		Global::backgroundManager-&gt;subscribe(m_backgroundImageName, selectionRectInsideColor());
-		m_backgroundPixmap         = Global::backgroundManager-&gt;pixmap(m_backgroundImageName);
-		m_opaqueBackgroundPixmap   = Global::backgroundManager-&gt;opaquePixmap(m_backgroundImageName, this-&gt;backgroundColor());
-		m_selectedBackgroundPixmap = Global::backgroundManager-&gt;opaquePixmap(m_backgroundImageName, selectionRectInsideColor());
-		m_backgroundTiled          = Global::backgroundManager-&gt;tiled(m_backgroundImageName);
-	}
+    if (!m_backgroundImageName.isEmpty()) {
+        Global::backgroundManager-&gt;subscribe(m_backgroundImageName);
+        Global::backgroundManager-&gt;subscribe(m_backgroundImageName, this-&gt;backgroundColor());
+        Global::backgroundManager-&gt;subscribe(m_backgroundImageName, selectionRectInsideColor());
+        m_backgroundPixmap         = Global::backgroundManager-&gt;pixmap(m_backgroundImageName);
+        m_opaqueBackgroundPixmap   = Global::backgroundManager-&gt;opaquePixmap(m_backgroundImageName, this-&gt;backgroundColor());
+        m_selectedBackgroundPixmap = Global::backgroundManager-&gt;opaquePixmap(m_backgroundImageName, selectionRectInsideColor());
+        m_backgroundTiled          = Global::backgroundManager-&gt;tiled(m_backgroundImageName);
+    }
 }
 
 void Basket::unsubscribeBackgroundImages()
 {
-	if (hasBackgroundImage()) {
-		Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName);
-		Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName, this-&gt;backgroundColor());
-		Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName, selectionRectInsideColor());
-		m_backgroundPixmap         = 0;
-		m_opaqueBackgroundPixmap   = 0;
-		m_selectedBackgroundPixmap = 0;
-	}
+    if (hasBackgroundImage()) {
+        Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName);
+        Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName, this-&gt;backgroundColor());
+        Global::backgroundManager-&gt;unsubscribe(m_backgroundImageName, selectionRectInsideColor());
+        m_backgroundPixmap         = 0;
+        m_opaqueBackgroundPixmap   = 0;
+        m_selectedBackgroundPixmap = 0;
+    }
 }
 
 void Basket::setAppearance(const QString &amp;icon, const QString &amp;name, const QString &amp;backgroundImage, const QColor &amp;backgroundColor, const QColor &amp;textColor)
 {
-	unsubscribeBackgroundImages();
+    unsubscribeBackgroundImages();
 
-	m_icon                   = icon;
-	m_basketName             = name;
-	m_backgroundImageName    = backgroundImage;
-	m_backgroundColorSetting = backgroundColor;
-	m_textColorSetting       = textColor;
+    m_icon                   = icon;
+    m_basketName             = name;
+    m_backgroundImageName    = backgroundImage;
+    m_backgroundColorSetting = backgroundColor;
+    m_textColorSetting       = textColor;
 
-	// Where is this shown?
-	m_action-&gt;setText(&quot;BASKET SHORTCUT: &quot; + name);
+    // Where is this shown?
+    m_action-&gt;setText(&quot;BASKET SHORTCUT: &quot; + name);
 
-	// Basket should ALWAYS have an icon (the &quot;basket&quot; icon by default):
+    // Basket should ALWAYS have an icon (the &quot;basket&quot; icon by default):
     QPixmap iconTest = KIconLoader::global()-&gt;loadIcon(
-        m_icon, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
-        QStringList(), 0L, /*canReturnNull=*/true
-        );
-	if (iconTest.isNull())
-		m_icon = &quot;basket&quot;;
-
-	// We don't request the background images if it's not loaded yet (to make the application startup fast).
-	// When the basket is loading (because requested by the user: he/she want to access it)
-	// it load the properties, subscribe to (and then load) the images, update the &quot;Loading...&quot; message with the image,
-	// load all the notes and it's done!
-	if (m_loadingLaunched)
-		subscribeBackgroundImages();
-
-	recomputeAllStyles(); // If a note have a tag with the same background color as the basket one, then display a &quot;...&quot;
-	recomputeBlankRects(); // See the drawing of blank areas in Basket::drawContents()
-	unbufferizeAll();
-	updateContents();
-
-	if (isDuringEdit() &amp;&amp; m_editor-&gt;widget()) {
-		QPalette palette;
-		palette.setColor(m_editor-&gt;widget()-&gt;backgroundRole(), m_editor-&gt;note()-&gt;backgroundColor());
-		palette.setColor(m_editor-&gt;widget()-&gt;foregroundRole(), m_editor-&gt;note()-&gt;textColor());
-		m_editor-&gt;widget()-&gt;setPalette(palette);
-	}
+                           m_icon, KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
+                           QStringList(), 0L, /*canReturnNull=*/true
+                       );
+    if (iconTest.isNull())
+        m_icon = &quot;basket&quot;;
+
+    // We don't request the background images if it's not loaded yet (to make the application startup fast).
+    // When the basket is loading (because requested by the user: he/she want to access it)
+    // it load the properties, subscribe to (and then load) the images, update the &quot;Loading...&quot; message with the image,
+    // load all the notes and it's done!
+    if (m_loadingLaunched)
+        subscribeBackgroundImages();
+
+    recomputeAllStyles(); // If a note have a tag with the same background color as the basket one, then display a &quot;...&quot;
+    recomputeBlankRects(); // See the drawing of blank areas in Basket::drawContents()
+    unbufferizeAll();
+    updateContents();
+
+    if (isDuringEdit() &amp;&amp; m_editor-&gt;widget()) {
+        QPalette palette;
+        palette.setColor(m_editor-&gt;widget()-&gt;backgroundRole(), m_editor-&gt;note()-&gt;backgroundColor());
+        palette.setColor(m_editor-&gt;widget()-&gt;foregroundRole(), m_editor-&gt;note()-&gt;textColor());
+        m_editor-&gt;widget()-&gt;setPalette(palette);
+    }
 
-	emit propertiesChanged(this);
+    emit propertiesChanged(this);
 }
 
 void Basket::setDisposition(int disposition, int columnCount)
 {
-	static const int COLUMNS_LAYOUT  = 0;
-	static const int FREE_LAYOUT     = 1;
-	static const int MINDMAPS_LAYOUT = 2;
-
-	int currentDisposition = (isFreeLayout() ? (isMindMap() ? MINDMAPS_LAYOUT : FREE_LAYOUT) : COLUMNS_LAYOUT);
-
-	if (currentDisposition == COLUMNS_LAYOUT &amp;&amp; disposition == COLUMNS_LAYOUT) {
-		if (firstNote() &amp;&amp; columnCount &gt; m_columnsCount) {
-			// Insert each new columns:
-			for (int i = m_columnsCount; i &lt; columnCount; ++i) {
-				Note *newColumn = new Note(this);
-				insertNote(newColumn, /*clicked=*/lastNote(), /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
-			}
-		} else if (firstNote() &amp;&amp; columnCount &lt; m_columnsCount) {
-			Note *column = firstNote();
-			Note *cuttedNotes = 0;
-			for (int i = 1; i &lt;= m_columnsCount; ++i) {
-				Note *columnToRemove = column;
-				column = column-&gt;next();
-				if (i &gt; columnCount) {
-					// Remove the columns that are too much:
-					unplugNote(columnToRemove);
-					// &quot;Cut&quot; the content in the columns to be deleted:
-					if (columnToRemove-&gt;firstChild()) {
-						for (Note *it = columnToRemove-&gt;firstChild(); it; it = it-&gt;next())
-							it-&gt;setParentNote(0);
-						if (!cuttedNotes)
-							cuttedNotes = columnToRemove-&gt;firstChild();
-						else {
-							Note *lastCuttedNote = cuttedNotes;
-							while (lastCuttedNote-&gt;next())
-								lastCuttedNote = lastCuttedNote-&gt;next();
-							lastCuttedNote-&gt;setNext(columnToRemove-&gt;firstChild());
-							columnToRemove-&gt;firstChild()-&gt;setPrev(lastCuttedNote);
-						}
-						columnToRemove-&gt;setFirstChild(0);
-					}
-				}
-			}
-			// Paste the content in the last column:
-			if (cuttedNotes)
-				insertNote(cuttedNotes, /*clicked=*/lastNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
-			unselectAll();
-		}
-		if (columnCount != m_columnsCount) {
-			m_columnsCount = (columnCount &lt;= 0 ? 1 : columnCount);
-			equalizeColumnSizes(); // Will relayoutNotes()
-		}
-	} else if (currentDisposition == COLUMNS_LAYOUT &amp;&amp; (disposition == FREE_LAYOUT || disposition == MINDMAPS_LAYOUT)) {
-		Note *column = firstNote();
-		m_columnsCount = 0; // Now, so relayoutNotes() will not relayout the free notes as if they were columns!
-		while (column) {
-			// Move all childs on the first level:
-			Note *nextColumn = column-&gt;next();
-			ungroupNote(column);
-			column = nextColumn;
-		}
-		unselectAll();
-		m_mindMap = (disposition == MINDMAPS_LAYOUT);
-		relayoutNotes(true);
-	} else if ((currentDisposition == FREE_LAYOUT || currentDisposition == MINDMAPS_LAYOUT) &amp;&amp; disposition == COLUMNS_LAYOUT) {
-		if (firstNote()) {
-			// TODO: Reorder notes!
-			// Remove all notes (but keep a reference to them, we're not crazy ;-) ):
-			Note *notes = m_firstNote;
-			m_firstNote = 0;
-			m_count = 0;
-			m_countFounds = 0;
-			// Insert the number of columns that is needed:
-			Note *lastInsertedColumn = 0;
-			for (int i = 0; i &lt; columnCount; ++i) {
-				Note *column = new Note(this);
-				if (lastInsertedColumn)
-					insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
-				else
-					m_firstNote = column;
-				lastInsertedColumn = column;
-			}
-			// Reinsert the old notes in the first column:
-			insertNote(notes, /*clicked=*/firstNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
-			unselectAll();
-		} else {
-			// Insert the number of columns that is needed:
-			Note *lastInsertedColumn = 0;
-			for (int i = 0; i &lt; columnCount; ++i) {
-				Note *column = new Note(this);
-				if (lastInsertedColumn)
-					insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
-				else
-					m_firstNote = column;
-				lastInsertedColumn = column;
-			}
-		}
-		m_columnsCount = (columnCount &lt;= 0 ? 1 : columnCount);
-		equalizeColumnSizes(); // Will relayoutNotes()
-	}
+    static const int COLUMNS_LAYOUT  = 0;
+    static const int FREE_LAYOUT     = 1;
+    static const int MINDMAPS_LAYOUT = 2;
+
+    int currentDisposition = (isFreeLayout() ? (isMindMap() ? MINDMAPS_LAYOUT : FREE_LAYOUT) : COLUMNS_LAYOUT);
+
+    if (currentDisposition == COLUMNS_LAYOUT &amp;&amp; disposition == COLUMNS_LAYOUT) {
+        if (firstNote() &amp;&amp; columnCount &gt; m_columnsCount) {
+            // Insert each new columns:
+            for (int i = m_columnsCount; i &lt; columnCount; ++i) {
+                Note *newColumn = new Note(this);
+                insertNote(newColumn, /*clicked=*/lastNote(), /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+            }
+        } else if (firstNote() &amp;&amp; columnCount &lt; m_columnsCount) {
+            Note *column = firstNote();
+            Note *cuttedNotes = 0;
+            for (int i = 1; i &lt;= m_columnsCount; ++i) {
+                Note *columnToRemove = column;
+                column = column-&gt;next();
+                if (i &gt; columnCount) {
+                    // Remove the columns that are too much:
+                    unplugNote(columnToRemove);
+                    // &quot;Cut&quot; the content in the columns to be deleted:
+                    if (columnToRemove-&gt;firstChild()) {
+                        for (Note *it = columnToRemove-&gt;firstChild(); it; it = it-&gt;next())
+                            it-&gt;setParentNote(0);
+                        if (!cuttedNotes)
+                            cuttedNotes = columnToRemove-&gt;firstChild();
+                        else {
+                            Note *lastCuttedNote = cuttedNotes;
+                            while (lastCuttedNote-&gt;next())
+                                lastCuttedNote = lastCuttedNote-&gt;next();
+                            lastCuttedNote-&gt;setNext(columnToRemove-&gt;firstChild());
+                            columnToRemove-&gt;firstChild()-&gt;setPrev(lastCuttedNote);
+                        }
+                        columnToRemove-&gt;setFirstChild(0);
+                    }
+                }
+            }
+            // Paste the content in the last column:
+            if (cuttedNotes)
+                insertNote(cuttedNotes, /*clicked=*/lastNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
+            unselectAll();
+        }
+        if (columnCount != m_columnsCount) {
+            m_columnsCount = (columnCount &lt;= 0 ? 1 : columnCount);
+            equalizeColumnSizes(); // Will relayoutNotes()
+        }
+    } else if (currentDisposition == COLUMNS_LAYOUT &amp;&amp; (disposition == FREE_LAYOUT || disposition == MINDMAPS_LAYOUT)) {
+        Note *column = firstNote();
+        m_columnsCount = 0; // Now, so relayoutNotes() will not relayout the free notes as if they were columns!
+        while (column) {
+            // Move all childs on the first level:
+            Note *nextColumn = column-&gt;next();
+            ungroupNote(column);
+            column = nextColumn;
+        }
+        unselectAll();
+        m_mindMap = (disposition == MINDMAPS_LAYOUT);
+        relayoutNotes(true);
+    } else if ((currentDisposition == FREE_LAYOUT || currentDisposition == MINDMAPS_LAYOUT) &amp;&amp; disposition == COLUMNS_LAYOUT) {
+        if (firstNote()) {
+            // TODO: Reorder notes!
+            // Remove all notes (but keep a reference to them, we're not crazy ;-) ):
+            Note *notes = m_firstNote;
+            m_firstNote = 0;
+            m_count = 0;
+            m_countFounds = 0;
+            // Insert the number of columns that is needed:
+            Note *lastInsertedColumn = 0;
+            for (int i = 0; i &lt; columnCount; ++i) {
+                Note *column = new Note(this);
+                if (lastInsertedColumn)
+                    insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+                else
+                    m_firstNote = column;
+                lastInsertedColumn = column;
+            }
+            // Reinsert the old notes in the first column:
+            insertNote(notes, /*clicked=*/firstNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
+            unselectAll();
+        } else {
+            // Insert the number of columns that is needed:
+            Note *lastInsertedColumn = 0;
+            for (int i = 0; i &lt; columnCount; ++i) {
+                Note *column = new Note(this);
+                if (lastInsertedColumn)
+                    insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+                else
+                    m_firstNote = column;
+                lastInsertedColumn = column;
+            }
+        }
+        m_columnsCount = (columnCount &lt;= 0 ? 1 : columnCount);
+        equalizeColumnSizes(); // Will relayoutNotes()
+    }
 }
 
 void Basket::equalizeColumnSizes()
 {
-	if (!firstNote())
-		return;
-
-	// Necessary to know the available space;
-	relayoutNotes(true);
-
-	int availableSpace = visibleWidth();
-	int columnWidth = (visibleWidth() - (columnsCount()-1)*Note::GROUP_WIDTH) / columnsCount();
-	int columnCount = columnsCount();
-	Note *column = firstNote();
-	while (column) {
-		int minGroupWidth = column-&gt;minRight() - column-&gt;x();
-		if (minGroupWidth &gt; columnWidth) {
-			availableSpace -= minGroupWidth;
-			--columnCount;
-		}
-		column = column-&gt;next();
-	}
-	columnWidth = (availableSpace - (columnsCount()-1)*Note::GROUP_WIDTH) / columnCount;
-
-	column = firstNote();
-	while (column) {
-		int minGroupWidth = column-&gt;minRight() - column-&gt;x();
-		if (minGroupWidth &gt; columnWidth)
-			column-&gt;setGroupWidth(minGroupWidth);
-		else
-			column-&gt;setGroupWidth(columnWidth);
-		column = column-&gt;next();
-	}
-
-	relayoutNotes(true);
+    if (!firstNote())
+        return;
+
+    // Necessary to know the available space;
+    relayoutNotes(true);
+
+    int availableSpace = visibleWidth();
+    int columnWidth = (visibleWidth() - (columnsCount() - 1) * Note::GROUP_WIDTH) / columnsCount();
+    int columnCount = columnsCount();
+    Note *column = firstNote();
+    while (column) {
+        int minGroupWidth = column-&gt;minRight() - column-&gt;x();
+        if (minGroupWidth &gt; columnWidth) {
+            availableSpace -= minGroupWidth;
+            --columnCount;
+        }
+        column = column-&gt;next();
+    }
+    columnWidth = (availableSpace - (columnsCount() - 1) * Note::GROUP_WIDTH) / columnCount;
+
+    column = firstNote();
+    while (column) {
+        int minGroupWidth = column-&gt;minRight() - column-&gt;x();
+        if (minGroupWidth &gt; columnWidth)
+            column-&gt;setGroupWidth(minGroupWidth);
+        else
+            column-&gt;setGroupWidth(columnWidth);
+        column = column-&gt;next();
+    }
+
+    relayoutNotes(true);
 }
 
 void Basket::enableActions()
 {
-	Global::bnpView-&gt;enableActions();
-	setFocusPolicy(isLocked() ? Qt::NoFocus : Qt::StrongFocus);
-	if (isLocked())
-		viewport()-&gt;setCursor(Qt::ArrowCursor); // When locking, the cursor stays the last form it was
+    Global::bnpView-&gt;enableActions();
+    setFocusPolicy(isLocked() ? Qt::NoFocus : Qt::StrongFocus);
+    if (isLocked())
+        viewport()-&gt;setCursor(Qt::ArrowCursor); // When locking, the cursor stays the last form it was
 }
 
 bool Basket::save()
 {
-	if (!m_loaded)
-		return false;
+    if (!m_loaded)
+        return false;
 
-	DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: Saving...&quot;;
+    DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: Saving...&quot;;
 
-	// Create Document:
-	QDomDocument document(/*doctype=*/&quot;basket&quot;);
-	QDomElement root = document.createElement(&quot;basket&quot;);
-	document.appendChild(root);
+    // Create Document:
+    QDomDocument document(/*doctype=*/&quot;basket&quot;);
+    QDomElement root = document.createElement(&quot;basket&quot;);
+    document.appendChild(root);
 
-	// Create Properties Element and Populate It:
-	QDomElement properties = document.createElement(&quot;properties&quot;);
-	saveProperties(document, properties);
-	root.appendChild(properties);
+    // Create Properties Element and Populate It:
+    QDomElement properties = document.createElement(&quot;properties&quot;);
+    saveProperties(document, properties);
+    root.appendChild(properties);
 
-	// Create Notes Element and Populate It:
-	QDomElement notes = document.createElement(&quot;notes&quot;);
-	saveNotes(document, notes, 0);
-	root.appendChild(notes);
+    // Create Notes Element and Populate It:
+    QDomElement notes = document.createElement(&quot;notes&quot;);
+    saveNotes(document, notes, 0);
+    root.appendChild(notes);
 
-	// Write to Disk:
-	if(!saveToFile(fullPath() + &quot;.basket&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString()))
-	{
-		DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to save&lt;/font&gt;!&quot;;
-		return false;
-	}
+    // Write to Disk:
+    if (!saveToFile(fullPath() + &quot;.basket&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString())) {
+        DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to save&lt;/font&gt;!&quot;;
+        return false;
+    }
 
-	Global::bnpView-&gt;setUnsavedStatus(false);
-	return true;
+    Global::bnpView-&gt;setUnsavedStatus(false);
+    return true;
 }
 
 void Basket::aboutToBeActivated()
 {
-	if (m_finishLoadOnFirstShow) {
-		FOR_EACH_NOTE (note)
-			note-&gt;finishLazyLoad();
+    if (m_finishLoadOnFirstShow) {
+        FOR_EACH_NOTE(note)
+        note-&gt;finishLazyLoad();
 
-		//relayoutNotes(/*animate=*/false);
-		setFocusedNote(0); // So that during the focusInEvent that will come shortly, the FIRST note is focused.
+        //relayoutNotes(/*animate=*/false);
+        setFocusedNote(0); // So that during the focusInEvent that will come shortly, the FIRST note is focused.
 
-		if (Settings::playAnimations() &amp;&amp; !decoration()-&gt;filterBar()-&gt;filterData().isFiltering &amp;&amp; Global::bnpView-&gt;currentBasket() == this) // No animation when filtering all!
-			animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
+        if (Settings::playAnimations() &amp;&amp; !decoration()-&gt;filterBar()-&gt;filterData().isFiltering &amp;&amp; Global::bnpView-&gt;currentBasket() == this) // No animation when filtering all!
+            animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
 
-		m_finishLoadOnFirstShow = false;
-	}
+        m_finishLoadOnFirstShow = false;
+    }
 }
 
 void Basket::reload()
 {
-	closeEditor();
-	unbufferizeAll(); // Keep the memory footprint low
+    closeEditor();
+    unbufferizeAll(); // Keep the memory footprint low
 
-	m_firstNote = 0;
+    m_firstNote = 0;
 
-	m_loaded = false;
-	m_loadingLaunched = false;
+    m_loaded = false;
+    m_loadingLaunched = false;
 
-	updateContents();
+    updateContents();
 }
 
 void Basket::load()
 {
-	// Load only once:
-	if (m_loadingLaunched)
-		return;
-	m_loadingLaunched = true;
+    // Load only once:
+    if (m_loadingLaunched)
+        return;
+    m_loadingLaunched = true;
 
-	DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: Loading...&quot;;
-	QDomDocument *doc = 0;
-	QString content;
+    DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: Loading...&quot;;
+    QDomDocument *doc = 0;
+    QString content;
 
     // Load properties
-	if (loadFromFile(fullPath() + &quot;.basket&quot;, &amp;content)) {
-		doc = new QDomDocument(&quot;basket&quot;);
-		if ( ! doc-&gt;setContent(content) ) {
-			DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to parse XML&lt;/font&gt;!&quot;;
-			delete doc;
-			doc = 0;
-		}
-	}
-	if(isEncrypted())
-		DEBUG_WIN &lt;&lt; &quot;Basket is encrypted.&quot;;
-	if ( ! doc) {
-		DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to load&lt;/font&gt;!&quot;;
-		m_loadingLaunched = false;
-		if (isEncrypted())
-			m_locked = true;
-		Global::bnpView-&gt;notesStateChanged(); // Show &quot;Locked&quot; instead of &quot;Loading...&quot; in the statusbar
-		return;
-	}
-	m_locked = false;
-
-	QDomElement docElem = doc-&gt;documentElement();
-	QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
-
-	loadProperties(properties); // Since we are loading, this time the background image will also be loaded!
-	// Now that the background image is loaded and subscribed, we display it during the load process:
-	delete doc;
-	updateContents();
-//	kapp-&gt;processEvents();
-
-	//BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
-	QDomElement notes = XMLWork::getElement(docElem, &quot;notes&quot;);
-	if (notes.isNull())
-		notes = XMLWork::getElement(docElem, &quot;items&quot;);
-	m_watcher-&gt;stopScan();
-	m_shouldConvertPlainTextNotes = false; // Convert Pre-0.6.0 baskets: plain text notes should be converted to rich text ones once all is loaded!
+    if (loadFromFile(fullPath() + &quot;.basket&quot;, &amp;content)) {
+        doc = new QDomDocument(&quot;basket&quot;);
+        if (! doc-&gt;setContent(content)) {
+            DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to parse XML&lt;/font&gt;!&quot;;
+            delete doc;
+            doc = 0;
+        }
+    }
+    if (isEncrypted())
+        DEBUG_WIN &lt;&lt; &quot;Basket is encrypted.&quot;;
+    if (! doc) {
+        DEBUG_WIN &lt;&lt; &quot;Basket[&quot; + folderName() + &quot;]: &lt;font color=red&gt;FAILED to load&lt;/font&gt;!&quot;;
+        m_loadingLaunched = false;
+        if (isEncrypted())
+            m_locked = true;
+        Global::bnpView-&gt;notesStateChanged(); // Show &quot;Locked&quot; instead of &quot;Loading...&quot; in the statusbar
+        return;
+    }
+    m_locked = false;
+
+    QDomElement docElem = doc-&gt;documentElement();
+    QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
+
+    loadProperties(properties); // Since we are loading, this time the background image will also be loaded!
+    // Now that the background image is loaded and subscribed, we display it during the load process:
+    delete doc;
+    updateContents();
+//  kapp-&gt;processEvents();
+
+    //BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
+    QDomElement notes = XMLWork::getElement(docElem, &quot;notes&quot;);
+    if (notes.isNull())
+        notes = XMLWork::getElement(docElem, &quot;items&quot;);
+    m_watcher-&gt;stopScan();
+    m_shouldConvertPlainTextNotes = false; // Convert Pre-0.6.0 baskets: plain text notes should be converted to rich text ones once all is loaded!
 
 
     // Load notes
-	m_finishLoadOnFirstShow = (Global::bnpView-&gt;currentBasket() != this);
-	loadNotes(notes, 0L);
-	if (m_shouldConvertPlainTextNotes)
-		convertTexts();
-	m_watcher-&gt;startScan();
-
-	signalCountsChanged();
-	if (isColumnsLayout()) {
-		// Count the number of columns:
-		int columnsCount = 0;
-		Note *column = firstNote();
-		while (column) {
-			++columnsCount;
-			column = column-&gt;next();
-		}
-		m_columnsCount = columnsCount;
-	}
-
-	relayoutNotes(false);
-
-	// On application start, the current basket is not focused yet, so the focus rectangle is not shown when calling focusANote():
-	if (Global::bnpView-&gt;currentBasket() == this)
-		setFocus();
-	focusANote();
-
-	if (Settings::playAnimations() &amp;&amp; !decoration()-&gt;filterBar()-&gt;filterData().isFiltering &amp;&amp; Global::bnpView-&gt;currentBasket() == this) // No animation when filtering all!
-		animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
-	else
-		m_loaded = true;
-	enableActions();
+    m_finishLoadOnFirstShow = (Global::bnpView-&gt;currentBasket() != this);
+    loadNotes(notes, 0L);
+    if (m_shouldConvertPlainTextNotes)
+        convertTexts();
+    m_watcher-&gt;startScan();
+
+    signalCountsChanged();
+    if (isColumnsLayout()) {
+        // Count the number of columns:
+        int columnsCount = 0;
+        Note *column = firstNote();
+        while (column) {
+            ++columnsCount;
+            column = column-&gt;next();
+        }
+        m_columnsCount = columnsCount;
+    }
+
+    relayoutNotes(false);
+
+    // On application start, the current basket is not focused yet, so the focus rectangle is not shown when calling focusANote():
+    if (Global::bnpView-&gt;currentBasket() == this)
+        setFocus();
+    focusANote();
+
+    if (Settings::playAnimations() &amp;&amp; !decoration()-&gt;filterBar()-&gt;filterData().isFiltering &amp;&amp; Global::bnpView-&gt;currentBasket() == this) // No animation when filtering all!
+        animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
+    else
+        m_loaded = true;
+    enableActions();
 }
 
 void Basket::filterAgain(bool andEnsureVisible/* = true*/)
 {
-	newFilter(decoration()-&gt;filterData(), andEnsureVisible);
+    newFilter(decoration()-&gt;filterData(), andEnsureVisible);
 }
 
 void Basket::filterAgainDelayed()
 {
-	QTimer::singleShot( 0, this, SLOT(filterAgain()) );
+    QTimer::singleShot(0, this, SLOT(filterAgain()));
 }
 
 void Basket::newFilter(const FilterData &amp;data, bool andEnsureVisible/* = true*/)
 {
-	if (!isLoaded())
-		return;
+    if (!isLoaded())
+        return;
 
 //StopWatch::start(20);
 
-	m_countFounds = 0;
-	for (Note *note = firstNote(); note; note = note-&gt;next())
-		m_countFounds += note-&gt;newFilter(data);
+    m_countFounds = 0;
+    for (Note *note = firstNote(); note; note = note-&gt;next())
+        m_countFounds += note-&gt;newFilter(data);
 
-	relayoutNotes(true);
-	signalCountsChanged();
+    relayoutNotes(true);
+    signalCountsChanged();
 
-	if (hasFocus())   // if (!hasFocus()), focusANote() will be called at focusInEvent()
-		focusANote(); //  so, we avoid de-focus a note if it will be re-shown soon
-	if (andEnsureVisible &amp;&amp; m_focusedNote != 0L)
-		ensureNoteVisible(m_focusedNote);
+    if (hasFocus())   // if (!hasFocus()), focusANote() will be called at focusInEvent()
+        focusANote(); //  so, we avoid de-focus a note if it will be re-shown soon
+    if (andEnsureVisible &amp;&amp; m_focusedNote != 0L)
+        ensureNoteVisible(m_focusedNote);
 
-	Global::bnpView-&gt;setFiltering(data.isFiltering);
+    Global::bnpView-&gt;setFiltering(data.isFiltering);
 
 //StopWatch::check(20);
 }
 
 bool Basket::isFiltering()
 {
-	return decoration()-&gt;filterBar()-&gt;filterData().isFiltering;
+    return decoration()-&gt;filterBar()-&gt;filterData().isFiltering;
 }
 
 
 
 QString Basket::fullPath()
 {
-	return Global::basketsFolder() + folderName();
+    return Global::basketsFolder() + folderName();
 }
 
 QString Basket::fullPathForFileName(const QString &amp;fileName)
 {
-	return fullPath() + fileName;
+    return fullPath() + fileName;
 }
 
 /*static*/ QString Basket::fullPathForFolderName(const QString &amp;folderName)
 {
-	return Global::basketsFolder() + folderName;
+    return Global::basketsFolder() + folderName;
 }
 
 
@@ -1299,96 +1297,96 @@ void Basket::setShortcut(KShortcut shortcut, int action)
 {
     if (action &gt; 0) {
         m_action-&gt;setGlobalShortcut(
-	    shortcut,
+            shortcut,
             KAction::ActiveShortcut | KAction::DefaultShortcut,
             KAction::NoAutoloading
-            );
+        );
     }
     m_shortcutAction = action;
 }
 
 void Basket::activatedShortcut()
 {
-	Global::bnpView-&gt;setCurrentBasket(this);
+    Global::bnpView-&gt;setCurrentBasket(this);
 
-	if (m_shortcutAction == 1)
-		Global::bnpView-&gt;setActive(true);
+    if (m_shortcutAction == 1)
+        Global::bnpView-&gt;setActive(true);
 }
 
 void Basket::signalCountsChanged()
 {
-	if (!m_timerCountsChanged.isActive()) {
-		m_timerCountsChanged.setSingleShot(true);
-		m_timerCountsChanged.start(0);
-	}
+    if (!m_timerCountsChanged.isActive()) {
+        m_timerCountsChanged.setSingleShot(true);
+        m_timerCountsChanged.start(0);
+    }
 }
 
 void Basket::countsChangedTimeOut()
 {
-	emit countsChanged(this);
+    emit countsChanged(this);
 }
 
 
 Basket::Basket(QWidget *parent, const QString &amp;folderName)
-    : Q3ScrollView(parent)
-    , m_noActionOnMouseRelease(false)
-    , m_ignoreCloseEditorOnNextMouseRelease(false)
-    , m_pressPos(-100, -100)
-    , m_canDrag(false)
-    , m_firstNote(0)
-    , m_columnsCount(1)
-    , m_mindMap(false)
-    , m_resizingNote(0L)
-    , m_pickedResizer(0)
-    , m_movingNote(0L)
-    , m_pickedHandle(0 , 0)
-    , m_clickedToInsert(0)
-    , m_zoneToInsert(0)
-    , m_posToInsert(-1 , -1)
-    , m_isInsertPopupMenu(false)
-    , m_insertMenuTitle(0)
-    , m_loaded(false)
-    , m_loadingLaunched(false)
-    , m_locked(false)
-    , m_decryptBox(0)
-    , m_button(0)
-    , m_encryptionType(NoEncryption)
+        : Q3ScrollView(parent)
+        , m_noActionOnMouseRelease(false)
+        , m_ignoreCloseEditorOnNextMouseRelease(false)
+        , m_pressPos(-100, -100)
+        , m_canDrag(false)
+        , m_firstNote(0)
+        , m_columnsCount(1)
+        , m_mindMap(false)
+        , m_resizingNote(0L)
+        , m_pickedResizer(0)
+        , m_movingNote(0L)
+        , m_pickedHandle(0 , 0)
+        , m_clickedToInsert(0)
+        , m_zoneToInsert(0)
+        , m_posToInsert(-1 , -1)
+        , m_isInsertPopupMenu(false)
+        , m_insertMenuTitle(0)
+        , m_loaded(false)
+        , m_loadingLaunched(false)
+        , m_locked(false)
+        , m_decryptBox(0)
+        , m_button(0)
+        , m_encryptionType(NoEncryption)
 #ifdef HAVE_LIBGPGME
-    , m_gpg(0)
+        , m_gpg(0)
 #endif
-    , m_backgroundPixmap(0)
-    , m_opaqueBackgroundPixmap(0)
-    , m_selectedBackgroundPixmap(0)
-    , m_action(0)
-    , m_shortcutAction(0)
-    , m_hoveredNote(0)
-    , m_hoveredZone(Note::None)
-    , m_lockedHovering(false)
-    , m_underMouse(false)
-    , m_inserterRect()
-    , m_inserterShown(false)
-    , m_inserterSplit(true)
-    , m_inserterTop(false)
-    , m_inserterGroup(false)
-    , m_isSelecting(false)
-    , m_selectionStarted(false)
-    , m_count(0)
-    , m_countFounds(0)
-    , m_countSelecteds(0)
-    , m_folderName(folderName)
-    , m_editor(0)
-    , m_leftEditorBorder(0)
-    , m_rightEditorBorder(0)
-    , m_redirectEditActions(false)
-    , m_editorWidth(-1)
-    , m_editorHeight(-1)
-    , m_doNotCloseEditor(false)
-    , m_isDuringDrag(false)
-    , m_draggedNotes()
-    , m_focusedNote(0)
-    , m_startOfShiftSelectionNote(0)
-    , m_finishLoadOnFirstShow(false)
-    , m_relayoutOnNextShow(false)
+        , m_backgroundPixmap(0)
+        , m_opaqueBackgroundPixmap(0)
+        , m_selectedBackgroundPixmap(0)
+        , m_action(0)
+        , m_shortcutAction(0)
+        , m_hoveredNote(0)
+        , m_hoveredZone(Note::None)
+        , m_lockedHovering(false)
+        , m_underMouse(false)
+        , m_inserterRect()
+        , m_inserterShown(false)
+        , m_inserterSplit(true)
+        , m_inserterTop(false)
+        , m_inserterGroup(false)
+        , m_isSelecting(false)
+        , m_selectionStarted(false)
+        , m_count(0)
+        , m_countFounds(0)
+        , m_countSelecteds(0)
+        , m_folderName(folderName)
+        , m_editor(0)
+        , m_leftEditorBorder(0)
+        , m_rightEditorBorder(0)
+        , m_redirectEditActions(false)
+        , m_editorWidth(-1)
+        , m_editorHeight(-1)
+        , m_doNotCloseEditor(false)
+        , m_isDuringDrag(false)
+        , m_draggedNotes()
+        , m_focusedNote(0)
+        , m_startOfShiftSelectionNote(0)
+        , m_finishLoadOnFirstShow(false)
+        , m_relayoutOnNextShow(false)
 {
     m_action = new KAction(this);
     connect(m_action, SIGNAL(triggered()), this, SLOT(activatedShortcut()));
@@ -1397,209 +1395,209 @@ Basket::Basket(QWidget *parent, const QString &amp;folderName)
     // global one)
     m_action-&gt;setShortcutConfigurable(false);
 
-	if (!m_folderName.endsWith(&quot;/&quot;))
-		m_folderName += &quot;/&quot;;
-
-	setFocusPolicy(Qt::StrongFocus);
-	setDragAutoScroll(true);
-
-	// By default, there is no corner widget: we set one for the corner area to be painted!
-	// If we don't set one and there are two scrollbars present, slowly resizing up the window show graphical glitches in that area!
-	m_cornerWidget = new QWidget(this);
-	setCornerWidget(m_cornerWidget);
-
-	viewport()-&gt;setAcceptDrops(true);
-	viewport()-&gt;setMouseTracking(true);
-	viewport()-&gt;setAutoFillBackground(false); // Do not clear the widget before paintEvent() because we always draw every pixels (faster and flicker-free)
-
-	// File Watcher:
-	m_watcher = new KDirWatch(this);
-	connect( m_watcher,       SIGNAL(dirty(const QString&amp;)),   this, SLOT(watchedFileModified(const QString&amp;)) );
-	connect( m_watcher,       SIGNAL(deleted(const QString&amp;)), this, SLOT(watchedFileDeleted(const QString&amp;))  );
-	connect( &amp;m_watcherTimer, SIGNAL(timeout()),               this, SLOT(updateModifiedNotes())               );
-
-	// Various Connections:
-	connect( &amp;m_animationTimer,           SIGNAL(timeout()),   this, SLOT(animateObjects())            );
-	connect( &amp;m_autoScrollSelectionTimer, SIGNAL(timeout()),   this, SLOT(doAutoScrollSelection())     );
-	connect( &amp;m_timerCountsChanged,       SIGNAL(timeout()),   this, SLOT(countsChangedTimeOut())      );
-	connect( &amp;m_inactivityAutoSaveTimer,  SIGNAL(timeout()),   this, SLOT(inactivityAutoSaveTimeout()) );
-	connect( &amp;m_inactivityAutoLockTimer,  SIGNAL(timeout()),   this, SLOT(inactivityAutoLockTimeout()) );
-	connect( this, SIGNAL(contentsMoving(int, int)), this, SLOT(contentsMoved()) );
+    if (!m_folderName.endsWith(&quot;/&quot;))
+        m_folderName += &quot;/&quot;;
+
+    setFocusPolicy(Qt::StrongFocus);
+    setDragAutoScroll(true);
+
+    // By default, there is no corner widget: we set one for the corner area to be painted!
+    // If we don't set one and there are two scrollbars present, slowly resizing up the window show graphical glitches in that area!
+    m_cornerWidget = new QWidget(this);
+    setCornerWidget(m_cornerWidget);
+
+    viewport()-&gt;setAcceptDrops(true);
+    viewport()-&gt;setMouseTracking(true);
+    viewport()-&gt;setAutoFillBackground(false); // Do not clear the widget before paintEvent() because we always draw every pixels (faster and flicker-free)
+
+    // File Watcher:
+    m_watcher = new KDirWatch(this);
+    connect(m_watcher,       SIGNAL(dirty(const QString&amp;)),   this, SLOT(watchedFileModified(const QString&amp;)));
+    connect(m_watcher,       SIGNAL(deleted(const QString&amp;)), this, SLOT(watchedFileDeleted(const QString&amp;)));
+    connect(&amp;m_watcherTimer, SIGNAL(timeout()),               this, SLOT(updateModifiedNotes()));
+
+    // Various Connections:
+    connect(&amp;m_animationTimer,           SIGNAL(timeout()),   this, SLOT(animateObjects()));
+    connect(&amp;m_autoScrollSelectionTimer, SIGNAL(timeout()),   this, SLOT(doAutoScrollSelection()));
+    connect(&amp;m_timerCountsChanged,       SIGNAL(timeout()),   this, SLOT(countsChangedTimeOut()));
+    connect(&amp;m_inactivityAutoSaveTimer,  SIGNAL(timeout()),   this, SLOT(inactivityAutoSaveTimeout()));
+    connect(&amp;m_inactivityAutoLockTimer,  SIGNAL(timeout()),   this, SLOT(inactivityAutoLockTimeout()));
+    connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(contentsMoved()));
 #ifdef HAVE_LIBGPGME
-	m_gpg = new KGpgMe();
+    m_gpg = new KGpgMe();
 #endif
-	m_locked = isFileEncrypted();
+    m_locked = isFileEncrypted();
 }
 
 void Basket::contentsMoved()
 {
-	// This slot is called BEFORE the content move, so we delay the hover effects:
-	QTimer::singleShot(0, this, SLOT(doHoverEffects()));
+    // This slot is called BEFORE the content move, so we delay the hover effects:
+    QTimer::singleShot(0, this, SLOT(doHoverEffects()));
 }
 
 void Basket::enterEvent(QEvent *)
 {
-	m_underMouse = true;
-	doHoverEffects();
+    m_underMouse = true;
+    doHoverEffects();
 }
 
 void Basket::leaveEvent(QEvent *)
 {
-	m_underMouse = false;
-	doHoverEffects();
+    m_underMouse = false;
+    doHoverEffects();
 
-	if (m_lockedHovering)
-		return;
+    if (m_lockedHovering)
+        return;
 
-	removeInserter();
-	if (m_hoveredNote) {
-		m_hoveredNote-&gt;setHovered(false);
-		m_hoveredNote-&gt;setHoveredZone(Note::None);
-		updateNote(m_hoveredNote);
-	}
-	m_hoveredNote = 0;
+    removeInserter();
+    if (m_hoveredNote) {
+        m_hoveredNote-&gt;setHovered(false);
+        m_hoveredNote-&gt;setHoveredZone(Note::None);
+        updateNote(m_hoveredNote);
+    }
+    m_hoveredNote = 0;
 }
 
 void Basket::setFocusIfNotInPopupMenu()
 {
-	if (!kapp-&gt;activePopupWidget()){
-		if (isDuringEdit())
-			m_editor-&gt;widget()-&gt;setFocus();
-		else
-			setFocus();
-	}
+    if (!kapp-&gt;activePopupWidget()) {
+        if (isDuringEdit())
+            m_editor-&gt;widget()-&gt;setFocus();
+        else
+            setFocus();
+    }
 }
 
 void Basket::contentsMousePressEvent(QMouseEvent *event)
 {
-	// If user click the basket, focus it!
-	// The focus is delayed because if the click results in showing a popup menu,
-	// the interface flicker by showing the focused rectangle (as the basket gets focus)
-	// and immediatly removing it (because the popup menu now have focus).
-	if (!isDuringEdit())
-		QTimer::singleShot(0, this, SLOT(setFocusIfNotInPopupMenu()));
-
-	// Convenient variables:
-	bool controlPressed = event-&gt;modifiers() &amp; Qt::ControlModifier;
-	bool shiftPressed   = event-&gt;modifiers() &amp; Qt::ShiftModifier;
-
-	// Do nothing if we disabled the click some milliseconds sooner.
-	// For instance when a popup menu has been closed with click, we should not do action:
-	if (event-&gt;button() == Qt::LeftButton &amp;&amp; (kapp-&gt;activePopupWidget() || m_lastDisableClick.msecsTo(QTime::currentTime()) &lt;= 80)) {
-		doHoverEffects();
-		m_noActionOnMouseRelease = true;
-		// But we allow to select:
-		// The code is the same as at the bottom of this method:
-		if (event-&gt;button() == Qt::LeftButton) {
-			m_selectionStarted = true;
-			m_selectionBeginPoint = event-&gt;pos();
-			m_selectionInvert = controlPressed || shiftPressed;
-		}
-		return;
-	}
-
-	// Figure out what is the clicked note and zone:
-	Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
-	Note::Zone zone = (clicked ? clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()) ) : Note::None);
-
-	// Popup Tags menu:
-	if (zone == Note::TagsArrow &amp;&amp; !controlPressed &amp;&amp; !shiftPressed &amp;&amp; event-&gt;button() != Qt::MidButton) {
-		if (!clicked-&gt;isSelected())
-			unselectAllBut(clicked);
-		setFocusedNote(clicked); /// /// ///
-		m_startOfShiftSelectionNote = clicked;
-		m_noActionOnMouseRelease = true;
-		popupTagsMenu(clicked);
-		return;
-	}
-
-	if (event-&gt;button() == Qt::LeftButton) {
-		// Prepare to allow drag and drop when moving mouse further:
-		if ( (zone == Note::Handle || zone == Note::Group) ||
-		     (clicked &amp;&amp; clicked-&gt;isSelected() &amp;&amp;
-		       (zone == Note::TagsArrow || zone == Note::Custom0 || zone == Note::Content || zone == Note::Link /**/ || zone &gt;= Note::Emblem0 /**/)) ) {
-			if (!shiftPressed &amp;&amp; !controlPressed) {
-				m_pressPos = event-&gt;pos(); // TODO: Allow to drag emblems to assign them to other notes. Then don't allow drag at Emblem0!!
-				m_canDrag  = true;
-				// Saving where we were editing, because during a drag, the mouse can fly over the text edit and move the cursor position:
-				if (m_editor &amp;&amp; m_editor-&gt;textEdit()) {
-					KTextEdit *editor = m_editor-&gt;textEdit();
-					m_textCursor = editor-&gt;textCursor();
-				}
-			}
-		}
-
-		// Initializing Resizer move:
-		if (zone == Note::Resizer) {
-			m_resizingNote  = clicked;
-			m_pickedResizer = event-&gt;pos().x() - clicked-&gt;rightLimit();
-			m_noActionOnMouseRelease = true;
-			m_lockedHovering = true;
-			return;
-		}
-
-		// Select note(s):
-		if (zone == Note::Handle || zone == Note::Group || (zone == Note::GroupExpander &amp;&amp; (controlPressed || shiftPressed))) {
-			Note *end = clicked;
-			if (clicked-&gt;isGroup() &amp;&amp; shiftPressed) {
-				if (clicked-&gt;contains(m_startOfShiftSelectionNote)) {
-					m_startOfShiftSelectionNote = clicked-&gt;firstRealChild();
-					end = clicked-&gt;lastRealChild();
-				} else if (clicked-&gt;firstRealChild()-&gt;isAfter(m_startOfShiftSelectionNote))
-					end = clicked-&gt;lastRealChild();
-				else
-					end = clicked-&gt;firstRealChild();
-			}
-			if (controlPressed &amp;&amp; shiftPressed)
-				selectRange(m_startOfShiftSelectionNote, end, /*unselectOthers=*/false);
-			else if (shiftPressed)
-				selectRange(m_startOfShiftSelectionNote, end);
-			else if (controlPressed)
-				clicked-&gt;setSelectedRecursively(!clicked-&gt;allSelected());
-			else if (!clicked-&gt;allSelected())
-				unselectAllBut(clicked);
-			setFocusedNote(end); /// /// ///
-			m_startOfShiftSelectionNote = (end-&gt;isGroup() ? end-&gt;firstRealChild() : end);
-			//m_noActionOnMouseRelease = false;
-			m_noActionOnMouseRelease = true;
-			return;
-		}
-
-		// Folding/Unfolding group:
-		if (zone == Note::GroupExpander) {
-			clicked-&gt;toggleFolded(Settings::playAnimations());
-			relayoutNotes(true);
-			m_noActionOnMouseRelease = true;
-			return;
-		}
-	}
-
-	// Popup menu for tag emblems:
-	if (event-&gt;button() == Qt::RightButton &amp;&amp; zone &gt;= Note::Emblem0) {
-		if (!clicked-&gt;isSelected())
-			unselectAllBut(clicked);
-		setFocusedNote(clicked); /// /// ///
-		m_startOfShiftSelectionNote = clicked;
-		popupEmblemMenu(clicked, zone - Note::Emblem0);
-		m_noActionOnMouseRelease = true;
-		return;
-	}
-
-	// Insertion Popup Menu:
-	if ((event-&gt;button() == Qt::RightButton)
-         &amp;&amp; ((!clicked &amp;&amp; isFreeLayout())
-             || (clicked
-                 &amp;&amp; (zone == Note::TopInsert
-                     || zone == Note::TopGroup
-                     || zone == Note::BottomInsert
-                     || zone == Note::BottomGroup
-                     || zone == Note::BottomColumn)))) {
-		unselectAll();
-		m_clickedToInsert = clicked;
-		m_zoneToInsert    = zone;
-		m_posToInsert     = event-&gt;pos();
-
-		KMenu* menu = Global::bnpView-&gt;popupMenu(&quot;insert_popup&quot;);
+    // If user click the basket, focus it!
+    // The focus is delayed because if the click results in showing a popup menu,
+    // the interface flicker by showing the focused rectangle (as the basket gets focus)
+    // and immediatly removing it (because the popup menu now have focus).
+    if (!isDuringEdit())
+        QTimer::singleShot(0, this, SLOT(setFocusIfNotInPopupMenu()));
+
+    // Convenient variables:
+    bool controlPressed = event-&gt;modifiers() &amp; Qt::ControlModifier;
+    bool shiftPressed   = event-&gt;modifiers() &amp; Qt::ShiftModifier;
+
+    // Do nothing if we disabled the click some milliseconds sooner.
+    // For instance when a popup menu has been closed with click, we should not do action:
+    if (event-&gt;button() == Qt::LeftButton &amp;&amp; (kapp-&gt;activePopupWidget() || m_lastDisableClick.msecsTo(QTime::currentTime()) &lt;= 80)) {
+        doHoverEffects();
+        m_noActionOnMouseRelease = true;
+        // But we allow to select:
+        // The code is the same as at the bottom of this method:
+        if (event-&gt;button() == Qt::LeftButton) {
+            m_selectionStarted = true;
+            m_selectionBeginPoint = event-&gt;pos();
+            m_selectionInvert = controlPressed || shiftPressed;
+        }
+        return;
+    }
+
+    // Figure out what is the clicked note and zone:
+    Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+    Note::Zone zone = (clicked ? clicked-&gt;zoneAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y())) : Note::None);
+
+    // Popup Tags menu:
+    if (zone == Note::TagsArrow &amp;&amp; !controlPressed &amp;&amp; !shiftPressed &amp;&amp; event-&gt;button() != Qt::MidButton) {
+        if (!clicked-&gt;isSelected())
+            unselectAllBut(clicked);
+        setFocusedNote(clicked); /// /// ///
+        m_startOfShiftSelectionNote = clicked;
+        m_noActionOnMouseRelease = true;
+        popupTagsMenu(clicked);
+        return;
+    }
+
+    if (event-&gt;button() == Qt::LeftButton) {
+        // Prepare to allow drag and drop when moving mouse further:
+        if ((zone == Note::Handle || zone == Note::Group) ||
+                (clicked &amp;&amp; clicked-&gt;isSelected() &amp;&amp;
+                 (zone == Note::TagsArrow || zone == Note::Custom0 || zone == Note::Content || zone == Note::Link /**/ || zone &gt;= Note::Emblem0 /**/))) {
+            if (!shiftPressed &amp;&amp; !controlPressed) {
+                m_pressPos = event-&gt;pos(); // TODO: Allow to drag emblems to assign them to other notes. Then don't allow drag at Emblem0!!
+                m_canDrag  = true;
+                // Saving where we were editing, because during a drag, the mouse can fly over the text edit and move the cursor position:
+                if (m_editor &amp;&amp; m_editor-&gt;textEdit()) {
+                    KTextEdit *editor = m_editor-&gt;textEdit();
+                    m_textCursor = editor-&gt;textCursor();
+                }
+            }
+        }
+
+        // Initializing Resizer move:
+        if (zone == Note::Resizer) {
+            m_resizingNote  = clicked;
+            m_pickedResizer = event-&gt;pos().x() - clicked-&gt;rightLimit();
+            m_noActionOnMouseRelease = true;
+            m_lockedHovering = true;
+            return;
+        }
+
+        // Select note(s):
+        if (zone == Note::Handle || zone == Note::Group || (zone == Note::GroupExpander &amp;&amp; (controlPressed || shiftPressed))) {
+            Note *end = clicked;
+            if (clicked-&gt;isGroup() &amp;&amp; shiftPressed) {
+                if (clicked-&gt;contains(m_startOfShiftSelectionNote)) {
+                    m_startOfShiftSelectionNote = clicked-&gt;firstRealChild();
+                    end = clicked-&gt;lastRealChild();
+                } else if (clicked-&gt;firstRealChild()-&gt;isAfter(m_startOfShiftSelectionNote))
+                    end = clicked-&gt;lastRealChild();
+                else
+                    end = clicked-&gt;firstRealChild();
+            }
+            if (controlPressed &amp;&amp; shiftPressed)
+                selectRange(m_startOfShiftSelectionNote, end, /*unselectOthers=*/false);
+            else if (shiftPressed)
+                selectRange(m_startOfShiftSelectionNote, end);
+            else if (controlPressed)
+                clicked-&gt;setSelectedRecursively(!clicked-&gt;allSelected());
+            else if (!clicked-&gt;allSelected())
+                unselectAllBut(clicked);
+            setFocusedNote(end); /// /// ///
+            m_startOfShiftSelectionNote = (end-&gt;isGroup() ? end-&gt;firstRealChild() : end);
+            //m_noActionOnMouseRelease = false;
+            m_noActionOnMouseRelease = true;
+            return;
+        }
+
+        // Folding/Unfolding group:
+        if (zone == Note::GroupExpander) {
+            clicked-&gt;toggleFolded(Settings::playAnimations());
+            relayoutNotes(true);
+            m_noActionOnMouseRelease = true;
+            return;
+        }
+    }
+
+    // Popup menu for tag emblems:
+    if (event-&gt;button() == Qt::RightButton &amp;&amp; zone &gt;= Note::Emblem0) {
+        if (!clicked-&gt;isSelected())
+            unselectAllBut(clicked);
+        setFocusedNote(clicked); /// /// ///
+        m_startOfShiftSelectionNote = clicked;
+        popupEmblemMenu(clicked, zone - Note::Emblem0);
+        m_noActionOnMouseRelease = true;
+        return;
+    }
+
+    // Insertion Popup Menu:
+    if ((event-&gt;button() == Qt::RightButton)
+            &amp;&amp; ((!clicked &amp;&amp; isFreeLayout())
+                || (clicked
+                    &amp;&amp; (zone == Note::TopInsert
+                        || zone == Note::TopGroup
+                        || zone == Note::BottomInsert
+                        || zone == Note::BottomGroup
+                        || zone == Note::BottomColumn)))) {
+        unselectAll();
+        m_clickedToInsert = clicked;
+        m_zoneToInsert    = zone;
+        m_posToInsert     = event-&gt;pos();
+
+        KMenu* menu = Global::bnpView-&gt;popupMenu(&quot;insert_popup&quot;);
         // If we already added a title, remove it because it would be kept and
         // then added several times.
         if (m_insertMenuTitle &amp;&amp; menu-&gt;actions().contains(m_insertMenuTitle))
@@ -1613,1199 +1611,1204 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
         else
             m_insertMenuTitle = menu-&gt;addTitle(i18n(&quot;Insert&quot;), first);
 
-		setInsertPopupMenu();
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(delayedCancelInsertPopupMenu()) );
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering())               );
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick())             );
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(hideInsertPopupMenu())          );
-		doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
-		m_lockedHovering = true;
-		menu-&gt;exec(QCursor::pos());
-		m_noActionOnMouseRelease = true;
-		return;
-	}
-
-	// Note Context Menu:
-	if (event-&gt;button() == Qt::RightButton &amp;&amp; clicked &amp;&amp; !clicked-&gt;isColumn() &amp;&amp; zone != Note::Resizer) {
-		if (!clicked-&gt;isSelected())
-			unselectAllBut(clicked);
-		setFocusedNote(clicked); /// /// ///
-		if (editedNote() == clicked) {
-			closeEditor();
-			clicked-&gt;setSelected(true);
-		}
-		m_startOfShiftSelectionNote = (clicked-&gt;isGroup() ? clicked-&gt;firstRealChild() : clicked);
-		KMenu* menu = Global::bnpView-&gt;popupMenu(&quot;note_popup&quot;);
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering())   );
-		connect( menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()) );
-		doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
-		m_lockedHovering = true;
-		menu-&gt;exec(QCursor::pos());
-		m_noActionOnMouseRelease = true;
-		return;
-	}
-
-	// Paste selection under cursor (but not &quot;create new primary note under cursor&quot; because this is on moveRelease):
-	if (event-&gt;button() == Qt::MidButton &amp;&amp; zone != Note::Resizer &amp;&amp; (!isDuringEdit() || clicked != editedNote())) {
-		if ((Settings::middleAction() != 0) &amp;&amp; (event-&gt;modifiers() == Qt::ShiftModifier)) {
-			m_clickedToInsert = clicked;
-			m_zoneToInsert    = zone;
-			m_posToInsert     = event-&gt;pos();
-			closeEditor();
-			removeInserter();                     // If clicked at an insertion line and the new note shows a dialog for editing,
-			NoteType::Id type = (NoteType::Id)0;  //  hide that inserter before the note edition instead of after the dialog is closed
-			switch (Settings::middleAction()) {
-				case 1:
-					m_isInsertPopupMenu = true;
-					pasteNote();
-					break;
-				case 2: type = NoteType::Image;    break;
-				case 3: type = NoteType::Link;     break;
-				case 4: type = NoteType::Launcher; break;
-				default:
-					m_noActionOnMouseRelease = false;
-					return;
-		}
-			if (type != 0) {
-				m_ignoreCloseEditorOnNextMouseRelease = true;
-				Global::bnpView-&gt;insertEmpty(type);
-			}
-		} else {
-			if (clicked)
-				zone = clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), true );
-			closeEditor();
-			clickedToInsert(event, clicked, zone);
-			save();
-		}
-		m_noActionOnMouseRelease = true;
-		return;
-	}
-
-	// Finally, no action has been done durint pressEvent, so an action can be done on releaseEvent:
-	m_noActionOnMouseRelease = false;
-
-	/* Selection scenario:
-	 * On contentsMousePressEvent, put m_selectionStarted to true and init Begin and End selection point.
-	 * On contentsMouseMoveEvent, if m_selectionStarted, update End selection point, update selection rect,
-	 * and if it's larger, switching to m_isSelecting mode: we can draw the selection rectangle.
-	 */
-	// Prepare selection:
-	if (event-&gt;button() == Qt::LeftButton) {
-		m_selectionStarted = true;
-		m_selectionBeginPoint = event-&gt;pos();
-		// We usualy invert the selection with the Ctrl key, but some environements (like GNOME or The Gimp) do it with the Shift key.
-		// Since the Shift key has no specific usage, we allow to invert selection ALSO with Shift for Gimp people
-		m_selectionInvert = controlPressed || shiftPressed;
-	}
+        setInsertPopupMenu();
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(delayedCancelInsertPopupMenu()));
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering()));
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()));
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(hideInsertPopupMenu()));
+        doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
+        m_lockedHovering = true;
+        menu-&gt;exec(QCursor::pos());
+        m_noActionOnMouseRelease = true;
+        return;
+    }
+
+    // Note Context Menu:
+    if (event-&gt;button() == Qt::RightButton &amp;&amp; clicked &amp;&amp; !clicked-&gt;isColumn() &amp;&amp; zone != Note::Resizer) {
+        if (!clicked-&gt;isSelected())
+            unselectAllBut(clicked);
+        setFocusedNote(clicked); /// /// ///
+        if (editedNote() == clicked) {
+            closeEditor();
+            clicked-&gt;setSelected(true);
+        }
+        m_startOfShiftSelectionNote = (clicked-&gt;isGroup() ? clicked-&gt;firstRealChild() : clicked);
+        KMenu* menu = Global::bnpView-&gt;popupMenu(&quot;note_popup&quot;);
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering()));
+        connect(menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()));
+        doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
+        m_lockedHovering = true;
+        menu-&gt;exec(QCursor::pos());
+        m_noActionOnMouseRelease = true;
+        return;
+    }
+
+    // Paste selection under cursor (but not &quot;create new primary note under cursor&quot; because this is on moveRelease):
+    if (event-&gt;button() == Qt::MidButton &amp;&amp; zone != Note::Resizer &amp;&amp; (!isDuringEdit() || clicked != editedNote())) {
+        if ((Settings::middleAction() != 0) &amp;&amp; (event-&gt;modifiers() == Qt::ShiftModifier)) {
+            m_clickedToInsert = clicked;
+            m_zoneToInsert    = zone;
+            m_posToInsert     = event-&gt;pos();
+            closeEditor();
+            removeInserter();                     // If clicked at an insertion line and the new note shows a dialog for editing,
+            NoteType::Id type = (NoteType::Id)0;  //  hide that inserter before the note edition instead of after the dialog is closed
+            switch (Settings::middleAction()) {
+            case 1:
+                m_isInsertPopupMenu = true;
+                pasteNote();
+                break;
+            case 2: type = NoteType::Image;    break;
+            case 3: type = NoteType::Link;     break;
+            case 4: type = NoteType::Launcher; break;
+            default:
+                m_noActionOnMouseRelease = false;
+                return;
+            }
+            if (type != 0) {
+                m_ignoreCloseEditorOnNextMouseRelease = true;
+                Global::bnpView-&gt;insertEmpty(type);
+            }
+        } else {
+            if (clicked)
+                zone = clicked-&gt;zoneAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), true);
+            closeEditor();
+            clickedToInsert(event, clicked, zone);
+            save();
+        }
+        m_noActionOnMouseRelease = true;
+        return;
+    }
+
+    // Finally, no action has been done durint pressEvent, so an action can be done on releaseEvent:
+    m_noActionOnMouseRelease = false;
+
+    /* Selection scenario:
+     * On contentsMousePressEvent, put m_selectionStarted to true and init Begin and End selection point.
+     * On contentsMouseMoveEvent, if m_selectionStarted, update End selection point, update selection rect,
+     * and if it's larger, switching to m_isSelecting mode: we can draw the selection rectangle.
+     */
+    // Prepare selection:
+    if (event-&gt;button() == Qt::LeftButton) {
+        m_selectionStarted = true;
+        m_selectionBeginPoint = event-&gt;pos();
+        // We usualy invert the selection with the Ctrl key, but some environements (like GNOME or The Gimp) do it with the Shift key.
+        // Since the Shift key has no specific usage, we allow to invert selection ALSO with Shift for Gimp people
+        m_selectionInvert = controlPressed || shiftPressed;
+    }
 }
 
 void Basket::delayedCancelInsertPopupMenu()
 {
-	QTimer::singleShot( 0, this, SLOT(cancelInsertPopupMenu()) );
+    QTimer::singleShot(0, this, SLOT(cancelInsertPopupMenu()));
 }
 
 void Basket::contentsContextMenuEvent(QContextMenuEvent *event)
 {
-	if (event-&gt;reason() == QContextMenuEvent::Keyboard) {
-		if (countFounds/*countShown*/() == 0) { // TODO: Count shown!!
-			KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;insert_popup&quot;);
-			setInsertPopupMenu();
-			connect( menu, SIGNAL(aboutToHide()),  this, SLOT(delayedCancelInsertPopupMenu()) );
-			connect( menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering())               );
-			connect( menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick())             );
-			removeInserter();
-			m_lockedHovering = true;
-			menu-&gt;exec(mapToGlobal(QPoint(0,0)));
-		} else {
-			if ( ! m_focusedNote-&gt;isSelected() )
-				unselectAllBut(m_focusedNote);
-			setFocusedNote(m_focusedNote); /// /// ///
-			m_startOfShiftSelectionNote = (m_focusedNote-&gt;isGroup() ? m_focusedNote-&gt;firstRealChild() : m_focusedNote);
-			// Popup at bottom (or top) of the focused note, if visible :
-			KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;note_popup&quot;);
-			connect( menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering())   );
-			connect( menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()) );
-			doHoverEffects(m_focusedNote, Note::Content); // In the case where another popup menu was open, we should do that manually!
-			m_lockedHovering = true;
-			menu-&gt;exec(noteVisibleRect(m_focusedNote).bottomLeft());
-		}
-	}
+    if (event-&gt;reason() == QContextMenuEvent::Keyboard) {
+        if (countFounds/*countShown*/() == 0) { // TODO: Count shown!!
+            KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;insert_popup&quot;);
+            setInsertPopupMenu();
+            connect(menu, SIGNAL(aboutToHide()),  this, SLOT(delayedCancelInsertPopupMenu()));
+            connect(menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering()));
+            connect(menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()));
+            removeInserter();
+            m_lockedHovering = true;
+            menu-&gt;exec(mapToGlobal(QPoint(0, 0)));
+        } else {
+            if (! m_focusedNote-&gt;isSelected())
+                unselectAllBut(m_focusedNote);
+            setFocusedNote(m_focusedNote); /// /// ///
+            m_startOfShiftSelectionNote = (m_focusedNote-&gt;isGroup() ? m_focusedNote-&gt;firstRealChild() : m_focusedNote);
+            // Popup at bottom (or top) of the focused note, if visible :
+            KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;note_popup&quot;);
+            connect(menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering()));
+            connect(menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()));
+            doHoverEffects(m_focusedNote, Note::Content); // In the case where another popup menu was open, we should do that manually!
+            m_lockedHovering = true;
+            menu-&gt;exec(noteVisibleRect(m_focusedNote).bottomLeft());
+        }
+    }
 }
 
 QRect Basket::noteVisibleRect(Note *note)
 {
-	QRect rect( contentsToViewport(QPoint(note-&gt;x(), note-&gt;y())), QSize(note-&gt;width(),note-&gt;height()) );
-	QPoint basketPoint = mapToGlobal(QPoint(0,0));
-	rect.moveTopLeft( rect.topLeft() + basketPoint + QPoint(frameWidth(), frameWidth()) );
-
-	// Now, rect contain the global note rectangle on the screen.
-	// We have to clip it by the basket widget :
-	if (rect.bottom() &gt; basketPoint.y() + visibleHeight() + 1) { // Bottom too... bottom
-		rect.setBottom( basketPoint.y() + visibleHeight() + 1);
-		if (rect.height() &lt;= 0) // Have at least one visible pixel of height
-			rect.setTop(rect.bottom());
-	}
-	if (rect.top() &lt; basketPoint.y() + frameWidth()) { // Top too... top
-		rect.setTop( basketPoint.y() + frameWidth());
-		if (rect.height() &lt;= 0)
-			rect.setBottom(rect.top());
-	}
-	if (rect.right() &gt; basketPoint.x() + visibleWidth() + 1) { // Right too... right
-		rect.setRight( basketPoint.x() + visibleWidth() + 1);
-		if (rect.width() &lt;= 0) // Have at least one visible pixel of width
-			rect.setLeft(rect.right());
-	}
-	if (rect.left() &lt; basketPoint.x() + frameWidth()) { // Left too... left
-		rect.setLeft( basketPoint.x() + frameWidth());
-		if (rect.width() &lt;= 0)
-			rect.setRight(rect.left());
-	}
-
-	return rect;
+    QRect rect(contentsToViewport(QPoint(note-&gt;x(), note-&gt;y())), QSize(note-&gt;width(), note-&gt;height()));
+    QPoint basketPoint = mapToGlobal(QPoint(0, 0));
+    rect.moveTopLeft(rect.topLeft() + basketPoint + QPoint(frameWidth(), frameWidth()));
+
+    // Now, rect contain the global note rectangle on the screen.
+    // We have to clip it by the basket widget :
+    if (rect.bottom() &gt; basketPoint.y() + visibleHeight() + 1) { // Bottom too... bottom
+        rect.setBottom(basketPoint.y() + visibleHeight() + 1);
+        if (rect.height() &lt;= 0) // Have at least one visible pixel of height
+            rect.setTop(rect.bottom());
+    }
+    if (rect.top() &lt; basketPoint.y() + frameWidth()) { // Top too... top
+        rect.setTop(basketPoint.y() + frameWidth());
+        if (rect.height() &lt;= 0)
+            rect.setBottom(rect.top());
+    }
+    if (rect.right() &gt; basketPoint.x() + visibleWidth() + 1) { // Right too... right
+        rect.setRight(basketPoint.x() + visibleWidth() + 1);
+        if (rect.width() &lt;= 0) // Have at least one visible pixel of width
+            rect.setLeft(rect.right());
+    }
+    if (rect.left() &lt; basketPoint.x() + frameWidth()) { // Left too... left
+        rect.setLeft(basketPoint.x() + frameWidth());
+        if (rect.width() &lt;= 0)
+            rect.setRight(rect.left());
+    }
+
+    return rect;
 }
 
 void Basket::disableNextClick()
 {
-	m_lastDisableClick = QTime::currentTime();
+    m_lastDisableClick = QTime::currentTime();
 }
 
 void Basket::recomputeAllStyles()
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;recomputeAllStyles();
+    FOR_EACH_NOTE(note)
+    note-&gt;recomputeAllStyles();
 }
 
 void Basket::removedStates(const QList&lt;State*&gt; &amp;deletedStates)
 {
-	bool modifiedBasket = false;
+    bool modifiedBasket = false;
 
-	FOR_EACH_NOTE (note)
-		if (note-&gt;removedStates(deletedStates))
-			modifiedBasket = true;
+    FOR_EACH_NOTE(note)
+    if (note-&gt;removedStates(deletedStates))
+        modifiedBasket = true;
 
-	if (modifiedBasket)
-		save();
+    if (modifiedBasket)
+        save();
 }
 
 void Basket::insertNote(Note *note, Note *clicked, int zone, const QPoint &amp;pos, bool animateNewPosition)
 {
-	if (!note) {
-		kDebug() &lt;&lt; &quot;Wanted to insert NO note&quot;;
-		return;
-	}
-
-	if (clicked &amp;&amp; zone == Note::BottomColumn) {
-		// When inserting at the bottom of a column, it's obvious the new note SHOULD inherit tags.
-		// We ensure that by changing the insertion point after the last note of the column:
-		Note *last = clicked-&gt;lastChild();
-		if (last) {
-			clicked = last;
-			zone = Note::BottomInsert;
-		}
-	}
-
-	/// Insertion at the bottom of a column:
-	if (clicked &amp;&amp; zone == Note::BottomColumn) {
-		note-&gt;setWidth(clicked-&gt;rightLimit() - clicked-&gt;x());
-		Note *lastChild = clicked-&gt;lastChild();
-		if (!animateNewPosition || !Settings::playAnimations())
-			for (Note *n = note; n; n = n-&gt;next()) {
-				n-&gt;setXRecursively(clicked-&gt;x());
-				n-&gt;setYRecursively((lastChild ? lastChild : clicked)-&gt;bottom() + 1);
-			}
-		appendNoteIn(note, clicked);
-
-	/// Insertion relative to a note (top/bottom, insert/group):
-	} else if (clicked) {
-		note-&gt;setWidth(clicked-&gt;width());
-		if (!animateNewPosition || !Settings::playAnimations())
-			for (Note *n = note; n; n = n-&gt;next()) {
-				if (zone == Note::TopGroup || zone == Note::BottomGroup)
-					n-&gt;setXRecursively(clicked-&gt;x() + Note::GROUP_WIDTH);
-				else
-					n-&gt;setXRecursively(clicked-&gt;x());
-				if (zone == Note::TopInsert || zone == Note::TopGroup)
-					n-&gt;setYRecursively(clicked-&gt;y());
-				else
-					n-&gt;setYRecursively(clicked-&gt;bottom() + 1);
-			}
-
-		if      (zone == Note::TopInsert)    { appendNoteBefore(note, clicked); }
-		else if (zone == Note::BottomInsert) { appendNoteAfter(note,  clicked); }
-		else if (zone == Note::TopGroup)     { groupNoteBefore(note,  clicked); }
-		else if (zone == Note::BottomGroup)  { groupNoteAfter(note,   clicked); }
-
-	/// Free insertion:
-	} else if (isFreeLayout()) {
-		// Group if note have siblings:
-		if (note-&gt;next()) {
-			Note *group = new Note(this);
-			for (Note *n = note; n; n = n-&gt;next())
-				n-&gt;setParentNote(group);
-			group-&gt;setFirstChild(note);
-			note = group;
-		}
-		// Insert at cursor position:
-		const int initialWidth = 250;
-		note-&gt;setWidth(note-&gt;isGroup() ? Note::GROUP_WIDTH : initialWidth);
-		if (note-&gt;isGroup() &amp;&amp; note-&gt;firstChild())
-			note-&gt;setInitialHeight(note-&gt;firstChild()-&gt;height());
-		//note-&gt;setGroupWidth(initialWidth);
-		if (animateNewPosition &amp;&amp; Settings::playAnimations())
-			note-&gt;setFinalPosition(pos.x(), pos.y());
-		else {
-			note-&gt;setXRecursively(pos.x());
-			note-&gt;setYRecursively(pos.y());
-		}
-		appendNoteAfter(note, lastNote());
-	}
-
-	relayoutNotes(true);
+    if (!note) {
+        kDebug() &lt;&lt; &quot;Wanted to insert NO note&quot;;
+        return;
+    }
+
+    if (clicked &amp;&amp; zone == Note::BottomColumn) {
+        // When inserting at the bottom of a column, it's obvious the new note SHOULD inherit tags.
+        // We ensure that by changing the insertion point after the last note of the column:
+        Note *last = clicked-&gt;lastChild();
+        if (last) {
+            clicked = last;
+            zone = Note::BottomInsert;
+        }
+    }
+
+    /// Insertion at the bottom of a column:
+    if (clicked &amp;&amp; zone == Note::BottomColumn) {
+        note-&gt;setWidth(clicked-&gt;rightLimit() - clicked-&gt;x());
+        Note *lastChild = clicked-&gt;lastChild();
+        if (!animateNewPosition || !Settings::playAnimations())
+            for (Note *n = note; n; n = n-&gt;next()) {
+                n-&gt;setXRecursively(clicked-&gt;x());
+                n-&gt;setYRecursively((lastChild ? lastChild : clicked)-&gt;bottom() + 1);
+            }
+        appendNoteIn(note, clicked);
+
+        /// Insertion relative to a note (top/bottom, insert/group):
+    } else if (clicked) {
+        note-&gt;setWidth(clicked-&gt;width());
+        if (!animateNewPosition || !Settings::playAnimations())
+            for (Note *n = note; n; n = n-&gt;next()) {
+                if (zone == Note::TopGroup || zone == Note::BottomGroup)
+                    n-&gt;setXRecursively(clicked-&gt;x() + Note::GROUP_WIDTH);
+                else
+                    n-&gt;setXRecursively(clicked-&gt;x());
+                if (zone == Note::TopInsert || zone == Note::TopGroup)
+                    n-&gt;setYRecursively(clicked-&gt;y());
+                else
+                    n-&gt;setYRecursively(clicked-&gt;bottom() + 1);
+            }
+
+        if (zone == Note::TopInsert)    {
+            appendNoteBefore(note, clicked);
+        } else if (zone == Note::BottomInsert) {
+            appendNoteAfter(note,  clicked);
+        } else if (zone == Note::TopGroup)     {
+            groupNoteBefore(note,  clicked);
+        } else if (zone == Note::BottomGroup)  {
+            groupNoteAfter(note,   clicked);
+        }
+
+        /// Free insertion:
+    } else if (isFreeLayout()) {
+        // Group if note have siblings:
+        if (note-&gt;next()) {
+            Note *group = new Note(this);
+            for (Note *n = note; n; n = n-&gt;next())
+                n-&gt;setParentNote(group);
+            group-&gt;setFirstChild(note);
+            note = group;
+        }
+        // Insert at cursor position:
+        const int initialWidth = 250;
+        note-&gt;setWidth(note-&gt;isGroup() ? Note::GROUP_WIDTH : initialWidth);
+        if (note-&gt;isGroup() &amp;&amp; note-&gt;firstChild())
+            note-&gt;setInitialHeight(note-&gt;firstChild()-&gt;height());
+        //note-&gt;setGroupWidth(initialWidth);
+        if (animateNewPosition &amp;&amp; Settings::playAnimations())
+            note-&gt;setFinalPosition(pos.x(), pos.y());
+        else {
+            note-&gt;setXRecursively(pos.x());
+            note-&gt;setYRecursively(pos.y());
+        }
+        appendNoteAfter(note, lastNote());
+    }
+
+    relayoutNotes(true);
 }
 
 void Basket::clickedToInsert(QMouseEvent *event, Note *clicked, /*Note::Zone*/int zone)
 {
-	Note *note;
-	if (event-&gt;button() == Qt::MidButton)
-		note = NoteFactory::dropNote(KApplication::clipboard()-&gt;mimeData(QClipboard::Selection), this);
-	else
-		note = NoteFactory::createNoteText(&quot;&quot;, this);
+    Note *note;
+    if (event-&gt;button() == Qt::MidButton)
+        note = NoteFactory::dropNote(KApplication::clipboard()-&gt;mimeData(QClipboard::Selection), this);
+    else
+        note = NoteFactory::createNoteText(&quot;&quot;, this);
 
-	if (!note)
-		return;
+    if (!note)
+        return;
 
-	insertNote(note, clicked, zone, event-&gt;pos(), /*animateNewPosition=*/false);
+    insertNote(note, clicked, zone, event-&gt;pos(), /*animateNewPosition=*/false);
 
-//	ensureNoteVisible(lastInsertedNote()); // TODO: in insertNote()
+//  ensureNoteVisible(lastInsertedNote()); // TODO: in insertNote()
 
-	if (event-&gt;button() != Qt::MidButton) {
-		removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
-		closeEditor();
-		noteEdit(note, /*justAdded=*/true);
-	}
+    if (event-&gt;button() != Qt::MidButton) {
+        removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
+        closeEditor();
+        noteEdit(note, /*justAdded=*/true);
+    }
 }
 
 void Basket::contentsDragEnterEvent(QDragEnterEvent *event)
 {
-	m_isDuringDrag = true;
-	Global::bnpView-&gt;updateStatusBarHint();
-	if (NoteDrag::basketOf(event-&gt;mimeData()) == this)
-		m_draggedNotes = NoteDrag::notesOf(event);
-	event-&gt;accept();
+    m_isDuringDrag = true;
+    Global::bnpView-&gt;updateStatusBarHint();
+    if (NoteDrag::basketOf(event-&gt;mimeData()) == this)
+        m_draggedNotes = NoteDrag::notesOf(event);
+    event-&gt;accept();
 }
 
 void Basket::contentsDragMoveEvent(QDragMoveEvent *event)
 {
-//	m_isDuringDrag = true;
+//  m_isDuringDrag = true;
 
-//	if (isLocked())
-//		return;
+//  if (isLocked())
+//      return;
 
-//	FIXME: viewportToContents does NOT work !!!
-//	QPoint pos = viewportToContents(event-&gt;pos());
-//	QPoint pos( event-&gt;pos().x() + contentsX(), event-&gt;pos().y() + contentsY() );
+//  FIXME: viewportToContents does NOT work !!!
+//  QPoint pos = viewportToContents(event-&gt;pos());
+//  QPoint pos( event-&gt;pos().x() + contentsX(), event-&gt;pos().y() + contentsY() );
 
-//	if (insertAtCursorPos())
-//		computeInsertPlace(pos);
-	doHoverEffects(event-&gt;pos());
+//  if (insertAtCursorPos())
+//      computeInsertPlace(pos);
+    doHoverEffects(event-&gt;pos());
 
-//	showFrameInsertTo();
-	if (isFreeLayout() || noteAt(event-&gt;pos().x(), event-&gt;pos().y())) // Cursor before rightLimit() or hovering the dragged source notes
-		acceptDropEvent(event);
-	else {
-		event-&gt;setAccepted(false);
-	}
+//  showFrameInsertTo();
+    if (isFreeLayout() || noteAt(event-&gt;pos().x(), event-&gt;pos().y())) // Cursor before rightLimit() or hovering the dragged source notes
+        acceptDropEvent(event);
+    else {
+        event-&gt;setAccepted(false);
+    }
 
-/*	Note *hoveredNote = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
-	if ( (isColumnsLayout() &amp;&amp; !hoveredNote) || (draggedNotes().contains(hoveredNote)) ) {
-		event-&gt;acceptAction(false);
-		event-&gt;accept(false);
-	} else
-		acceptDropEvent(event);*/
+    /*  Note *hoveredNote = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+        if ( (isColumnsLayout() &amp;&amp; !hoveredNote) || (draggedNotes().contains(hoveredNote)) ) {
+            event-&gt;acceptAction(false);
+            event-&gt;accept(false);
+        } else
+            acceptDropEvent(event);*/
 
-	// A workarround since QScrollView::dragAutoScroll seem to have no effect :
-//	ensureVisible(event-&gt;pos().x() + contentsX(), event-&gt;pos().y() + contentsY(), 30, 30);
-//	QScrollView::dragMoveEvent(event);
+    // A workarround since QScrollView::dragAutoScroll seem to have no effect :
+//  ensureVisible(event-&gt;pos().x() + contentsX(), event-&gt;pos().y() + contentsY(), 30, 30);
+//  QScrollView::dragMoveEvent(event);
 }
 
 void Basket::contentsDragLeaveEvent(QDragLeaveEvent*)
 {
-//	resetInsertTo();
-	m_isDuringDrag = false;
-	m_draggedNotes.clear();
-	m_noActionOnMouseRelease = true;
-	emit resetStatusBarText();
-	doHoverEffects();
+//  resetInsertTo();
+    m_isDuringDrag = false;
+    m_draggedNotes.clear();
+    m_noActionOnMouseRelease = true;
+    emit resetStatusBarText();
+    doHoverEffects();
 }
 
 void Basket::contentsDropEvent(QDropEvent *event)
 {
-	QPoint pos = event-&gt;pos();
-	kDebug() &lt;&lt; &quot;Contents Drop Event at position &quot; &lt;&lt; pos.x() &lt;&lt; &quot;:&quot; &lt;&lt; pos.y();
-
-	m_isDuringDrag = false;
-	emit resetStatusBarText();
+    QPoint pos = event-&gt;pos();
+    kDebug() &lt;&lt; &quot;Contents Drop Event at position &quot; &lt;&lt; pos.x() &lt;&lt; &quot;:&quot; &lt;&lt; pos.y();
 
-//	if (isLocked())
-//		return;
+    m_isDuringDrag = false;
+    emit resetStatusBarText();
 
-	// Do NOT check the bottom&amp;right borders.
-	// Because imagine someone drag&amp;drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
-	// the note is first removed, and relayoutNotes() compute the new height that is smaller
-	// Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
-	// Should, of course, not return 0:
-	Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+//  if (isLocked())
+//      return;
 
-	if (NoteFactory::movingNotesInTheSameBasket(event-&gt;mimeData(), this, event-&gt;dropAction()) &amp;&amp; event-&gt;dropAction() == Qt::MoveAction) {
-		m_doNotCloseEditor = true;
-	}
+    // Do NOT check the bottom&amp;right borders.
+    // Because imagine someone drag&amp;drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
+    // the note is first removed, and relayoutNotes() compute the new height that is smaller
+    // Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
+    // Should, of course, not return 0:
+    Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
 
-	Note *note = NoteFactory::dropNote( event-&gt;mimeData(), this, true, event-&gt;dropAction(), dynamic_cast&lt;Note*&gt;(event-&gt;source()) );
+    if (NoteFactory::movingNotesInTheSameBasket(event-&gt;mimeData(), this, event-&gt;dropAction()) &amp;&amp; event-&gt;dropAction() == Qt::MoveAction) {
+        m_doNotCloseEditor = true;
+    }
 
-	if (note) {
-		Note::Zone zone = (clicked ? clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), /*toAdd=*/true ) : Note::None);
-		bool animateNewPosition = NoteFactory::movingNotesInTheSameBasket(event-&gt;mimeData(), this, event-&gt;dropAction());
-		if (animateNewPosition) {
-			FOR_EACH_NOTE (n)
-				n-&gt;setOnTop(false);
-			// FOR_EACH_NOTE_IN_CHUNK(note)
-			for (Note *n = note; n; n = n-&gt;next())
-				n-&gt;setOnTop(true);
-		}
+    Note *note = NoteFactory::dropNote(event-&gt;mimeData(), this, true, event-&gt;dropAction(), dynamic_cast&lt;Note*&gt;(event-&gt;source()));
+
+    if (note) {
+        Note::Zone zone = (clicked ? clicked-&gt;zoneAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), /*toAdd=*/true) : Note::None);
+        bool animateNewPosition = NoteFactory::movingNotesInTheSameBasket(event-&gt;mimeData(), this, event-&gt;dropAction());
+        if (animateNewPosition) {
+            FOR_EACH_NOTE(n)
+            n-&gt;setOnTop(false);
+            // FOR_EACH_NOTE_IN_CHUNK(note)
+            for (Note *n = note; n; n = n-&gt;next())
+                n-&gt;setOnTop(true);
+        }
 
-		insertNote(note, clicked, zone, event-&gt;pos(), animateNewPosition);
+        insertNote(note, clicked, zone, event-&gt;pos(), animateNewPosition);
 
-		// If moved a note on bottom, contentsHeight has been disminished, then view scrolled up, and we should re-scroll the view down:
-		ensureNoteVisible(note);
+        // If moved a note on bottom, contentsHeight has been disminished, then view scrolled up, and we should re-scroll the view down:
+        ensureNoteVisible(note);
 
-//		if (event-&gt;button() != Qt::MidButton) {
-//			removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
-//		}
+//      if (event-&gt;button() != Qt::MidButton) {
+//          removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
+//      }
 
-//		resetInsertTo();
-//		doHoverEffects(); called by insertNote()
-		save();
-	}
+//      resetInsertTo();
+//      doHoverEffects(); called by insertNote()
+        save();
+    }
 
-	m_draggedNotes.clear();
+    m_draggedNotes.clear();
 
-	m_doNotCloseEditor = false;
-	// When starting the drag, we saved where we were editing.
-	// This is because during a drag, the mouse can fly over the text edit and move the cursor position, and even HIDE the cursor.
-	// So we re-show the cursor, and re-position it at the right place:
-	if (m_editor &amp;&amp; m_editor-&gt;textEdit()) {
-		KTextEdit *editor = m_editor-&gt;textEdit();
-		editor-&gt;setTextCursor(m_textCursor);
-	}
+    m_doNotCloseEditor = false;
+    // When starting the drag, we saved where we were editing.
+    // This is because during a drag, the mouse can fly over the text edit and move the cursor position, and even HIDE the cursor.
+    // So we re-show the cursor, and re-position it at the right place:
+    if (m_editor &amp;&amp; m_editor-&gt;textEdit()) {
+        KTextEdit *editor = m_editor-&gt;textEdit();
+        editor-&gt;setTextCursor(m_textCursor);
+    }
 }
 
 // handles dropping of a note to basket that is not shown
 // (usually through its entry in the basket list)
 void Basket::blindDrop(QDropEvent* event)
 {
-	if (!m_isInsertPopupMenu &amp;&amp; redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;paste();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;paste();
-	} else {
-		if (!isLoaded()) {
-			Global::bnpView-&gt;showPassiveLoading(this);
-			load();
-		}
-		closeEditor();
-		unselectAll();
-		Note *note = NoteFactory::dropNote( event-&gt;mimeData(), this, true, event-&gt;dropAction(),
-											dynamic_cast&lt;Note*&gt;(event-&gt;source()) );
-		if (note) {
-			insertCreatedNote(note);
-			//unselectAllBut(note);
-			if (Settings::usePassivePopup())
-				Global::bnpView-&gt;showPassiveDropped(i18n(&quot;Dropped to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
-		}
-	}
-	save();
+    if (!m_isInsertPopupMenu &amp;&amp; redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;paste();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;paste();
+    } else {
+        if (!isLoaded()) {
+            Global::bnpView-&gt;showPassiveLoading(this);
+            load();
+        }
+        closeEditor();
+        unselectAll();
+        Note *note = NoteFactory::dropNote(event-&gt;mimeData(), this, true, event-&gt;dropAction(),
+                                           dynamic_cast&lt;Note*&gt;(event-&gt;source()));
+        if (note) {
+            insertCreatedNote(note);
+            //unselectAllBut(note);
+            if (Settings::usePassivePopup())
+                Global::bnpView-&gt;showPassiveDropped(i18n(&quot;Dropped to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
+        }
+    }
+    save();
 }
 
 void Basket::insertEmptyNote(int type)
 {
-	if (!isLoaded())
-		load();
-	if (isDuringEdit())
-		closeEditor();
-	Note *note = NoteFactory::createEmptyNote((NoteType::Id)type, this);
-	insertCreatedNote(note/*, / *edit=* /true*/);
-	noteEdit(note, /*justAdded=*/true);
+    if (!isLoaded())
+        load();
+    if (isDuringEdit())
+        closeEditor();
+    Note *note = NoteFactory::createEmptyNote((NoteType::Id)type, this);
+    insertCreatedNote(note/*, / *edit=* /true*/);
+    noteEdit(note, /*justAdded=*/true);
 }
 
 void Basket::insertWizard(int type)
 {
-	saveInsertionData();
-	Note *note = 0;
-	switch (type) {
-		default:
-		case 1: note = NoteFactory::importKMenuLauncher(this); break;
-		case 2: note = NoteFactory::importIcon(this);          break;
-		case 3: note = NoteFactory::importFileContent(this);   break;
-	}
-	if (!note)
-		return;
-	restoreInsertionData();
-	insertCreatedNote(note);
-	unselectAllBut(note);
-	resetInsertionData();
+    saveInsertionData();
+    Note *note = 0;
+    switch (type) {
+    default:
+    case 1: note = NoteFactory::importKMenuLauncher(this); break;
+    case 2: note = NoteFactory::importIcon(this);          break;
+    case 3: note = NoteFactory::importFileContent(this);   break;
+    }
+    if (!note)
+        return;
+    restoreInsertionData();
+    insertCreatedNote(note);
+    unselectAllBut(note);
+    resetInsertionData();
 }
 
 void Basket::insertColor(const QColor &amp;color)
 {
-	Note *note = NoteFactory::createNoteColor(color, this);
-	restoreInsertionData();
-	insertCreatedNote(note);
-	unselectAllBut(note);
-	resetInsertionData();
+    Note *note = NoteFactory::createNoteColor(color, this);
+    restoreInsertionData();
+    insertCreatedNote(note);
+    unselectAllBut(note);
+    resetInsertionData();
 }
 
 void Basket::insertImage(const QPixmap &amp;image)
 {
-	Note *note = NoteFactory::createNoteImage(image, this);
-	restoreInsertionData();
-	insertCreatedNote(note);
-	unselectAllBut(note);
-	resetInsertionData();
+    Note *note = NoteFactory::createNoteImage(image, this);
+    restoreInsertionData();
+    insertCreatedNote(note);
+    unselectAllBut(note);
+    resetInsertionData();
 }
 
 void Basket::pasteNote(QClipboard::Mode mode)
 {
-	if (!m_isInsertPopupMenu &amp;&amp; redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;paste();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;paste();
-	} else {
-		if (!isLoaded()) {
-			Global::bnpView-&gt;showPassiveLoading(this);
-			load();
-		}
-		closeEditor();
-		unselectAll();
-		Note *note = NoteFactory::dropNote(KApplication::clipboard()-&gt;mimeData(mode), this);
-		if (note) {
-			insertCreatedNote(note);
-			//unselectAllBut(note);
-		}
-	}
+    if (!m_isInsertPopupMenu &amp;&amp; redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;paste();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;paste();
+    } else {
+        if (!isLoaded()) {
+            Global::bnpView-&gt;showPassiveLoading(this);
+            load();
+        }
+        closeEditor();
+        unselectAll();
+        Note *note = NoteFactory::dropNote(KApplication::clipboard()-&gt;mimeData(mode), this);
+        if (note) {
+            insertCreatedNote(note);
+            //unselectAllBut(note);
+        }
+    }
 }
 
 void Basket::insertCreatedNote(Note *note)
 {
-	// Get the insertion data if the user clicked inside the basket:
-	Note *clicked = m_clickedToInsert;
-	int zone      = m_zoneToInsert;
-	QPoint pos    = m_posToInsert;
-
-	// If it isn't the case, use the default position:
-	if (!clicked &amp;&amp; (pos.x() &lt; 0 || pos.y() &lt; 0)) {
-		// Insert right after the focused note:
-		focusANote();
-		if (m_focusedNote) {
-			clicked = m_focusedNote;
-			zone    = (m_focusedNote-&gt;isFree() ? Note::BottomGroup : Note::BottomInsert);
-			pos     = QPoint(m_focusedNote-&gt;x(), m_focusedNote-&gt;finalBottom());
-		// Insert at the end of the last column:
-		} else if (isColumnsLayout()) {
-			Note *column = /*(Settings::newNotesPlace == 0 ?*/ firstNote() /*: lastNote())*/;
-			/*if (Settings::newNotesPlace == 0 &amp;&amp; column-&gt;firstChild()) { // On Top, if at least one child in the column
-				clicked = column-&gt;firstChild();
-				zone    = Note::TopInsert;
-			} else { // On Bottom*/
-				clicked = column;
-				zone    = Note::BottomColumn;
-			/*}*/
-		// Insert at free position:
-		} else {
-			pos = QPoint(0, 0);
-		}
-	}
-
-	insertNote(note, clicked, zone, pos);
-//	ensureNoteVisible(lastInsertedNote());
-	removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
-//	resetInsertTo();
-	save();
+    // Get the insertion data if the user clicked inside the basket:
+    Note *clicked = m_clickedToInsert;
+    int zone      = m_zoneToInsert;
+    QPoint pos    = m_posToInsert;
+
+    // If it isn't the case, use the default position:
+    if (!clicked &amp;&amp; (pos.x() &lt; 0 || pos.y() &lt; 0)) {
+        // Insert right after the focused note:
+        focusANote();
+        if (m_focusedNote) {
+            clicked = m_focusedNote;
+            zone    = (m_focusedNote-&gt;isFree() ? Note::BottomGroup : Note::BottomInsert);
+            pos     = QPoint(m_focusedNote-&gt;x(), m_focusedNote-&gt;finalBottom());
+            // Insert at the end of the last column:
+        } else if (isColumnsLayout()) {
+            Note *column = /*(Settings::newNotesPlace == 0 ?*/ firstNote() /*: lastNote())*/;
+            /*if (Settings::newNotesPlace == 0 &amp;&amp; column-&gt;firstChild()) { // On Top, if at least one child in the column
+                clicked = column-&gt;firstChild();
+                zone    = Note::TopInsert;
+            } else { // On Bottom*/
+            clicked = column;
+            zone    = Note::BottomColumn;
+            /*}*/
+            // Insert at free position:
+        } else {
+            pos = QPoint(0, 0);
+        }
+    }
+
+    insertNote(note, clicked, zone, pos);
+//  ensureNoteVisible(lastInsertedNote());
+    removeInserter(); // Case: user clicked below a column to insert, the note is inserted and doHoverEffects() put a new inserter below. We don't want it.
+//  resetInsertTo();
+    save();
 }
 
 void Basket::saveInsertionData()
 {
-	m_savedClickedToInsert = m_clickedToInsert;
-	m_savedZoneToInsert    = m_zoneToInsert;
-	m_savedPosToInsert     = m_posToInsert;
+    m_savedClickedToInsert = m_clickedToInsert;
+    m_savedZoneToInsert    = m_zoneToInsert;
+    m_savedPosToInsert     = m_posToInsert;
 }
 
 void Basket::restoreInsertionData()
 {
-	m_clickedToInsert = m_savedClickedToInsert;
-	m_zoneToInsert    = m_savedZoneToInsert;
-	m_posToInsert     = m_savedPosToInsert;
+    m_clickedToInsert = m_savedClickedToInsert;
+    m_zoneToInsert    = m_savedZoneToInsert;
+    m_posToInsert     = m_savedPosToInsert;
 }
 
 void Basket::resetInsertionData()
 {
-	m_clickedToInsert = 0;
-	m_zoneToInsert    = 0;
-	m_posToInsert     = QPoint(-1, -1);
+    m_clickedToInsert = 0;
+    m_zoneToInsert    = 0;
+    m_posToInsert     = QPoint(-1, -1);
 }
 
 void Basket::hideInsertPopupMenu()
 {
-	QTimer::singleShot( 50/*ms*/, this, SLOT(timeoutHideInsertPopupMenu()) );
+    QTimer::singleShot(50/*ms*/, this, SLOT(timeoutHideInsertPopupMenu()));
 }
 
 void Basket::timeoutHideInsertPopupMenu()
 {
-	resetInsertionData();
+    resetInsertionData();
 }
 
 void Basket::acceptDropEvent(QDropEvent *event, bool preCond)
 {
-	// FIXME: Should not accept all actions! Or not all actions (link not supported?!)
-	//event-&gt;acceptAction(preCond &amp;&amp; 1);
-	//event-&gt;accept(preCond);
-        event-&gt;setAccepted(preCond);
+    // FIXME: Should not accept all actions! Or not all actions (link not supported?!)
+    //event-&gt;acceptAction(preCond &amp;&amp; 1);
+    //event-&gt;accept(preCond);
+    event-&gt;setAccepted(preCond);
 }
 
 void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
 {
-	// Now disallow drag:
-	m_canDrag = false;
-
-	// Cancel Resizer move:
-	if (m_resizingNote) {
-		m_resizingNote  = 0;
-		m_pickedResizer = 0;
-		m_lockedHovering = false;
-		doHoverEffects();
-		save();
-	}
-
-	// Cancel Note move:
-/*	if (m_movingNote) {
-		m_movingNote   = 0;
-		m_pickedHandle = QPoint(0, 0);
-		m_lockedHovering = false;
-		//doHoverEffects();
-		save();
-	}
-*/
-
-	// Cancel Selection rectangle:
-	if (m_isSelecting) {
-		m_isSelecting = false;
-		stopAutoScrollSelection();
-		resetWasInLastSelectionRect();
-		doHoverEffects();
-		updateContents(m_selectionRect);
-	}
-	m_selectionStarted = false;
-
-	Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
-	Note::Zone zone = (clicked ? clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()) ) : Note::None);
-	if ((zone == Note::Handle || zone == Note::Group) &amp;&amp; editedNote() &amp;&amp; editedNote() == clicked) {
-		if (m_ignoreCloseEditorOnNextMouseRelease)
-			m_ignoreCloseEditorOnNextMouseRelease = false;
-		else {
-			bool editedNoteStillThere = closeEditor();
-			if (editedNoteStillThere)
-				//clicked-&gt;setSelected(true);
-				unselectAllBut(clicked);
-		}
-	}
-
-
-	if (event-&gt;buttons() == 0 &amp;&amp; (zone == Note::Group || zone == Note::Handle)) {
-		closeEditor();
-		unselectAllBut(clicked);
-	}
-
-
-	// Do nothing if an action has already been made during mousePressEvent,
-	// or if user made a selection and canceled it by regressing to a very small rectangle.
-	if (m_noActionOnMouseRelease)
-		return;
-	// We immediatly set it to true, to avoid actions set on mouseRelease if NO mousePress event has been triggered.
-	// This is the case when a popup menu is shown, and user click to the basket area to close it:
-	// the menu then receive the mousePress event and the basket area ONLY receive the mouseRelease event.
-	// Obviously, nothing should be done in this case:
-	m_noActionOnMouseRelease = true;
-
-
-
-	if (event-&gt;button() == Qt::MidButton &amp;&amp; zone != Note::Resizer &amp;&amp; (!isDuringEdit() || clicked != editedNote())) {
-		if ((Settings::middleAction() != 0) &amp;&amp; (event-&gt;modifiers() == Qt::ShiftModifier)) {
-			m_clickedToInsert = clicked;
-			m_zoneToInsert    = zone;
-			m_posToInsert     = event-&gt;pos();
-			closeEditor();
-			removeInserter();                     // If clicked at an insertion line and the new note shows a dialog for editing,
-			NoteType::Id type = (NoteType::Id)0;  //  hide that inserter before the note edition instead of after the dialog is closed
-			switch (Settings::middleAction()) {
-				case 5: type = NoteType::Color;    break;
-				case 6:
-					Global::bnpView-&gt;grabScreenshot();
-					return;
-				case 7:
-					Global::bnpView-&gt;slotColorFromScreen();
-					return;
-				case 8:
-					Global::bnpView-&gt;insertWizard(3); // loadFromFile
-					return;
-				case 9:
-					Global::bnpView-&gt;insertWizard(1); // importKMenuLauncher
-					return;
-				case 10:
-					Global::bnpView-&gt;insertWizard(2); // importIcon
-					return;
-			}
-			if (type != 0) {
-				m_ignoreCloseEditorOnNextMouseRelease = true;
-				Global::bnpView-&gt;insertEmpty(type);
-				return;
-			}
-		}
-	}
-
-//	Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
-	if ( ! clicked ) {
-		if (isFreeLayout() &amp;&amp; event-&gt;button() == Qt::LeftButton) {
-			clickedToInsert(event);
-			save();
-		}
-		return;
-	}
-//	Note::Zone zone = clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()) );
-
-	// Convenient variables:
-	bool controlPressed = event-&gt;modifiers() &amp; Qt::ControlModifier;
-	bool shiftPressed   = event-&gt;modifiers() &amp; Qt::ShiftModifier;
-
-	if (clicked &amp;&amp; zone != Note::None &amp;&amp; zone != Note::BottomColumn &amp;&amp; zone != Note::Resizer &amp;&amp; (controlPressed || shiftPressed)) {
-		if (controlPressed &amp;&amp; shiftPressed)
-			selectRange(m_startOfShiftSelectionNote, clicked, /*unselectOthers=*/false);
-		else if (shiftPressed)
-			selectRange(m_startOfShiftSelectionNote, clicked);
-		else if (controlPressed)
-			clicked-&gt;setSelectedRecursively(!clicked-&gt;allSelected());
-		setFocusedNote(clicked); /// /// ///
-		m_startOfShiftSelectionNote = (clicked-&gt;isGroup() ? clicked-&gt;firstRealChild() : clicked);
-		m_noActionOnMouseRelease = true;
-		return;
-	}
-
-	// Switch tag states:
-	if (zone &gt;= Note::Emblem0) {
-		if (event-&gt;button() == Qt::LeftButton) {
-			int icons = -1;
-			for (State::List::iterator it = clicked-&gt;states().begin(); it != clicked-&gt;states().end(); ++it) {
-				if ( ! (*it)-&gt;emblem().isEmpty() )
-					icons++;
-				if (icons == zone - Note::Emblem0) {
-					State *state = (*it)-&gt;nextState();
-					if (!state)
-						return;
-					it = clicked-&gt;states().insert(it, state);
-					++it;
-					clicked-&gt;states().erase(it);
-					clicked-&gt;recomputeStyle();
-					clicked-&gt;unbufferize();
-					updateNote(clicked);
-					updateEditorAppearance();
-					filterAgain();
-					save();
-					break;
-				}
-			}
-			return;
-		}/* else if (event-&gt;button() == Qt::RightButton) {
-		popupEmblemMenu(clicked, zone - Note::Emblem0);
-		return;
-	}*/
-	}
-
-	// Insert note or past clipboard:
-	QString  text;
-//	Note *note;
-	QString  link;
-	//int zone = zone;
-	if (event-&gt;button() == Qt::MidButton &amp;&amp; zone == Note::Resizer)
-		return; //zone = clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), true );
-	if (event-&gt;button() == Qt::RightButton &amp;&amp; (clicked-&gt;isColumn() || zone == Note::Resizer))
-		return;
-	if (clicked-&gt;isGroup() &amp;&amp; zone == Note::None)
-		return;
-	switch (zone) {
-		case Note::Handle:
-		case Note::Group:
-			// We select note on mousePress if it was unselected or Ctrl is pressed.
-			// But the user can want to drag select_s_ notes, so it the note is selected, we only select it alone on mouseRelease:
-			if (event-&gt;buttons() == 0) {
-				kDebug() &lt;&lt; &quot;EXEC&quot;;
-				if ( !(event-&gt;modifiers() &amp; Qt::ControlModifier) &amp;&amp; clicked-&gt;allSelected())
-					unselectAllBut(clicked);
-				if (zone == Note::Handle &amp;&amp; isDuringEdit() &amp;&amp; editedNote() == clicked) {
-					closeEditor();
-					clicked-&gt;setSelected(true);
-				}
-			}
-			break;
-
-		case Note::Custom0:
-			//unselectAllBut(clicked);
-			setFocusedNote(clicked);
-			noteOpen(clicked);
-			break;
-
-		case Note::GroupExpander:
-		case Note::TagsArrow:
-			break;
-
-		case Note::Link:
-			link = clicked-&gt;linkAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()));
-			if ( ! link.isEmpty() ) {
-				if (link == &quot;basket-internal-remove-basket&quot;) {
-					// TODO: ask confirmation: &quot;Do you really want to delete the welcome baskets?\n You can re-add them at any time in the Help menu.&quot;
-					Global::bnpView-&gt;doBasketDeletion(this);
-				} else if (link == &quot;basket-internal-import&quot;) {
-					KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;fileimport&quot;);
-					menu-&gt;exec(event-&gt;globalPos());
-				} else {
-					KRun *run = new KRun(KUrl(link), window()); //  open the URL.
-					run-&gt;setAutoDelete(true);
-				}
-				break;
-			} // If there is no link, edit note content
-		case Note::Content:
-			closeEditor();
-			unselectAllBut(clicked);
-			noteEdit(clicked, /*justAdded=*/false, event-&gt;pos());
-			break;
-
-		case Note::TopInsert:
-		case Note::TopGroup:
-		case Note::BottomInsert:
-		case Note::BottomGroup:
-		case Note::BottomColumn:
-			clickedToInsert(event, clicked, zone);
-			save();
-			break;
-
-		case Note::None:
-		default:
-			KMessageBox::information(viewport(),
-				i18n(&quot;This message should never appear. If it does, this program is buggy! &quot;
-				&quot;Please report the bug to the developer.&quot;));
-			break;
-	}
+    // Now disallow drag:
+    m_canDrag = false;
+
+    // Cancel Resizer move:
+    if (m_resizingNote) {
+        m_resizingNote  = 0;
+        m_pickedResizer = 0;
+        m_lockedHovering = false;
+        doHoverEffects();
+        save();
+    }
+
+    // Cancel Note move:
+    /*  if (m_movingNote) {
+            m_movingNote   = 0;
+            m_pickedHandle = QPoint(0, 0);
+            m_lockedHovering = false;
+            //doHoverEffects();
+            save();
+        }
+    */
+
+    // Cancel Selection rectangle:
+    if (m_isSelecting) {
+        m_isSelecting = false;
+        stopAutoScrollSelection();
+        resetWasInLastSelectionRect();
+        doHoverEffects();
+        updateContents(m_selectionRect);
+    }
+    m_selectionStarted = false;
+
+    Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+    Note::Zone zone = (clicked ? clicked-&gt;zoneAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y())) : Note::None);
+    if ((zone == Note::Handle || zone == Note::Group) &amp;&amp; editedNote() &amp;&amp; editedNote() == clicked) {
+        if (m_ignoreCloseEditorOnNextMouseRelease)
+            m_ignoreCloseEditorOnNextMouseRelease = false;
+        else {
+            bool editedNoteStillThere = closeEditor();
+            if (editedNoteStillThere)
+                //clicked-&gt;setSelected(true);
+                unselectAllBut(clicked);
+        }
+    }
+
+
+    if (event-&gt;buttons() == 0 &amp;&amp; (zone == Note::Group || zone == Note::Handle)) {
+        closeEditor();
+        unselectAllBut(clicked);
+    }
+
+
+    // Do nothing if an action has already been made during mousePressEvent,
+    // or if user made a selection and canceled it by regressing to a very small rectangle.
+    if (m_noActionOnMouseRelease)
+        return;
+    // We immediatly set it to true, to avoid actions set on mouseRelease if NO mousePress event has been triggered.
+    // This is the case when a popup menu is shown, and user click to the basket area to close it:
+    // the menu then receive the mousePress event and the basket area ONLY receive the mouseRelease event.
+    // Obviously, nothing should be done in this case:
+    m_noActionOnMouseRelease = true;
+
+
+
+    if (event-&gt;button() == Qt::MidButton &amp;&amp; zone != Note::Resizer &amp;&amp; (!isDuringEdit() || clicked != editedNote())) {
+        if ((Settings::middleAction() != 0) &amp;&amp; (event-&gt;modifiers() == Qt::ShiftModifier)) {
+            m_clickedToInsert = clicked;
+            m_zoneToInsert    = zone;
+            m_posToInsert     = event-&gt;pos();
+            closeEditor();
+            removeInserter();                     // If clicked at an insertion line and the new note shows a dialog for editing,
+            NoteType::Id type = (NoteType::Id)0;  //  hide that inserter before the note edition instead of after the dialog is closed
+            switch (Settings::middleAction()) {
+            case 5: type = NoteType::Color;    break;
+            case 6:
+                Global::bnpView-&gt;grabScreenshot();
+                return;
+            case 7:
+                Global::bnpView-&gt;slotColorFromScreen();
+                return;
+            case 8:
+                Global::bnpView-&gt;insertWizard(3); // loadFromFile
+                return;
+            case 9:
+                Global::bnpView-&gt;insertWizard(1); // importKMenuLauncher
+                return;
+            case 10:
+                Global::bnpView-&gt;insertWizard(2); // importIcon
+                return;
+            }
+            if (type != 0) {
+                m_ignoreCloseEditorOnNextMouseRelease = true;
+                Global::bnpView-&gt;insertEmpty(type);
+                return;
+            }
+        }
+    }
+
+//  Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+    if (! clicked) {
+        if (isFreeLayout() &amp;&amp; event-&gt;button() == Qt::LeftButton) {
+            clickedToInsert(event);
+            save();
+        }
+        return;
+    }
+//  Note::Zone zone = clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()) );
+
+    // Convenient variables:
+    bool controlPressed = event-&gt;modifiers() &amp; Qt::ControlModifier;
+    bool shiftPressed   = event-&gt;modifiers() &amp; Qt::ShiftModifier;
+
+    if (clicked &amp;&amp; zone != Note::None &amp;&amp; zone != Note::BottomColumn &amp;&amp; zone != Note::Resizer &amp;&amp; (controlPressed || shiftPressed)) {
+        if (controlPressed &amp;&amp; shiftPressed)
+            selectRange(m_startOfShiftSelectionNote, clicked, /*unselectOthers=*/false);
+        else if (shiftPressed)
+            selectRange(m_startOfShiftSelectionNote, clicked);
+        else if (controlPressed)
+            clicked-&gt;setSelectedRecursively(!clicked-&gt;allSelected());
+        setFocusedNote(clicked); /// /// ///
+        m_startOfShiftSelectionNote = (clicked-&gt;isGroup() ? clicked-&gt;firstRealChild() : clicked);
+        m_noActionOnMouseRelease = true;
+        return;
+    }
+
+    // Switch tag states:
+    if (zone &gt;= Note::Emblem0) {
+        if (event-&gt;button() == Qt::LeftButton) {
+            int icons = -1;
+            for (State::List::iterator it = clicked-&gt;states().begin(); it != clicked-&gt;states().end(); ++it) {
+                if (!(*it)-&gt;emblem().isEmpty())
+                    icons++;
+                if (icons == zone - Note::Emblem0) {
+                    State *state = (*it)-&gt;nextState();
+                    if (!state)
+                        return;
+                    it = clicked-&gt;states().insert(it, state);
+                    ++it;
+                    clicked-&gt;states().erase(it);
+                    clicked-&gt;recomputeStyle();
+                    clicked-&gt;unbufferize();
+                    updateNote(clicked);
+                    updateEditorAppearance();
+                    filterAgain();
+                    save();
+                    break;
+                }
+            }
+            return;
+        }/* else if (event-&gt;button() == Qt::RightButton) {
+        popupEmblemMenu(clicked, zone - Note::Emblem0);
+        return;
+    }*/
+    }
+
+    // Insert note or past clipboard:
+    QString  text;
+//  Note *note;
+    QString  link;
+    //int zone = zone;
+    if (event-&gt;button() == Qt::MidButton &amp;&amp; zone == Note::Resizer)
+        return; //zone = clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()), true );
+    if (event-&gt;button() == Qt::RightButton &amp;&amp; (clicked-&gt;isColumn() || zone == Note::Resizer))
+        return;
+    if (clicked-&gt;isGroup() &amp;&amp; zone == Note::None)
+        return;
+    switch (zone) {
+    case Note::Handle:
+    case Note::Group:
+        // We select note on mousePress if it was unselected or Ctrl is pressed.
+        // But the user can want to drag select_s_ notes, so it the note is selected, we only select it alone on mouseRelease:
+        if (event-&gt;buttons() == 0) {
+            kDebug() &lt;&lt; &quot;EXEC&quot;;
+            if (!(event-&gt;modifiers() &amp; Qt::ControlModifier) &amp;&amp; clicked-&gt;allSelected())
+                unselectAllBut(clicked);
+            if (zone == Note::Handle &amp;&amp; isDuringEdit() &amp;&amp; editedNote() == clicked) {
+                closeEditor();
+                clicked-&gt;setSelected(true);
+            }
+        }
+        break;
+
+    case Note::Custom0:
+        //unselectAllBut(clicked);
+        setFocusedNote(clicked);
+        noteOpen(clicked);
+        break;
+
+    case Note::GroupExpander:
+    case Note::TagsArrow:
+        break;
+
+    case Note::Link:
+        link = clicked-&gt;linkAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()));
+        if (! link.isEmpty()) {
+            if (link == &quot;basket-internal-remove-basket&quot;) {
+                // TODO: ask confirmation: &quot;Do you really want to delete the welcome baskets?\n You can re-add them at any time in the Help menu.&quot;
+                Global::bnpView-&gt;doBasketDeletion(this);
+            } else if (link == &quot;basket-internal-import&quot;) {
+                KMenu *menu = Global::bnpView-&gt;popupMenu(&quot;fileimport&quot;);
+                menu-&gt;exec(event-&gt;globalPos());
+            } else {
+                KRun *run = new KRun(KUrl(link), window()); //  open the URL.
+                run-&gt;setAutoDelete(true);
+            }
+            break;
+        } // If there is no link, edit note content
+    case Note::Content:
+        closeEditor();
+        unselectAllBut(clicked);
+        noteEdit(clicked, /*justAdded=*/false, event-&gt;pos());
+        break;
+
+    case Note::TopInsert:
+    case Note::TopGroup:
+    case Note::BottomInsert:
+    case Note::BottomGroup:
+    case Note::BottomColumn:
+        clickedToInsert(event, clicked, zone);
+        save();
+        break;
+
+    case Note::None:
+    default:
+        KMessageBox::information(viewport(),
+                                 i18n(&quot;This message should never appear. If it does, this program is buggy! &quot;
+                                      &quot;Please report the bug to the developer.&quot;));
+        break;
+    }
 }
 
 void Basket::contentsMouseDoubleClickEvent(QMouseEvent *event)
 {
-	Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
-	Note::Zone zone = (clicked ? clicked-&gt;zoneAt( event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y()) ) : Note::None);
+    Note *clicked = noteAt(event-&gt;pos().x(), event-&gt;pos().y());
+    Note::Zone zone = (clicked ? clicked-&gt;zoneAt(event-&gt;pos() - QPoint(clicked-&gt;x(), clicked-&gt;y())) : Note::None);
 
-	if (event-&gt;button() == Qt::LeftButton &amp;&amp; (zone == Note::Group || zone == Note::Handle)) {
-		doCopy(CopyToSelection);
-		m_noActionOnMouseRelease = true;
-	} else
-		contentsMousePressEvent(event);
+    if (event-&gt;button() == Qt::LeftButton &amp;&amp; (zone == Note::Group || zone == Note::Handle)) {
+        doCopy(CopyToSelection);
+        m_noActionOnMouseRelease = true;
+    } else
+        contentsMousePressEvent(event);
 }
 
 void Basket::contentsMouseMoveEvent(QMouseEvent *event)
 {
-	// Drag the notes:
-	if (m_canDrag &amp;&amp; (m_pressPos - event-&gt;pos()).manhattanLength() &gt; KApplication::startDragDistance()) {
-		m_canDrag          = false;
-		m_isSelecting      = false; // Don't draw selection rectangle ater drag!
-		m_selectionStarted = false;
-		NoteSelection *selection = selectedNotes();
-		if (selection-&gt;firstStacked()) {
-			QDrag *d = NoteDrag::dragObject(selection, /*cutting=*/false, /*source=*/this); // d will be deleted by QT
-		/*bool shouldRemove = */d-&gt;exec();
-//		delete selection;
-
-		// Never delete because URL is dragged and the file must be available for the extern appliation
-//		if (shouldRemove &amp;&amp; d-&gt;target() == 0) // If target is another application that request to remove the note
-//			emit wantDelete(this);
-		}
-		return;
-	}
-
-	// Moving a Resizer:
-	if (m_resizingNote) {
-		int groupWidth = event-&gt;pos().x() - m_resizingNote-&gt;x() - m_pickedResizer;
-		int minRight   = m_resizingNote-&gt;minRight();
-		int maxRight   = 100 * contentsWidth(); // A big enough value (+infinity) for free layouts.
-		Note *nextColumn = m_resizingNote-&gt;next();
-		if (m_resizingNote-&gt;isColumn()) {
-			if (nextColumn)
-				maxRight = nextColumn-&gt;x() + nextColumn-&gt;rightLimit() - nextColumn-&gt;minRight() - Note::RESIZER_WIDTH;
-			else
-				maxRight = contentsWidth();
-		}
-		if (groupWidth &gt; maxRight - m_resizingNote-&gt;x())
-			groupWidth = maxRight - m_resizingNote-&gt;x();
-		if (groupWidth &lt; minRight - m_resizingNote-&gt;x())
-			groupWidth = minRight - m_resizingNote-&gt;x();
-		int delta = groupWidth - m_resizingNote-&gt;groupWidth();
-		m_resizingNote-&gt;setGroupWidth(groupWidth);
-		// If resizing columns:
-		if (m_resizingNote-&gt;isColumn()) {
-			Note *column = m_resizingNote;
-			if ( (column = column-&gt;next()) ) {
-				// Next columns should not have them X coordinate animated, because it would flicker:
-				column-&gt;setXRecursively(column-&gt;x() + delta);
-				// And the resizer should resize the TWO sibling columns, and not push the other columns on th right:
-				column-&gt;setGroupWidth(column-&gt;groupWidth() - delta);
-			}
-		}
-		relayoutNotes(true);
-	}
-
-	// Moving a Note:
-/*	if (m_movingNote) {
-		int x = event-&gt;pos().x() - m_pickedHandle.x();
-		int y = event-&gt;pos().y() - m_pickedHandle.y();
-		if (x &lt; 0) x = 0;
-		if (y &lt; 0) y = 0;
-		m_movingNote-&gt;setX(x);
-		m_movingNote-&gt;setY(y);
-		m_movingNote-&gt;relayoutAt(x, y, / *animate=* /false);
-		relayoutNotes(true);
-	}
-*/
-
-	// Dragging the selection rectangle:
-	if (m_selectionStarted)
-		doAutoScrollSelection();
-
-	doHoverEffects(event-&gt;pos());
+    // Drag the notes:
+    if (m_canDrag &amp;&amp; (m_pressPos - event-&gt;pos()).manhattanLength() &gt; KApplication::startDragDistance()) {
+        m_canDrag          = false;
+        m_isSelecting      = false; // Don't draw selection rectangle ater drag!
+        m_selectionStarted = false;
+        NoteSelection *selection = selectedNotes();
+        if (selection-&gt;firstStacked()) {
+            QDrag *d = NoteDrag::dragObject(selection, /*cutting=*/false, /*source=*/this); // d will be deleted by QT
+            /*bool shouldRemove = */d-&gt;exec();
+//      delete selection;
+
+            // Never delete because URL is dragged and the file must be available for the extern appliation
+//      if (shouldRemove &amp;&amp; d-&gt;target() == 0) // If target is another application that request to remove the note
+//          emit wantDelete(this);
+        }
+        return;
+    }
+
+    // Moving a Resizer:
+    if (m_resizingNote) {
+        int groupWidth = event-&gt;pos().x() - m_resizingNote-&gt;x() - m_pickedResizer;
+        int minRight   = m_resizingNote-&gt;minRight();
+        int maxRight   = 100 * contentsWidth(); // A big enough value (+infinity) for free layouts.
+        Note *nextColumn = m_resizingNote-&gt;next();
+        if (m_resizingNote-&gt;isColumn()) {
+            if (nextColumn)
+                maxRight = nextColumn-&gt;x() + nextColumn-&gt;rightLimit() - nextColumn-&gt;minRight() - Note::RESIZER_WIDTH;
+            else
+                maxRight = contentsWidth();
+        }
+        if (groupWidth &gt; maxRight - m_resizingNote-&gt;x())
+            groupWidth = maxRight - m_resizingNote-&gt;x();
+        if (groupWidth &lt; minRight - m_resizingNote-&gt;x())
+            groupWidth = minRight - m_resizingNote-&gt;x();
+        int delta = groupWidth - m_resizingNote-&gt;groupWidth();
+        m_resizingNote-&gt;setGroupWidth(groupWidth);
+        // If resizing columns:
+        if (m_resizingNote-&gt;isColumn()) {
+            Note *column = m_resizingNote;
+            if ((column = column-&gt;next())) {
+                // Next columns should not have them X coordinate animated, because it would flicker:
+                column-&gt;setXRecursively(column-&gt;x() + delta);
+                // And the resizer should resize the TWO sibling columns, and not push the other columns on th right:
+                column-&gt;setGroupWidth(column-&gt;groupWidth() - delta);
+            }
+        }
+        relayoutNotes(true);
+    }
+
+    // Moving a Note:
+    /*  if (m_movingNote) {
+            int x = event-&gt;pos().x() - m_pickedHandle.x();
+            int y = event-&gt;pos().y() - m_pickedHandle.y();
+            if (x &lt; 0) x = 0;
+            if (y &lt; 0) y = 0;
+            m_movingNote-&gt;setX(x);
+            m_movingNote-&gt;setY(y);
+            m_movingNote-&gt;relayoutAt(x, y, / *animate=* /false);
+            relayoutNotes(true);
+        }
+    */
+
+    // Dragging the selection rectangle:
+    if (m_selectionStarted)
+        doAutoScrollSelection();
+
+    doHoverEffects(event-&gt;pos());
 }
 
 void Basket::doAutoScrollSelection()
 {
-	static const int AUTO_SCROLL_MARGIN = 50;  // pixels
-	static const int AUTO_SCROLL_DELAY  = 100; // milliseconds
-
-	QPoint pos = viewport()-&gt;mapFromGlobal(QCursor::pos());
-
-	// Do the selection:
-
-	if (m_isSelecting)
-		updateContents(m_selectionRect);
-
-	m_selectionEndPoint = viewportToContents(pos);
-	m_selectionRect = QRect(m_selectionBeginPoint, m_selectionEndPoint).normalized();
-	if (m_selectionRect.left() &lt; 0)                    m_selectionRect.setLeft(0);
-	if (m_selectionRect.top() &lt; 0)                     m_selectionRect.setTop(0);
-	if (m_selectionRect.right() &gt;= contentsWidth())    m_selectionRect.setRight(contentsWidth() - 1);
-	if (m_selectionRect.bottom() &gt;= contentsHeight())  m_selectionRect.setBottom(contentsHeight() - 1);
-
-	if ( (m_selectionBeginPoint - m_selectionEndPoint).manhattanLength() &gt; QApplication::startDragDistance() ) {
-		m_isSelecting = true;
-		selectNotesIn(m_selectionRect, m_selectionInvert);
-		updateContents(m_selectionRect);
-		m_noActionOnMouseRelease = true;
-	} else {
-			// If the user was selecting but cancel by making the rectangle too small, cancel it really!!!
-		if (m_isSelecting) {
-			if (m_selectionInvert)
-				selectNotesIn(QRect(), m_selectionInvert);
-			else
-				unselectAllBut(0); // TODO: unselectAll();
-		}
-		if (m_isSelecting)
-			resetWasInLastSelectionRect();
-		m_isSelecting = false;
-		stopAutoScrollSelection();
-		return;
-	}
-
-	// Do the auto-scrolling:
-	// FIXME: It's still flickering
-
-	QRect insideRect(AUTO_SCROLL_MARGIN, AUTO_SCROLL_MARGIN, visibleWidth() - 2*AUTO_SCROLL_MARGIN, visibleHeight() - 2*AUTO_SCROLL_MARGIN);
-
-	int dx = 0;
-	int dy = 0;
-
-	if (pos.y() &lt; AUTO_SCROLL_MARGIN)
-		dy = pos.y() - AUTO_SCROLL_MARGIN;
-	else if (pos.y() &gt; visibleHeight() - AUTO_SCROLL_MARGIN)
-		dy = pos.y() - visibleHeight() + AUTO_SCROLL_MARGIN;
-
-	if (pos.x() &lt; AUTO_SCROLL_MARGIN)
-		dx = pos.x() - AUTO_SCROLL_MARGIN;
-	else if (pos.x() &gt; visibleWidth() - AUTO_SCROLL_MARGIN)
-		dx = pos.x() - visibleWidth() + AUTO_SCROLL_MARGIN;
-
-	if (dx || dy) {
-		kapp-&gt;sendPostedEvents(); // Do the repaints, because the scrolling will make the area to repaint to be wrong
-		scrollBy(dx, dy);
-		if (!m_autoScrollSelectionTimer.isActive())
-			m_autoScrollSelectionTimer.start(AUTO_SCROLL_DELAY);
-	} else
-		stopAutoScrollSelection();
+    static const int AUTO_SCROLL_MARGIN = 50;  // pixels
+    static const int AUTO_SCROLL_DELAY  = 100; // milliseconds
+
+    QPoint pos = viewport()-&gt;mapFromGlobal(QCursor::pos());
+
+    // Do the selection:
+
+    if (m_isSelecting)
+        updateContents(m_selectionRect);
+
+    m_selectionEndPoint = viewportToContents(pos);
+    m_selectionRect = QRect(m_selectionBeginPoint, m_selectionEndPoint).normalized();
+    if (m_selectionRect.left() &lt; 0)                    m_selectionRect.setLeft(0);
+    if (m_selectionRect.top() &lt; 0)                     m_selectionRect.setTop(0);
+    if (m_selectionRect.right() &gt;= contentsWidth())    m_selectionRect.setRight(contentsWidth() - 1);
+    if (m_selectionRect.bottom() &gt;= contentsHeight())  m_selectionRect.setBottom(contentsHeight() - 1);
+
+    if ((m_selectionBeginPoint - m_selectionEndPoint).manhattanLength() &gt; QApplication::startDragDistance()) {
+        m_isSelecting = true;
+        selectNotesIn(m_selectionRect, m_selectionInvert);
+        updateContents(m_selectionRect);
+        m_noActionOnMouseRelease = true;
+    } else {
+        // If the user was selecting but cancel by making the rectangle too small, cancel it really!!!
+        if (m_isSelecting) {
+            if (m_selectionInvert)
+                selectNotesIn(QRect(), m_selectionInvert);
+            else
+                unselectAllBut(0); // TODO: unselectAll();
+        }
+        if (m_isSelecting)
+            resetWasInLastSelectionRect();
+        m_isSelecting = false;
+        stopAutoScrollSelection();
+        return;
+    }
+
+    // Do the auto-scrolling:
+    // FIXME: It's still flickering
+
+    QRect insideRect(AUTO_SCROLL_MARGIN, AUTO_SCROLL_MARGIN, visibleWidth() - 2*AUTO_SCROLL_MARGIN, visibleHeight() - 2*AUTO_SCROLL_MARGIN);
+
+    int dx = 0;
+    int dy = 0;
+
+    if (pos.y() &lt; AUTO_SCROLL_MARGIN)
+        dy = pos.y() - AUTO_SCROLL_MARGIN;
+    else if (pos.y() &gt; visibleHeight() - AUTO_SCROLL_MARGIN)
+        dy = pos.y() - visibleHeight() + AUTO_SCROLL_MARGIN;
+
+    if (pos.x() &lt; AUTO_SCROLL_MARGIN)
+        dx = pos.x() - AUTO_SCROLL_MARGIN;
+    else if (pos.x() &gt; visibleWidth() - AUTO_SCROLL_MARGIN)
+        dx = pos.x() - visibleWidth() + AUTO_SCROLL_MARGIN;
+
+    if (dx || dy) {
+        kapp-&gt;sendPostedEvents(); // Do the repaints, because the scrolling will make the area to repaint to be wrong
+        scrollBy(dx, dy);
+        if (!m_autoScrollSelectionTimer.isActive())
+            m_autoScrollSelectionTimer.start(AUTO_SCROLL_DELAY);
+    } else
+        stopAutoScrollSelection();
 }
 
 void Basket::stopAutoScrollSelection()
 {
-	m_autoScrollSelectionTimer.stop();
+    m_autoScrollSelectionTimer.stop();
 }
 
 void Basket::resetWasInLastSelectionRect()
 {
-	Note *note = m_firstNote;
-	while (note) {
-		note-&gt;resetWasInLastSelectionRect();
-		note = note-&gt;next();
-	}
+    Note *note = m_firstNote;
+    while (note) {
+        note-&gt;resetWasInLastSelectionRect();
+        note = note-&gt;next();
+    }
 }
 
 void Basket::selectAll()
 {
-	if (redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;selectAll();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;selectAll();
-	} else {
-		// First select all in the group, then in the parent group...
-		Note *child  = m_focusedNote;
-		Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
-		while (parent) {
-			if (!parent-&gt;allSelected()) {
-				parent-&gt;setSelectedRecursively(true);
-				return;
-			}
-			child  = parent;
-			parent = parent-&gt;parentNote();
-		}
-		// Then, select all:
-		FOR_EACH_NOTE (note)
-			note-&gt;setSelectedRecursively(true);
-	}
+    if (redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;selectAll();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;selectAll();
+    } else {
+        // First select all in the group, then in the parent group...
+        Note *child  = m_focusedNote;
+        Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
+        while (parent) {
+            if (!parent-&gt;allSelected()) {
+                parent-&gt;setSelectedRecursively(true);
+                return;
+            }
+            child  = parent;
+            parent = parent-&gt;parentNote();
+        }
+        // Then, select all:
+        FOR_EACH_NOTE(note)
+        note-&gt;setSelectedRecursively(true);
+    }
 }
 
 void Basket::unselectAll()
 {
-	if (redirectEditActions()) {
-		if (m_editor-&gt;textEdit()) {
+    if (redirectEditActions()) {
+        if (m_editor-&gt;textEdit()) {
             QTextCursor cursor = m_editor-&gt;textEdit()-&gt;textCursor();
             cursor.clearSelection();
-			m_editor-&gt;textEdit()-&gt;setTextCursor(cursor);
-			selectionChangedInEditor(); // THIS IS NOT EMITED BY Qt!!!
-		} else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;deselect();
-	} else {
-		if (countSelecteds() &gt; 0) // Optimisation
-			FOR_EACH_NOTE (note)
-				note-&gt;setSelectedRecursively(false);
-	}
+            m_editor-&gt;textEdit()-&gt;setTextCursor(cursor);
+            selectionChangedInEditor(); // THIS IS NOT EMITED BY Qt!!!
+        } else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;deselect();
+    } else {
+        if (countSelecteds() &gt; 0) // Optimisation
+            FOR_EACH_NOTE(note)
+            note-&gt;setSelectedRecursively(false);
+    }
 }
 
 void Basket::invertSelection()
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;invertSelectionRecursively();
+    FOR_EACH_NOTE(note)
+    note-&gt;invertSelectionRecursively();
 }
 
 void Basket::unselectAllBut(Note *toSelect)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;unselectAllBut(toSelect);
+    FOR_EACH_NOTE(note)
+    note-&gt;unselectAllBut(toSelect);
 }
 
 void Basket::invertSelectionOf(Note *toSelect)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;invertSelectionOf(toSelect);
+    FOR_EACH_NOTE(note)
+    note-&gt;invertSelectionOf(toSelect);
 }
 
 void Basket::selectNotesIn(const QRect &amp;rect, bool invertSelection, bool unselectOthers /*= true*/)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;selectIn(rect, invertSelection, unselectOthers);
+    FOR_EACH_NOTE(note)
+    note-&gt;selectIn(rect, invertSelection, unselectOthers);
 }
 
 void Basket::doHoverEffects()
 {
-	doHoverEffects(  viewportToContents( viewport()-&gt;mapFromGlobal(QCursor::pos()) )  );
+    doHoverEffects(viewportToContents(viewport()-&gt;mapFromGlobal(QCursor::pos())));
 }
 
 void Basket::doHoverEffects(Note *note, Note::Zone zone, const QPoint &amp;pos)
 {
-	// Inform the old and new hovered note (if any):
-	Note *oldHoveredNote = m_hoveredNote;
-	if (note != m_hoveredNote) {
-		if (m_hoveredNote) {
-			m_hoveredNote-&gt;setHovered(false);
-			m_hoveredNote-&gt;setHoveredZone(Note::None);
-			updateNote(m_hoveredNote);
-		}
-		m_hoveredNote = note;
-		if (note)
-			note-&gt;setHovered(true);
-	}
-
-	// If we are hovering a note, compute which zone is hovered and inform the note:
-	if (m_hoveredNote) {
-		if (zone != m_hoveredZone || oldHoveredNote != m_hoveredNote) {
-			m_hoveredZone = zone;
-			m_hoveredNote-&gt;setCursor(zone);
-			updateNote(m_hoveredNote);
-		}
-		m_hoveredNote-&gt;setHoveredZone(zone);
-		// If we are hovering an insert line zone, update this thing:
-		if (zone == Note::TopInsert || zone == Note::TopGroup || zone == Note::BottomInsert || zone == Note::BottomGroup || zone == Note::BottomColumn)
-			placeInserter(m_hoveredNote, zone);
-		else
-			removeInserter();
-		// If we are hovering an embedded link in a rich text element, show the destination in the statusbar:
-		if (zone == Note::Link)
-			emit setStatusBarText(m_hoveredNote-&gt;linkAt( pos - QPoint(m_hoveredNote-&gt;x(), m_hoveredNote-&gt;y()) ));
-		else if (m_hoveredNote-&gt;content())
-			emit setStatusBarText(m_hoveredNote-&gt;content()-&gt;statusBarMessage(m_hoveredZone));//resetStatusBarText();
-	// If we aren't hovering a note, reset all:
-	} else {
-		if (isFreeLayout() &amp;&amp; !isSelecting())
-			viewport()-&gt;setCursor(Qt::CrossCursor);
-		else
-			viewport()-&gt;unsetCursor();
-		m_hoveredZone = Note::None;
-		removeInserter();
-		emit resetStatusBarText();
-	}
+    // Inform the old and new hovered note (if any):
+    Note *oldHoveredNote = m_hoveredNote;
+    if (note != m_hoveredNote) {
+        if (m_hoveredNote) {
+            m_hoveredNote-&gt;setHovered(false);
+            m_hoveredNote-&gt;setHoveredZone(Note::None);
+            updateNote(m_hoveredNote);
+        }
+        m_hoveredNote = note;
+        if (note)
+            note-&gt;setHovered(true);
+    }
+
+    // If we are hovering a note, compute which zone is hovered and inform the note:
+    if (m_hoveredNote) {
+        if (zone != m_hoveredZone || oldHoveredNote != m_hoveredNote) {
+            m_hoveredZone = zone;
+            m_hoveredNote-&gt;setCursor(zone);
+            updateNote(m_hoveredNote);
+        }
+        m_hoveredNote-&gt;setHoveredZone(zone);
+        // If we are hovering an insert line zone, update this thing:
+        if (zone == Note::TopInsert || zone == Note::TopGroup || zone == Note::BottomInsert || zone == Note::BottomGroup || zone == Note::BottomColumn)
+            placeInserter(m_hoveredNote, zone);
+        else
+            removeInserter();
+        // If we are hovering an embedded link in a rich text element, show the destination in the statusbar:
+        if (zone == Note::Link)
+            emit setStatusBarText(m_hoveredNote-&gt;linkAt(pos - QPoint(m_hoveredNote-&gt;x(), m_hoveredNote-&gt;y())));
+        else if (m_hoveredNote-&gt;content())
+            emit setStatusBarText(m_hoveredNote-&gt;content()-&gt;statusBarMessage(m_hoveredZone));//resetStatusBarText();
+        // If we aren't hovering a note, reset all:
+    } else {
+        if (isFreeLayout() &amp;&amp; !isSelecting())
+            viewport()-&gt;setCursor(Qt::CrossCursor);
+        else
+            viewport()-&gt;unsetCursor();
+        m_hoveredZone = Note::None;
+        removeInserter();
+        emit resetStatusBarText();
+    }
 }
 
 void Basket::doHoverEffects(const QPoint &amp;pos)
 {
-//	if (isDuringEdit())
-//		viewport()-&gt;unsetCursor();
+//  if (isDuringEdit())
+//      viewport()-&gt;unsetCursor();
 
-	// Do we have the right to do hover effects?
-	if ( ! m_loaded || m_lockedHovering)
-		return;
+    // Do we have the right to do hover effects?
+    if (! m_loaded || m_lockedHovering)
+        return;
 
-	// enterEvent() (mouse enter in the widget) set m_underMouse to true, and leaveEvent() make it false.
-	// But some times the enterEvent() is not trigerred: eg. when dragging the scrollbar:
-	// Ending the drag INSIDE the basket area will make NO hoverEffects() because m_underMouse is false.
-	// User need to leave the area and re-enter it to get effects.
-	// This hack solve that by dismissing the m_underMouse variable:
-	bool underMouse = Global::bnpView-&gt;currentBasket() == this &amp;&amp; QRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).contains(pos);
+    // enterEvent() (mouse enter in the widget) set m_underMouse to true, and leaveEvent() make it false.
+    // But some times the enterEvent() is not trigerred: eg. when dragging the scrollbar:
+    // Ending the drag INSIDE the basket area will make NO hoverEffects() because m_underMouse is false.
+    // User need to leave the area and re-enter it to get effects.
+    // This hack solve that by dismissing the m_underMouse variable:
+    bool underMouse = Global::bnpView-&gt;currentBasket() == this &amp;&amp; QRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).contains(pos);
 
-	// Don't do hover effects when a popup menu is opened.
-	// Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent.
-	// It willn't be noticed of mouseMoveEvent, which would result in a apparently broken application state:
-	if (kapp-&gt;activePopupWidget())
-		underMouse = false;
+    // Don't do hover effects when a popup menu is opened.
+    // Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent.
+    // It willn't be noticed of mouseMoveEvent, which would result in a apparently broken application state:
+    if (kapp-&gt;activePopupWidget())
+        underMouse = false;
 
-	// Compute which note is hovered:
-	Note       *note = (m_isSelecting || !underMouse ? 0 : noteAt(pos.x(), pos.y()));
-	Note::Zone  zone = (note ? note-&gt;zoneAt( pos - QPoint(note-&gt;x(), note-&gt;y()), isDuringDrag() ) : Note::None);
+    // Compute which note is hovered:
+    Note       *note = (m_isSelecting || !underMouse ? 0 : noteAt(pos.x(), pos.y()));
+    Note::Zone  zone = (note ? note-&gt;zoneAt(pos - QPoint(note-&gt;x(), note-&gt;y()), isDuringDrag()) : Note::None);
 
-	// Inform the old and new hovered note (if any) and update the areas:
-	doHoverEffects(note, zone, pos);
+    // Inform the old and new hovered note (if any) and update the areas:
+    doHoverEffects(note, zone, pos);
 }
 
 void Basket::mouseEnteredEditorWidget()
 {
-	if (!m_lockedHovering &amp;&amp; !kapp-&gt;activePopupWidget())
-		doHoverEffects(editedNote(), Note::Content, QPoint());
+    if (!m_lockedHovering &amp;&amp; !kapp-&gt;activePopupWidget())
+        doHoverEffects(editedNote(), Note::Content, QPoint());
 }
 
 void Basket::removeInserter()
 {
-	if (m_inserterShown) { // Do not hide (and then update/repaint the view) if it is already hidden!
-		m_inserterShown = false;
-		updateContents(m_inserterRect);
-	}
+    if (m_inserterShown) { // Do not hide (and then update/repaint the view) if it is already hidden!
+        m_inserterShown = false;
+        updateContents(m_inserterRect);
+    }
 }
 
 void Basket::placeInserter(Note *note, int zone)
 {
-	// Remove the inserter:
-	if (!note) {
-		removeInserter();
-		return;
-	}
-
-	// Update the old position:
-	if (inserterShown())
-		updateContents(m_inserterRect);
-	// Some comodities:
-	m_inserterShown = true;
-	m_inserterTop   = (zone == Note::TopGroup || zone == Note::TopInsert);
-	m_inserterGroup = (zone == Note::TopGroup || zone == Note::BottomGroup);
-	// X and width:
-	int groupIndent = (note-&gt;isGroup() ? note-&gt;width() : Note::HANDLE_WIDTH);
-	int x     = note-&gt;x();
-	int width = (note-&gt;isGroup() ? note-&gt;rightLimit() - note-&gt;x() : note-&gt;width());
-	if (m_inserterGroup) {
-		x     += groupIndent;
-		width -= groupIndent;
-	}
-	m_inserterSplit = (Settings::groupOnInsertionLine() &amp;&amp; note &amp;&amp; !note-&gt;isGroup() &amp;&amp; !note-&gt;isFree() &amp;&amp; !note-&gt;isColumn());
-//	if (note-&gt;isGroup())
-//		width = note-&gt;rightLimit() - note-&gt;x() - (m_inserterGroup ? groupIndent : 0);
-	// Y:
-	int y = note-&gt;y() - (m_inserterGroup &amp;&amp; m_inserterTop ? 1 : 3);
-	if (!m_inserterTop)
-		y += (note-&gt;isColumn() ? note-&gt;finalHeight() : note-&gt;height());
-	// Assigning result:
-	m_inserterRect = QRect(x, y, width, 6 - (m_inserterGroup ? 2 : 0));
-	// Update the new position:
-	updateContents(m_inserterRect);
+    // Remove the inserter:
+    if (!note) {
+        removeInserter();
+        return;
+    }
+
+    // Update the old position:
+    if (inserterShown())
+        updateContents(m_inserterRect);
+    // Some comodities:
+    m_inserterShown = true;
+    m_inserterTop   = (zone == Note::TopGroup || zone == Note::TopInsert);
+    m_inserterGroup = (zone == Note::TopGroup || zone == Note::BottomGroup);
+    // X and width:
+    int groupIndent = (note-&gt;isGroup() ? note-&gt;width() : Note::HANDLE_WIDTH);
+    int x     = note-&gt;x();
+    int width = (note-&gt;isGroup() ? note-&gt;rightLimit() - note-&gt;x() : note-&gt;width());
+    if (m_inserterGroup) {
+        x     += groupIndent;
+        width -= groupIndent;
+    }
+    m_inserterSplit = (Settings::groupOnInsertionLine() &amp;&amp; note &amp;&amp; !note-&gt;isGroup() &amp;&amp; !note-&gt;isFree() &amp;&amp; !note-&gt;isColumn());
+//  if (note-&gt;isGroup())
+//      width = note-&gt;rightLimit() - note-&gt;x() - (m_inserterGroup ? groupIndent : 0);
+    // Y:
+    int y = note-&gt;y() - (m_inserterGroup &amp;&amp; m_inserterTop ? 1 : 3);
+    if (!m_inserterTop)
+        y += (note-&gt;isColumn() ? note-&gt;finalHeight() : note-&gt;height());
+    // Assigning result:
+    m_inserterRect = QRect(x, y, width, 6 - (m_inserterGroup ? 2 : 0));
+    // Update the new position:
+    updateContents(m_inserterRect);
 }
 
 inline void drawLineByRect(QPainter &amp;painter, int x, int y, int width, int height)
 {
-	painter.drawLine(x, y, x + width - 1, y + height - 1);
+    painter.drawLine(x, y, x + width - 1, y + height - 1);
 }
 
 void Basket::drawInserter(QPainter &amp;painter, int xPainter, int yPainter)
 {
-	if (!m_inserterShown)
-		return;
+    if (!m_inserterShown)
+        return;
 
-	QRect rect = m_inserterRect; // For shorter code-lines when drawing!
-	rect.translate(-xPainter, -yPainter);
-	int lineY  = (m_inserterGroup &amp;&amp; m_inserterTop ? 0 : 2);
-	int roundY = (m_inserterGroup &amp;&amp; m_inserterTop ? 0 : 1);
+    QRect rect = m_inserterRect; // For shorter code-lines when drawing!
+    rect.translate(-xPainter, -yPainter);
+    int lineY  = (m_inserterGroup &amp;&amp; m_inserterTop ? 0 : 2);
+    int roundY = (m_inserterGroup &amp;&amp; m_inserterTop ? 0 : 1);
 
     KStatefulBrush statefulBrush(KColorScheme::View, KColorScheme::HoverColor);
     QColor dark = statefulBrush.brush(palette()).color();
-	QColor light = dark.lighter().lighter();
-	if (m_inserterGroup &amp;&amp; Settings::groupOnInsertionLine())
-		light = Tools::mixColor(light, palette().color(QPalette::Highlight));
-	painter.setPen(dark);
-	// The horizontal line:
-	//painter.drawRect(       rect.x(),                    rect.y() + lineY,  rect.width(), 2);
-	int width = rect.width() - 4;
-	drawGradient(&amp;painter, dark,  light, rect.x() + 2,           rect.y() + lineY, width/2,         2, /*sunken=*/false, /*horz=*/false, /*flat=*/false);
-	drawGradient(&amp;painter, light, dark,  rect.x() + 2 + width/2, rect.y() + lineY, width - width/2, 2, /*sunken=*/false, /*horz=*/false, /*flat=*/false);
-	// The left-most and right-most edges (biggest vertical lines):
-	drawLineByRect(painter, rect.x(),                    rect.y(),          1,            (m_inserterGroup ? 4 : 6));
-	drawLineByRect(painter, rect.x() + rect.width() - 1, rect.y(),          1,            (m_inserterGroup ? 4 : 6));
-	// The left and right mid vertical lines:
-	drawLineByRect(painter, rect.x() + 1,                rect.y() + roundY, 1,            (m_inserterGroup ? 3 : 4));
-	drawLineByRect(painter, rect.x() + rect.width() - 2, rect.y() + roundY, 1,            (m_inserterGroup ? 3 : 4));
-	// Draw the split as a feedback to know where is the limit between insert and group:
-	if (m_inserterSplit) {
-		int noteWidth = rect.width() + (m_inserterGroup ? Note::HANDLE_WIDTH : 0);
-		int xSplit = rect.x() - (m_inserterGroup ? Note::HANDLE_WIDTH : 0) + noteWidth / 2;
-		painter.setPen(Tools::mixColor(dark, light));
-		painter.drawRect(xSplit - 2, rect.y() + lineY, 4, 2);
-		painter.setPen(dark);
-		painter.drawRect(xSplit - 1, rect.y() + lineY, 2, 2);
-	}
+    QColor light = dark.lighter().lighter();
+    if (m_inserterGroup &amp;&amp; Settings::groupOnInsertionLine())
+        light = Tools::mixColor(light, palette().color(QPalette::Highlight));
+    painter.setPen(dark);
+    // The horizontal line:
+    //painter.drawRect(       rect.x(),                    rect.y() + lineY,  rect.width(), 2);
+    int width = rect.width() - 4;
+    drawGradient(&amp;painter, dark,  light, rect.x() + 2,           rect.y() + lineY, width / 2,         2, /*sunken=*/false, /*horz=*/false, /*flat=*/false);
+    drawGradient(&amp;painter, light, dark,  rect.x() + 2 + width / 2, rect.y() + lineY, width - width / 2, 2, /*sunken=*/false, /*horz=*/false, /*flat=*/false);
+    // The left-most and right-most edges (biggest vertical lines):
+    drawLineByRect(painter, rect.x(),                    rect.y(),          1, (m_inserterGroup ? 4 : 6));
+    drawLineByRect(painter, rect.x() + rect.width() - 1, rect.y(),          1, (m_inserterGroup ? 4 : 6));
+    // The left and right mid vertical lines:
+    drawLineByRect(painter, rect.x() + 1,                rect.y() + roundY, 1, (m_inserterGroup ? 3 : 4));
+    drawLineByRect(painter, rect.x() + rect.width() - 2, rect.y() + roundY, 1, (m_inserterGroup ? 3 : 4));
+    // Draw the split as a feedback to know where is the limit between insert and group:
+    if (m_inserterSplit) {
+        int noteWidth = rect.width() + (m_inserterGroup ? Note::HANDLE_WIDTH : 0);
+        int xSplit = rect.x() - (m_inserterGroup ? Note::HANDLE_WIDTH : 0) + noteWidth / 2;
+        painter.setPen(Tools::mixColor(dark, light));
+        painter.drawRect(xSplit - 2, rect.y() + lineY, 4, 2);
+        painter.setPen(dark);
+        painter.drawRect(xSplit - 1, rect.y() + lineY, 2, 2);
+    }
 }
 
 bool Basket::event(QEvent *event)
@@ -2822,1307 +2825,1301 @@ bool Basket::event(QEvent *event)
 void Basket::tooltipEvent(QHelpEvent *event)
 {
     QPoint pos = event-&gt;globalPos();
-	if ( !m_loaded || !Settings::showNotesToolTip() )
-		return;
-
-	QString message;
-	QRect   rect;
-
-	QPoint contentPos = viewportToContents(event-&gt;pos());
-	Note *note = noteAt(contentPos.x(), contentPos.y());
-
-	if (!note &amp;&amp; isFreeLayout()) {
-		message = i18n(&quot;Insert note here\nRight click for more options&quot;);
-		QRect itRect;
-		for (QList&lt;QRect&gt;::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
-			itRect = QRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it);
-			if (itRect.contains(contentPos)) {
-				rect = itRect;
-				rect.moveLeft(rect.left() - contentsX());
-				rect.moveTop( rect.top()  - contentsY());
-				break;
-			}
-		}
-	} else {
-		if (!note)
-			return;
-
-		Note::Zone zone = note-&gt;zoneAt( contentPos - QPoint(note-&gt;x(), note-&gt;y()) );
-		switch (zone) {
-			case Note::Resizer:       message = (note-&gt;isColumn() ?
-			                                    i18n(&quot;Resize those columns&quot;) :
-			                                    (note-&gt;isGroup() ?
-			                                    i18n(&quot;Resize this group&quot;) :
-			                                    i18n(&quot;Resize this note&quot;)));                 break;
-			case Note::Handle:        message = i18n(&quot;Select or move this note&quot;);           break;
-			case Note::Group:         message = i18n(&quot;Select or move this group&quot;);          break;
-			case Note::TagsArrow:     message = i18n(&quot;Assign or remove tags from this note&quot;);
-			                          if (note-&gt;states().count() &gt; 0) {
-			                          	message = &quot;&lt;qt&gt;&lt;nobr&gt;&quot; + message + &quot;&lt;/nobr&gt;&lt;br&gt;&quot; + i18n(&quot;&lt;b&gt;Assigned Tags&lt;/b&gt;: %1&quot;);
-			                          	QString tagsString = &quot;&quot;;
-			                          	for (State::List::iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it) {
-			                          		QString tagName = &quot;&lt;nobr&gt;&quot; + Tools::textToHTMLWithoutP((*it)-&gt;fullName()) + &quot;&lt;/nobr&gt;&quot;;
-			                          		if (tagsString.isEmpty())
-			                          			tagsString = tagName;
-			                          		else
-									tagsString = i18n(&quot;%1, %2&quot;, tagsString, tagName);
-			                          	}
-			                          	message = message.arg(tagsString);
-			                          }
-			                          break;
-			case Note::Custom0:       message = note-&gt;content()-&gt;zoneTip(zone);             break; //&quot;Open this link/Open this file/Open this sound file/Launch this application&quot;
-			case Note::GroupExpander: message = (note-&gt;isFolded() ?
-			                                    i18n(&quot;Expand this group&quot;) :
-			                                    i18n(&quot;Collapse this group&quot;));               break;
-			case Note::Link:
-			case Note::Content:       message = note-&gt;content()-&gt;editToolTipText();         break;
-			case Note::TopInsert:
-			case Note::BottomInsert:  message = i18n(&quot;Insert note here\nRight click for more options&quot;);              break;
-			case Note::TopGroup:      message = i18n(&quot;Group note with the one below\nRight click for more options&quot;); break;
-			case Note::BottomGroup:   message = i18n(&quot;Group note with the one above\nRight click for more options&quot;); break;
-			case Note::BottomColumn:  message = i18n(&quot;Insert note here\nRight click for more options&quot;);              break;
-			case Note::None:          message = &quot;** Zone NONE: internal error **&quot;;                                   break;
-			default:
-				if (zone &gt;= Note::Emblem0)
-					message = note-&gt;stateForEmblemNumber(zone - Note::Emblem0)-&gt;fullName();
-				else
-					message = &quot;&quot;;
-				break;
-		}
-
-		if (zone == Note::Content || zone == Note::Link || zone == Note::Custom0) {
-			QStringList keys;
-			QStringList values;
-
-			note-&gt;content()-&gt;toolTipInfos(&amp;keys, &amp;values);
-			keys.append(i18n(&quot;Added&quot;));
-			keys.append(i18n(&quot;Last Modification&quot;));
-			values.append(note-&gt;addedStringDate());
-			values.append(note-&gt;lastModificationStringDate());
-
-			message = &quot;&lt;qt&gt;&lt;nobr&gt;&quot; + message;
-			QStringList::iterator key;
-			QStringList::iterator value;
-			for (key = keys.begin(), value = values.begin(); key != keys.end() &amp;&amp; value != values.end(); ++key, ++value)
-				message += &quot;&lt;br&gt;&quot; + i18nc(&quot;of the form 'key: value'&quot;, &quot;&lt;b&gt;%1&lt;/b&gt;: %2&quot;, *key, *value);
-			message += &quot;&lt;/nobr&gt;&lt;/qt&gt;&quot;;
-		} else if (m_inserterSplit &amp;&amp; (zone == Note::TopInsert || zone == Note::BottomInsert))
-			message += &quot;\n&quot; + i18n(&quot;Click on the right to group instead of insert&quot;);
-		else if (m_inserterSplit &amp;&amp; (zone == Note::TopGroup || zone == Note::BottomGroup))
-			message += &quot;\n&quot; + i18n(&quot;Click on the left to insert instead of group&quot;);
-
-		rect = note-&gt;zoneRect( zone, contentPos - QPoint(note-&gt;x(), note-&gt;y()) );
-
-		rect.moveLeft(rect.left() - contentsX());
-		rect.moveTop( rect.top()  - contentsY());
-
-		rect.moveLeft(rect.left() + note-&gt;x());
-		rect.moveTop( rect.top()  + note-&gt;y());
-	}
-
-	QToolTip::showText(pos, message, this, rect);
+    if (!m_loaded || !Settings::showNotesToolTip())
+        return;
+
+    QString message;
+    QRect   rect;
+
+    QPoint contentPos = viewportToContents(event-&gt;pos());
+    Note *note = noteAt(contentPos.x(), contentPos.y());
+
+    if (!note &amp;&amp; isFreeLayout()) {
+        message = i18n(&quot;Insert note here\nRight click for more options&quot;);
+        QRect itRect;
+        for (QList&lt;QRect&gt;::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
+            itRect = QRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it);
+            if (itRect.contains(contentPos)) {
+                rect = itRect;
+                rect.moveLeft(rect.left() - contentsX());
+                rect.moveTop(rect.top()  - contentsY());
+                break;
+            }
+        }
+    } else {
+        if (!note)
+            return;
+
+        Note::Zone zone = note-&gt;zoneAt(contentPos - QPoint(note-&gt;x(), note-&gt;y()));
+        switch (zone) {
+        case Note::Resizer:       message = (note-&gt;isColumn() ?
+                                                 i18n(&quot;Resize those columns&quot;) :
+                                                 (note-&gt;isGroup() ?
+                                                  i18n(&quot;Resize this group&quot;) :
+                                                  i18n(&quot;Resize this note&quot;)));                 break;
+        case Note::Handle:        message = i18n(&quot;Select or move this note&quot;);           break;
+        case Note::Group:         message = i18n(&quot;Select or move this group&quot;);          break;
+        case Note::TagsArrow:     message = i18n(&quot;Assign or remove tags from this note&quot;);
+            if (note-&gt;states().count() &gt; 0) {
+                message = &quot;&lt;qt&gt;&lt;nobr&gt;&quot; + message + &quot;&lt;/nobr&gt;&lt;br&gt;&quot; + i18n(&quot;&lt;b&gt;Assigned Tags&lt;/b&gt;: %1&quot;);
+                QString tagsString = &quot;&quot;;
+                for (State::List::iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it) {
+                    QString tagName = &quot;&lt;nobr&gt;&quot; + Tools::textToHTMLWithoutP((*it)-&gt;fullName()) + &quot;&lt;/nobr&gt;&quot;;
+                    if (tagsString.isEmpty())
+                        tagsString = tagName;
+                    else
+                        tagsString = i18n(&quot;%1, %2&quot;, tagsString, tagName);
+                }
+                message = message.arg(tagsString);
+            }
+            break;
+        case Note::Custom0:       message = note-&gt;content()-&gt;zoneTip(zone);             break; //&quot;Open this link/Open this file/Open this sound file/Launch this application&quot;
+        case Note::GroupExpander: message = (note-&gt;isFolded() ?
+                                                 i18n(&quot;Expand this group&quot;) :
+                                                 i18n(&quot;Collapse this group&quot;));               break;
+        case Note::Link:
+        case Note::Content:       message = note-&gt;content()-&gt;editToolTipText();         break;
+        case Note::TopInsert:
+        case Note::BottomInsert:  message = i18n(&quot;Insert note here\nRight click for more options&quot;);              break;
+        case Note::TopGroup:      message = i18n(&quot;Group note with the one below\nRight click for more options&quot;); break;
+        case Note::BottomGroup:   message = i18n(&quot;Group note with the one above\nRight click for more options&quot;); break;
+        case Note::BottomColumn:  message = i18n(&quot;Insert note here\nRight click for more options&quot;);              break;
+        case Note::None:          message = &quot;** Zone NONE: internal error **&quot;;                                   break;
+        default:
+            if (zone &gt;= Note::Emblem0)
+                message = note-&gt;stateForEmblemNumber(zone - Note::Emblem0)-&gt;fullName();
+            else
+                message = &quot;&quot;;
+            break;
+        }
+
+        if (zone == Note::Content || zone == Note::Link || zone == Note::Custom0) {
+            QStringList keys;
+            QStringList values;
+
+            note-&gt;content()-&gt;toolTipInfos(&amp;keys, &amp;values);
+            keys.append(i18n(&quot;Added&quot;));
+            keys.append(i18n(&quot;Last Modification&quot;));
+            values.append(note-&gt;addedStringDate());
+            values.append(note-&gt;lastModificationStringDate());
+
+            message = &quot;&lt;qt&gt;&lt;nobr&gt;&quot; + message;
+            QStringList::iterator key;
+            QStringList::iterator value;
+            for (key = keys.begin(), value = values.begin(); key != keys.end() &amp;&amp; value != values.end(); ++key, ++value)
+                message += &quot;&lt;br&gt;&quot; + i18nc(&quot;of the form 'key: value'&quot;, &quot;&lt;b&gt;%1&lt;/b&gt;: %2&quot;, *key, *value);
+            message += &quot;&lt;/nobr&gt;&lt;/qt&gt;&quot;;
+        } else if (m_inserterSplit &amp;&amp; (zone == Note::TopInsert || zone == Note::BottomInsert))
+            message += &quot;\n&quot; + i18n(&quot;Click on the right to group instead of insert&quot;);
+        else if (m_inserterSplit &amp;&amp; (zone == Note::TopGroup || zone == Note::BottomGroup))
+            message += &quot;\n&quot; + i18n(&quot;Click on the left to insert instead of group&quot;);
+
+        rect = note-&gt;zoneRect(zone, contentPos - QPoint(note-&gt;x(), note-&gt;y()));
+
+        rect.moveLeft(rect.left() - contentsX());
+        rect.moveTop(rect.top()  - contentsY());
+
+        rect.moveLeft(rect.left() + note-&gt;x());
+        rect.moveTop(rect.top()  + note-&gt;y());
+    }
+
+    QToolTip::showText(pos, message, this, rect);
 }
 
 Note* Basket::lastNote()
 {
-	Note *note = firstNote();
-	while (note &amp;&amp; note-&gt;next())
-		note = note-&gt;next();
-	return note;
+    Note *note = firstNote();
+    while (note &amp;&amp; note-&gt;next())
+        note = note-&gt;next();
+    return note;
 }
 
 void Basket::deleteNotes()
 {
-	Note *note = m_firstNote;
-
-	while (note){
-		Note *tmp = note-&gt;next();
-		delete note;
-		note = tmp;
-	}
-	m_firstNote = 0;
-	m_resizingNote = 0;
-	m_movingNote = 0;
-	m_focusedNote = 0;
-	m_startOfShiftSelectionNote = 0;
-	m_tagPopupNote = 0;
-	m_clickedToInsert = 0;
-	m_savedClickedToInsert = 0;
-	m_hoveredNote = 0;
-	m_count = 0;
-	m_countFounds = 0;
-	m_countSelecteds = 0;
-
-	emit resetStatusBarText();
-	emit countsChanged(this);
+    Note *note = m_firstNote;
+
+    while (note) {
+        Note *tmp = note-&gt;next();
+        delete note;
+        note = tmp;
+    }
+    m_firstNote = 0;
+    m_resizingNote = 0;
+    m_movingNote = 0;
+    m_focusedNote = 0;
+    m_startOfShiftSelectionNote = 0;
+    m_tagPopupNote = 0;
+    m_clickedToInsert = 0;
+    m_savedClickedToInsert = 0;
+    m_hoveredNote = 0;
+    m_count = 0;
+    m_countFounds = 0;
+    m_countSelecteds = 0;
+
+    emit resetStatusBarText();
+    emit countsChanged(this);
 }
 
 Note* Basket::noteAt(int x, int y)
 {
 //NO:
-// 	// Do NOT check the bottom&amp;right borders.
-// 	// Because imagine someone drag&amp;drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
-// 	// the note is first removed, and relayoutNotes() compute the new height that is smaller
-// 	// Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
-// 	// Should, of course, not return 0:
-	if (x &lt; 0 || x &gt; contentsWidth() || y &lt; 0 || y &gt; contentsHeight())
-		return 0;
-
-	// When resizing a note/group, keep it highlighted:
-	if (m_resizingNote)
-		return m_resizingNote;
-
-	// Search and return the hovered note:
-	Note *note = m_firstNote;
-	Note *possibleNote;
-	while (note) {
-		possibleNote = note-&gt;noteAt(x, y);
-		if (possibleNote) {
-			if (draggedNotes().contains(possibleNote))
-				return 0;
-			else
-				return possibleNote;
-		}
-		note = note-&gt;next();
-	}
-
-	// If the basket is layouted in columns, return one of the columns to be able to add notes in them:
-	if (isColumnsLayout()) {
-		Note *column = m_firstNote;
-		while (column) {
-			if (x &gt;= column-&gt;x() &amp;&amp; x &lt; column-&gt;rightLimit())
-				return column;
-			column = column-&gt;next();
-		}
-	}
-
-	// Nothing found, no note is hovered:
-	return NULL;
+//  // Do NOT check the bottom&amp;right borders.
+//  // Because imagine someone drag&amp;drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
+//  // the note is first removed, and relayoutNotes() compute the new height that is smaller
+//  // Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
+//  // Should, of course, not return 0:
+    if (x &lt; 0 || x &gt; contentsWidth() || y &lt; 0 || y &gt; contentsHeight())
+        return 0;
+
+    // When resizing a note/group, keep it highlighted:
+    if (m_resizingNote)
+        return m_resizingNote;
+
+    // Search and return the hovered note:
+    Note *note = m_firstNote;
+    Note *possibleNote;
+    while (note) {
+        possibleNote = note-&gt;noteAt(x, y);
+        if (possibleNote) {
+            if (draggedNotes().contains(possibleNote))
+                return 0;
+            else
+                return possibleNote;
+        }
+        note = note-&gt;next();
+    }
+
+    // If the basket is layouted in columns, return one of the columns to be able to add notes in them:
+    if (isColumnsLayout()) {
+        Note *column = m_firstNote;
+        while (column) {
+            if (x &gt;= column-&gt;x() &amp;&amp; x &lt; column-&gt;rightLimit())
+                return column;
+            column = column-&gt;next();
+        }
+    }
+
+    // Nothing found, no note is hovered:
+    return NULL;
 }
 
 Basket::~Basket()
 {
-	if(m_decryptBox)
-		delete m_decryptBox;
+    if (m_decryptBox)
+        delete m_decryptBox;
 #ifdef HAVE_LIBGPGME
-	delete m_gpg;
+    delete m_gpg;
 #endif
-	deleteNotes();
+    deleteNotes();
 }
 
 void Basket::viewportResizeEvent(QResizeEvent *event)
 {
-	relayoutNotes(true);
-	//cornerWidget()-&gt;setShown(horizontalScrollBar()-&gt;isShown() &amp;&amp; verticalScrollBar()-&gt;isShown());
-	if (horizontalScrollBar()-&gt;isVisible() &amp;&amp; verticalScrollBar()-&gt;isVisible()) {
-		if (!cornerWidget())
-			setCornerWidget(m_cornerWidget);
-	} else {
-		if (cornerWidget())
-			cornerWidget()-&gt;hide();
-	}
-//	if (isDuringEdit())
-//		ensureNoteVisible(editedNote());
-	Q3ScrollView::viewportResizeEvent(event);
+    relayoutNotes(true);
+    //cornerWidget()-&gt;setShown(horizontalScrollBar()-&gt;isShown() &amp;&amp; verticalScrollBar()-&gt;isShown());
+    if (horizontalScrollBar()-&gt;isVisible() &amp;&amp; verticalScrollBar()-&gt;isVisible()) {
+        if (!cornerWidget())
+            setCornerWidget(m_cornerWidget);
+    } else {
+        if (cornerWidget())
+            cornerWidget()-&gt;hide();
+    }
+//  if (isDuringEdit())
+//      ensureNoteVisible(editedNote());
+    Q3ScrollView::viewportResizeEvent(event);
 }
 
 void Basket::animateLoad()
 {
-	const int viewHeight = contentsY() + visibleHeight();
+    const int viewHeight = contentsY() + visibleHeight();
 
-	QTime t = QTime::currentTime(); // Set random seed
-	srand(t.hour()*12 + t.minute()*60 + t.second()*60);
+    QTime t = QTime::currentTime(); // Set random seed
+    srand(t.hour()*12 + t.minute()*60 + t.second()*60);
 
-	Note *note = firstNote();
-	while (note) {
-		if ((note-&gt;finalY() &lt; viewHeight) &amp;&amp; note-&gt;matching())
-			note-&gt;initAnimationLoad();
-		note = note-&gt;next();
-	}
+    Note *note = firstNote();
+    while (note) {
+        if ((note-&gt;finalY() &lt; viewHeight) &amp;&amp; note-&gt;matching())
+            note-&gt;initAnimationLoad();
+        note = note-&gt;next();
+    }
 
-	m_loaded = true;
+    m_loaded = true;
 }
 
 QColor Basket::selectionRectInsideColor()
 {
-	return Tools::mixColor(Tools::mixColor(backgroundColor(),
+    return Tools::mixColor(Tools::mixColor(backgroundColor(),
                                            palette().color(QPalette::Highlight)),
                            backgroundColor());
 }
 
 QColor alphaBlendColors(const QColor &amp;bgColor, const QColor &amp;fgColor, const int a)
 {
-	// normal button...
-	QRgb rgb = bgColor.rgb();
-	QRgb rgb_b = fgColor.rgb();
-	int alpha = a;
-	if (alpha&gt;255) alpha = 255;
-	if (alpha&lt;0) alpha = 0;
-	int inv_alpha = 255 - alpha;
-	QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
-	                        qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
-	                        qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
+    // normal button...
+    QRgb rgb = bgColor.rgb();
+    QRgb rgb_b = fgColor.rgb();
+    int alpha = a;
+    if (alpha &gt; 255) alpha = 255;
+    if (alpha &lt; 0) alpha = 0;
+    int inv_alpha = 255 - alpha;
+    QColor result = QColor(qRgb(qRed(rgb_b) * inv_alpha / 255 + qRed(rgb) * alpha / 255,
+                                qGreen(rgb_b) * inv_alpha / 255 + qGreen(rgb) * alpha / 255,
+                                qBlue(rgb_b) * inv_alpha / 255 + qBlue(rgb) * alpha / 255));
 
-	return result;
+    return result;
 }
 
 void Basket::unlock()
 {
-	QTimer::singleShot( 0, this, SLOT(load()) );
+    QTimer::singleShot(0, this, SLOT(load()));
 }
 
 void Basket::inactivityAutoLockTimeout()
 {
-	lock();
+    lock();
 }
 
 void Basket::drawContents(QPainter *painter)
 {
-	drawContents(painter, 0, 0, 0, 0);
+    drawContents(painter, 0, 0, 0, 0);
 }
 
 void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight)
 {
-	// Start the load the first time the basket is shown:
-	if (!m_loadingLaunched)
-	{
-		if(!m_locked)
-			QTimer::singleShot( 0, this, SLOT(load()) );
-		else {
-			Global::bnpView-&gt;notesStateChanged(); // Show &quot;Locked&quot; instead of &quot;Loading...&quot; in the statusbar
-		}
-	}
-
-	QBrush brush(backgroundColor()); // FIXME: share it for all the basket?
-	QRect clipRect(clipX, clipY, clipWidth, clipHeight);
-
-	if(m_locked)
-	{
-		if(!m_decryptBox)
-		{
-			m_decryptBox = new QFrame( this );
-			m_decryptBox-&gt;setFrameShape( QFrame::StyledPanel );
-			m_decryptBox-&gt;setFrameShadow( QFrame::Plain );
-			m_decryptBox-&gt;setLineWidth( 1 );
-
-			//QGridLayout* layout = new QGridLayout( m_decryptBox, 1, 1, 11, 6, &quot;decryptBoxLayout&quot;);
-			QGridLayout *layout = new QGridLayout(m_decryptBox);
-			layout-&gt;setContentsMargins(11, 11, 11, 11);
-			layout-&gt;setSpacing(6);
+    // Start the load the first time the basket is shown:
+    if (!m_loadingLaunched) {
+        if (!m_locked)
+            QTimer::singleShot(0, this, SLOT(load()));
+        else {
+            Global::bnpView-&gt;notesStateChanged(); // Show &quot;Locked&quot; instead of &quot;Loading...&quot; in the statusbar
+        }
+    }
+
+    QBrush brush(backgroundColor()); // FIXME: share it for all the basket?
+    QRect clipRect(clipX, clipY, clipWidth, clipHeight);
+
+    if (m_locked) {
+        if (!m_decryptBox) {
+            m_decryptBox = new QFrame(this);
+            m_decryptBox-&gt;setFrameShape(QFrame::StyledPanel);
+            m_decryptBox-&gt;setFrameShadow(QFrame::Plain);
+            m_decryptBox-&gt;setLineWidth(1);
+
+            //QGridLayout* layout = new QGridLayout( m_decryptBox, 1, 1, 11, 6, &quot;decryptBoxLayout&quot;);
+            QGridLayout *layout = new QGridLayout(m_decryptBox);
+            layout-&gt;setContentsMargins(11, 11, 11, 11);
+            layout-&gt;setSpacing(6);
 
 #ifdef HAVE_LIBGPGME
-			m_button = new QPushButton( m_decryptBox);
-			m_button-&gt;setText( i18n( &quot;&amp;Unlock&quot; ) );
-			layout-&gt;addWidget( m_button, 1, 2 );
-			connect( m_button, SIGNAL( clicked() ), this, SLOT( unlock() ) );
+            m_button = new QPushButton(m_decryptBox);
+            m_button-&gt;setText(i18n(&quot;&amp;Unlock&quot;));
+            layout-&gt;addWidget(m_button, 1, 2);
+            connect(m_button, SIGNAL(clicked()), this, SLOT(unlock()));
 #endif
-			QLabel* label = new QLabel( m_decryptBox);
-			QString text = &quot;&lt;b&gt;&quot; + i18n(&quot;Password protected basket.&quot;) + &quot;&lt;/b&gt;&lt;br/&gt;&quot;;
+            QLabel* label = new QLabel(m_decryptBox);
+            QString text = &quot;&lt;b&gt;&quot; + i18n(&quot;Password protected basket.&quot;) + &quot;&lt;/b&gt;&lt;br/&gt;&quot;;
 #ifdef HAVE_LIBGPGME
-			label-&gt;setText( text + i18n(&quot;Press Unlock to access it.&quot;) );
+            label-&gt;setText(text + i18n(&quot;Press Unlock to access it.&quot;));
 #else
-			label-&gt;setText( text + i18n(&quot;Encryption is not supported by&lt;br/&gt;this version of %1.&quot;, KGlobal::mainComponent().aboutData()-&gt;programName()));
+            label-&gt;setText(text + i18n(&quot;Encryption is not supported by&lt;br/&gt;this version of %1.&quot;, KGlobal::mainComponent().aboutData()-&gt;programName()));
 #endif
-			label-&gt;setAlignment( Qt::AlignTop );
-			layout-&gt;addWidget( label, 0, 1, 1, 2 );
-			QLabel* pixmap = new QLabel( m_decryptBox );
-			pixmap-&gt;setPixmap( KIconLoader::global()-&gt;loadIcon(&quot;encrypted&quot;, KIconLoader::NoGroup, KIconLoader::SizeHuge) );
-			layout-&gt;addWidget( pixmap, 0, 0, 2, 0 );
-
-			QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
-			layout-&gt;addItem( spacer, 1, 1 );
-
-			label = new QLabel(&quot;&lt;small&gt;&quot; +
-				i18n(&quot;To make baskets stay unlocked, change the automatic&lt;br&gt;&quot;
-				     &quot;locking duration in the application settings.&quot;) + &quot;&lt;/small&gt;&quot;,
-				m_decryptBox);
-			//label-&gt;setFixedWidth(label-&gt;sizeHint().width() / 2);
-			label-&gt;setAlignment( Qt::AlignTop );
-			layout-&gt;addWidget( label, 2, 0, 1, 3 );
-
-			m_decryptBox-&gt;resize(layout-&gt;sizeHint());
-		}
-		if(m_decryptBox-&gt;isHidden())
-		{
-			m_decryptBox-&gt;show();
-		}
+            label-&gt;setAlignment(Qt::AlignTop);
+            layout-&gt;addWidget(label, 0, 1, 1, 2);
+            QLabel* pixmap = new QLabel(m_decryptBox);
+            pixmap-&gt;setPixmap(KIconLoader::global()-&gt;loadIcon(&quot;encrypted&quot;, KIconLoader::NoGroup, KIconLoader::SizeHuge));
+            layout-&gt;addWidget(pixmap, 0, 0, 2, 0);
+
+            QSpacerItem* spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+            layout-&gt;addItem(spacer, 1, 1);
+
+            label = new QLabel(&quot;&lt;small&gt;&quot; +
+                               i18n(&quot;To make baskets stay unlocked, change the automatic&lt;br&gt;&quot;
+                                    &quot;locking duration in the application settings.&quot;) + &quot;&lt;/small&gt;&quot;,
+                               m_decryptBox);
+            //label-&gt;setFixedWidth(label-&gt;sizeHint().width() / 2);
+            label-&gt;setAlignment(Qt::AlignTop);
+            layout-&gt;addWidget(label, 2, 0, 1, 3);
+
+            m_decryptBox-&gt;resize(layout-&gt;sizeHint());
+        }
+        if (m_decryptBox-&gt;isHidden()) {
+            m_decryptBox-&gt;show();
+        }
 #ifdef HAVE_LIBGPGME
-		m_button-&gt;setFocus();
+        m_button-&gt;setFocus();
 #endif
-		m_decryptBox-&gt;move((visibleWidth() - m_decryptBox-&gt;width()) / 2,
-							(visibleHeight() - m_decryptBox-&gt;height()) / 2);
-	}
-	else
-	{
-		if(m_decryptBox &amp;&amp; !m_decryptBox-&gt;isHidden())
-			m_decryptBox-&gt;hide();
-	}
-
-	// Draw notes (but not when it's not loaded or locked yet):
-        Note *note = ((m_loaded || m_locked) ? m_firstNote : 0);
-	while (note) {
-		note-&gt;draw(painter, clipRect);
-		note = note-&gt;next();
-	}
-	enableActions();
-
-	// Draw loading message:
-	if (!m_loaded) {
-		QPixmap pixmap(visibleWidth(), visibleHeight()); // TODO: Clip it to asked size only!
-		QPainter painter2(&amp;pixmap);
-		QTextDocument rt;
-		rt.setHtml(QString(&quot;&lt;center&gt;%1&lt;/center&gt;&quot;).arg(i18n(&quot;Loading...&quot;)));
-		rt.setTextWidth(visibleWidth());
-		int hrt = rt.size().height();
-		painter2.fillRect(0, 0, visibleWidth(), visibleHeight(), brush);
-		blendBackground(painter2, QRect(0, 0, visibleWidth(), visibleHeight()), -1, -1, /*opaque=*/true);
-		QPalette pal = palette();
-		pal.setColor(QPalette::WindowText, textColor());
-		painter2.translate(0, (visibleHeight() -hrt) / 2);
-		QAbstractTextDocumentLayout::PaintContext context;
-		context.palette = pal;
-		rt.documentLayout()-&gt;draw(&amp;painter2, context);
-		painter2.end();
-		painter-&gt;drawPixmap(0, 0, pixmap);
-		return; // TODO: Clip to the wanted rectangle
-	}
-
-	// We will draw blank areas below.
-	// For each rectangle to be draw there is three ways to do so:
-	// - The rectangle is full of the background COLOR  =&gt; we fill a rect directly on screen
-	// - The rectangle is full of the background PIXMAP =&gt; we draw it directly on screen (we draw m_opaqueBackgroundPixmap that is not transparent)
-	// - The rectangle contains the resizer             =&gt; We draw it on an offscreen buffer and then paint the buffer on screen
-	// If the background image is not tiled, we know that recomputeBlankRects() broken rects so that they are full of either background pixmap or color, but not a mix.
-
-	// Draw blank areas (see the last preparation above):
-	QPixmap  pixmap;
-	QPainter painter2;
-	QRect    rect;
-	for (QList&lt;QRect&gt;::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
-		rect = clipRect.intersect(*it);
-		if (rect.width() &gt; 0 &amp;&amp; rect.height() &gt; 0) {
-			// If there is an inserter to draw, draw the image off screen,
-			// apply the inserter and then draw the image on screen:
-			if (  (inserterShown() &amp;&amp; rect.intersects(inserterRect()))  ||  (m_isSelecting &amp;&amp; rect.intersects(m_selectionRect))  ) {
-				pixmap = QPixmap(rect.width(), rect.height());
-				painter2.begin(&amp;pixmap);
-				painter2.fillRect(0, 0, rect.width(), rect.height(), backgroundColor());
-				blendBackground(painter2, rect, -1, -1, /*opaque=*/true);
-				// Draw inserter:
-				if (inserterShown() &amp;&amp; rect.intersects(inserterRect()))
-					drawInserter(painter2, rect.x(), rect.y());
-				// Draw selection rect:
-				if (m_isSelecting &amp;&amp; rect.intersects(m_selectionRect)) {
-					QRect selectionRect = m_selectionRect;
-					selectionRect.translate(-rect.x(), -rect.y());
-					QRect selectionRectInside(selectionRect.x() + 1, selectionRect.y() + 1, selectionRect.width() - 2, selectionRect.height() - 2);
-					if (selectionRectInside.width() &gt; 0 &amp;&amp; selectionRectInside.height() &gt; 0) {
-						QColor insideColor = selectionRectInsideColor();
-						painter2.fillRect(selectionRectInside, insideColor);
-						selectionRectInside.translate(rect.x(), rect.y());
-						blendBackground(painter2, selectionRectInside, rect.x(), rect.y(), true, /*&amp;*/m_selectedBackgroundPixmap);
-					}
-					painter2.setPen(palette().color(QPalette::Highlight).darker());
-					painter2.drawRect(selectionRect);
-					painter2.setPen(Tools::mixColor(palette().color(QPalette::Highlight).darker(), backgroundColor()));
-					painter2.drawPoint(selectionRect.topLeft());
-					painter2.drawPoint(selectionRect.topRight());
-					painter2.drawPoint(selectionRect.bottomLeft());
-					painter2.drawPoint(selectionRect.bottomRight());
-				}
-				painter2.end();
-				painter-&gt;drawPixmap(rect.x(), rect.y(), pixmap);
-			// If it's only a blank rectangle to draw, draw it directly on screen (faster!!!):
-			} else if ( ! hasBackgroundImage() ) {
-				painter-&gt;fillRect(rect, backgroundColor());
-			// It's either a background pixmap to draw or a background color to fill:
-			} else {
-				if (isTiledBackground() || (rect.x() &lt; backgroundPixmap()-&gt;width() &amp;&amp; rect.y() &lt; backgroundPixmap()-&gt;height()))
-					blendBackground(*painter, rect, 0, 0, /*opaque=*/true);
-				else
-					painter-&gt;fillRect(rect, backgroundColor());
-			}
-		}
-	}
+        m_decryptBox-&gt;move((visibleWidth() - m_decryptBox-&gt;width()) / 2,
+                           (visibleHeight() - m_decryptBox-&gt;height()) / 2);
+    } else {
+        if (m_decryptBox &amp;&amp; !m_decryptBox-&gt;isHidden())
+            m_decryptBox-&gt;hide();
+    }
+
+    // Draw notes (but not when it's not loaded or locked yet):
+    Note *note = ((m_loaded || m_locked) ? m_firstNote : 0);
+    while (note) {
+        note-&gt;draw(painter, clipRect);
+        note = note-&gt;next();
+    }
+    enableActions();
+
+    // Draw loading message:
+    if (!m_loaded) {
+        QPixmap pixmap(visibleWidth(), visibleHeight()); // TODO: Clip it to asked size only!
+        QPainter painter2(&amp;pixmap);
+        QTextDocument rt;
+        rt.setHtml(QString(&quot;&lt;center&gt;%1&lt;/center&gt;&quot;).arg(i18n(&quot;Loading...&quot;)));
+        rt.setTextWidth(visibleWidth());
+        int hrt = rt.size().height();
+        painter2.fillRect(0, 0, visibleWidth(), visibleHeight(), brush);
+        blendBackground(painter2, QRect(0, 0, visibleWidth(), visibleHeight()), -1, -1, /*opaque=*/true);
+        QPalette pal = palette();
+        pal.setColor(QPalette::WindowText, textColor());
+        painter2.translate(0, (visibleHeight() - hrt) / 2);
+        QAbstractTextDocumentLayout::PaintContext context;
+        context.palette = pal;
+        rt.documentLayout()-&gt;draw(&amp;painter2, context);
+        painter2.end();
+        painter-&gt;drawPixmap(0, 0, pixmap);
+        return; // TODO: Clip to the wanted rectangle
+    }
+
+    // We will draw blank areas below.
+    // For each rectangle to be draw there is three ways to do so:
+    // - The rectangle is full of the background COLOR  =&gt; we fill a rect directly on screen
+    // - The rectangle is full of the background PIXMAP =&gt; we draw it directly on screen (we draw m_opaqueBackgroundPixmap that is not transparent)
+    // - The rectangle contains the resizer             =&gt; We draw it on an offscreen buffer and then paint the buffer on screen
+    // If the background image is not tiled, we know that recomputeBlankRects() broken rects so that they are full of either background pixmap or color, but not a mix.
+
+    // Draw blank areas (see the last preparation above):
+    QPixmap  pixmap;
+    QPainter painter2;
+    QRect    rect;
+    for (QList&lt;QRect&gt;::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
+        rect = clipRect.intersect(*it);
+        if (rect.width() &gt; 0 &amp;&amp; rect.height() &gt; 0) {
+            // If there is an inserter to draw, draw the image off screen,
+            // apply the inserter and then draw the image on screen:
+            if ((inserterShown() &amp;&amp; rect.intersects(inserterRect()))  || (m_isSelecting &amp;&amp; rect.intersects(m_selectionRect))) {
+                pixmap = QPixmap(rect.width(), rect.height());
+                painter2.begin(&amp;pixmap);
+                painter2.fillRect(0, 0, rect.width(), rect.height(), backgroundColor());
+                blendBackground(painter2, rect, -1, -1, /*opaque=*/true);
+                // Draw inserter:
+                if (inserterShown() &amp;&amp; rect.intersects(inserterRect()))
+                    drawInserter(painter2, rect.x(), rect.y());
+                // Draw selection rect:
+                if (m_isSelecting &amp;&amp; rect.intersects(m_selectionRect)) {
+                    QRect selectionRect = m_selectionRect;
+                    selectionRect.translate(-rect.x(), -rect.y());
+                    QRect selectionRectInside(selectionRect.x() + 1, selectionRect.y() + 1, selectionRect.width() - 2, selectionRect.height() - 2);
+                    if (selectionRectInside.width() &gt; 0 &amp;&amp; selectionRectInside.height() &gt; 0) {
+                        QColor insideColor = selectionRectInsideColor();
+                        painter2.fillRect(selectionRectInside, insideColor);
+                        selectionRectInside.translate(rect.x(), rect.y());
+                        blendBackground(painter2, selectionRectInside, rect.x(), rect.y(), true, /*&amp;*/m_selectedBackgroundPixmap);
+                    }
+                    painter2.setPen(palette().color(QPalette::Highlight).darker());
+                    painter2.drawRect(selectionRect);
+                    painter2.setPen(Tools::mixColor(palette().color(QPalette::Highlight).darker(), backgroundColor()));
+                    painter2.drawPoint(selectionRect.topLeft());
+                    painter2.drawPoint(selectionRect.topRight());
+                    painter2.drawPoint(selectionRect.bottomLeft());
+                    painter2.drawPoint(selectionRect.bottomRight());
+                }
+                painter2.end();
+                painter-&gt;drawPixmap(rect.x(), rect.y(), pixmap);
+                // If it's only a blank rectangle to draw, draw it directly on screen (faster!!!):
+            } else if (! hasBackgroundImage()) {
+                painter-&gt;fillRect(rect, backgroundColor());
+                // It's either a background pixmap to draw or a background color to fill:
+            } else {
+                if (isTiledBackground() || (rect.x() &lt; backgroundPixmap()-&gt;width() &amp;&amp; rect.y() &lt; backgroundPixmap()-&gt;height()))
+                    blendBackground(*painter, rect, 0, 0, /*opaque=*/true);
+                else
+                    painter-&gt;fillRect(rect, backgroundColor());
+            }
+        }
+    }
 }
 
 /*  rect(x,y,width,height)==(xBackgroundToDraw,yBackgroundToDraw,widthToDraw,heightToDraw)
  */
 void Basket::blendBackground(QPainter &amp;painter, const QRect &amp;rect, int xPainter, int yPainter, bool opaque, QPixmap *bg)
 {
-	if (xPainter == -1 &amp;&amp; yPainter == -1) {
-		xPainter = rect.x();
-		yPainter = rect.y();
-	}
+    if (xPainter == -1 &amp;&amp; yPainter == -1) {
+        xPainter = rect.x();
+        yPainter = rect.y();
+    }
 
-	if (hasBackgroundImage()) {
-		const QPixmap *bgPixmap = (bg ? /* * */bg : (opaque ? m_opaqueBackgroundPixmap : m_backgroundPixmap));
-		if (isTiledBackground())
-			painter.drawTiledPixmap(rect.x() - xPainter, rect.y() - yPainter, rect.width(), rect.height(), *bgPixmap, rect.x(), rect.y());
-		else
-			painter.drawPixmap(rect.x() - xPainter, rect.y() - yPainter, *bgPixmap, rect.x(), rect.y(), rect.width(), rect.height());
-	}
+    if (hasBackgroundImage()) {
+        const QPixmap *bgPixmap = (bg ? /* * */bg : (opaque ? m_opaqueBackgroundPixmap : m_backgroundPixmap));
+        if (isTiledBackground())
+            painter.drawTiledPixmap(rect.x() - xPainter, rect.y() - yPainter, rect.width(), rect.height(), *bgPixmap, rect.x(), rect.y());
+        else
+            painter.drawPixmap(rect.x() - xPainter, rect.y() - yPainter, *bgPixmap, rect.x(), rect.y(), rect.width(), rect.height());
+    }
 }
 
 void Basket::recomputeBlankRects()
 {
-	m_blankAreas.clear();
-	m_blankAreas.append( QRect(0, 0, contentsWidth(), contentsHeight()) );
+    m_blankAreas.clear();
+    m_blankAreas.append(QRect(0, 0, contentsWidth(), contentsHeight()));
 
-	FOR_EACH_NOTE (note)
-		note-&gt;recomputeBlankRects(m_blankAreas);
+    FOR_EACH_NOTE(note)
+    note-&gt;recomputeBlankRects(m_blankAreas);
 
-	// See the drawing of blank areas in Basket::drawContents()
-	if (hasBackgroundImage() &amp;&amp; ! isTiledBackground())
-		substractRectOnAreas( QRect(0, 0, backgroundPixmap()-&gt;width(), backgroundPixmap()-&gt;height()), m_blankAreas, false );
+    // See the drawing of blank areas in Basket::drawContents()
+    if (hasBackgroundImage() &amp;&amp; ! isTiledBackground())
+        substractRectOnAreas(QRect(0, 0, backgroundPixmap()-&gt;width(), backgroundPixmap()-&gt;height()), m_blankAreas, false);
 }
 
 void Basket::addAnimatedNote(Note *note)
 {
-	if (m_animatedNotes.isEmpty()) {
-		m_animationTimer.start(FRAME_DELAY);
-		m_lastFrameTime = QTime::currentTime();
-	}
+    if (m_animatedNotes.isEmpty()) {
+        m_animationTimer.start(FRAME_DELAY);
+        m_lastFrameTime = QTime::currentTime();
+    }
 
-	m_animatedNotes.append(note);
+    m_animatedNotes.append(note);
 }
 
 void Basket::unsetNotesWidth()
 {
-	Note *note = m_firstNote;
-	while (note) {
-		note-&gt;unsetWidth();
-		note = note-&gt;next();
-	}
+    Note *note = m_firstNote;
+    while (note) {
+        note-&gt;unsetWidth();
+        note = note-&gt;next();
+    }
 }
 
 void Basket::relayoutNotes(bool animate)
 {
-	if (Global::bnpView-&gt;currentBasket() != this)
-		return; // Optimize load time, and basket will be relaid out when activated, anyway
-
-	if (!Settings::playAnimations())
-		animate = false;
-
-	if (!animate) {
-		m_animatedNotes.clear();
-		m_animationTimer.stop();
-	}
-
-	int h     = 0;
-	tmpWidth  = 0;
-	tmpHeight = 0;
-	Note *note = m_firstNote;
-	while (note) {
-		if (note-&gt;matching()) {
-			note-&gt;relayoutAt(0, h, animate);
-			if (note-&gt;hasResizer()) {
-				int minGroupWidth = note-&gt;minRight() - note-&gt;finalX();
-				if (note-&gt;groupWidth() &lt; minGroupWidth) {
-					note-&gt;setGroupWidth(minGroupWidth);
-					relayoutNotes(animate); // Redo the thing, but this time it should not recurse
-					return;
-				}
-			}
-			h += note-&gt;finalHeight();
-		}
-		note = note-&gt;next();
-	}
-
-	if (isFreeLayout())
-		tmpHeight += 100;
-	else
-		tmpHeight += 15;
-
-	resizeContents( qMax(tmpWidth, visibleWidth()), qMax(tmpHeight, visibleHeight()) );
-	recomputeBlankRects();
-	placeEditor();
-	doHoverEffects();
-	updateContents();
+    if (Global::bnpView-&gt;currentBasket() != this)
+        return; // Optimize load time, and basket will be relaid out when activated, anyway
+
+    if (!Settings::playAnimations())
+        animate = false;
+
+    if (!animate) {
+        m_animatedNotes.clear();
+        m_animationTimer.stop();
+    }
+
+    int h     = 0;
+    tmpWidth  = 0;
+    tmpHeight = 0;
+    Note *note = m_firstNote;
+    while (note) {
+        if (note-&gt;matching()) {
+            note-&gt;relayoutAt(0, h, animate);
+            if (note-&gt;hasResizer()) {
+                int minGroupWidth = note-&gt;minRight() - note-&gt;finalX();
+                if (note-&gt;groupWidth() &lt; minGroupWidth) {
+                    note-&gt;setGroupWidth(minGroupWidth);
+                    relayoutNotes(animate); // Redo the thing, but this time it should not recurse
+                    return;
+                }
+            }
+            h += note-&gt;finalHeight();
+        }
+        note = note-&gt;next();
+    }
+
+    if (isFreeLayout())
+        tmpHeight += 100;
+    else
+        tmpHeight += 15;
+
+    resizeContents(qMax(tmpWidth, visibleWidth()), qMax(tmpHeight, visibleHeight()));
+    recomputeBlankRects();
+    placeEditor();
+    doHoverEffects();
+    updateContents();
 }
 
 void Basket::updateNote(Note *note)
 {
-	updateContents(note-&gt;rect());
-	if (note-&gt;hasResizer())
-		updateContents(note-&gt;resizerRect());
+    updateContents(note-&gt;rect());
+    if (note-&gt;hasResizer())
+        updateContents(note-&gt;resizerRect());
 }
 
 void Basket::animateObjects()
 {
-	QList&lt;Note*&gt;::iterator it;
-	for (it = m_animatedNotes.begin(); it != m_animatedNotes.end(); )
-//		if ((*it)-&gt;y() &gt;= contentsY() &amp;&amp; (*it)-&gt;bottom() &lt;= contentsY() + contentsWidth())
-//			updateNote(*it);
-		if ((*it)-&gt;advance())
-			it = m_animatedNotes.erase(it);
-	else {
-//			if ((*it)-&gt;y() &gt;= contentsY() &amp;&amp; (*it)-&gt;bottom() &lt;= contentsY() + contentsWidth())
-//				updateNote(*it);
-		++it;
-	}
-
-	if (m_animatedNotes.isEmpty()) {
-		// Stop animation timer:
-		m_animationTimer.stop();
-		// Reset all onTop notes:
-		Note* note = m_firstNote;
-		while (note) {
-			note-&gt;setOnTop(false);
-			note = note-&gt;next();
-		}
-	}
-
-	if (m_focusedNote)
-		ensureNoteVisible(m_focusedNote);
-
-	// We refresh content if it was the last frame,
-	// or if the drawing of the last frame was not too long.
-	if (!m_animationTimer.isActive() || (m_lastFrameTime.msecsTo(QTime::currentTime()) &lt; FRAME_DELAY*11/10)) { // *11/10 == *1.1 : We keep a 0.1 security margin
-		m_lastFrameTime = m_lastFrameTime.addMSecs(FRAME_DELAY);                                               // because timers are not accurate and can trigger late
-		//m_lastFrameTime = QTime::currentTime();
+    QList&lt;Note*&gt;::iterator it;
+    for (it = m_animatedNotes.begin(); it != m_animatedNotes.end();)
+//      if ((*it)-&gt;y() &gt;= contentsY() &amp;&amp; (*it)-&gt;bottom() &lt;= contentsY() + contentsWidth())
+//          updateNote(*it);
+        if ((*it)-&gt;advance())
+            it = m_animatedNotes.erase(it);
+        else {
+//          if ((*it)-&gt;y() &gt;= contentsY() &amp;&amp; (*it)-&gt;bottom() &lt;= contentsY() + contentsWidth())
+//              updateNote(*it);
+            ++it;
+        }
+
+    if (m_animatedNotes.isEmpty()) {
+        // Stop animation timer:
+        m_animationTimer.stop();
+        // Reset all onTop notes:
+        Note* note = m_firstNote;
+        while (note) {
+            note-&gt;setOnTop(false);
+            note = note-&gt;next();
+        }
+    }
+
+    if (m_focusedNote)
+        ensureNoteVisible(m_focusedNote);
+
+    // We refresh content if it was the last frame,
+    // or if the drawing of the last frame was not too long.
+    if (!m_animationTimer.isActive() || (m_lastFrameTime.msecsTo(QTime::currentTime()) &lt; FRAME_DELAY*11 / 10)) { // *11/10 == *1.1 : We keep a 0.1 security margin
+        m_lastFrameTime = m_lastFrameTime.addMSecs(FRAME_DELAY);                                               // because timers are not accurate and can trigger late
+        //m_lastFrameTime = QTime::currentTime();
 //kDebug() &lt;&lt; &quot;&gt;&gt;&quot; &lt;&lt; m_lastFrameTime.toString(&quot;hh:mm:ss.zzz&quot;);
-		if (m_underMouse)
-			doHoverEffects();
-		recomputeBlankRects();
-		//relayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view!
-		updateContents();
-	// If the drawing of the last frame was too long, we skip the drawing of the current and do the next one:
-	} else {
-		m_lastFrameTime = m_lastFrameTime.addMSecs(FRAME_DELAY);
+        if (m_underMouse)
+            doHoverEffects();
+        recomputeBlankRects();
+        //relayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view!
+        updateContents();
+        // If the drawing of the last frame was too long, we skip the drawing of the current and do the next one:
+    } else {
+        m_lastFrameTime = m_lastFrameTime.addMSecs(FRAME_DELAY);
 //kDebug() &lt;&lt; &quot;+=&quot; &lt;&lt; m_lastFrameTime.toString(&quot;hh:mm:ss.zzz&quot;);
-		animateObjects();
-	}
+        animateObjects();
+    }
 
-	doHoverEffects();
-	placeEditor();
+    doHoverEffects();
+    placeEditor();
 
-/*	int delta = m_deltaY / 3;
-	if (delta == 0       &amp;&amp; m_deltaY != 0)
-	delta = (m_deltaY &gt; 0 ? 1 : -1);
-	m_deltaY -= delta;
-	resizeContents(contentsWidth(), contentsHeight() + delta); //m_lastNote-&gt;y() + m_lastNote-&gt;height()
-*/
+    /*  int delta = m_deltaY / 3;
+        if (delta == 0       &amp;&amp; m_deltaY != 0)
+        delta = (m_deltaY &gt; 0 ? 1 : -1);
+        m_deltaY -= delta;
+        resizeContents(contentsWidth(), contentsHeight() + delta); //m_lastNote-&gt;y() + m_lastNote-&gt;height()
+    */
 }
 
 void Basket::popupEmblemMenu(Note *note, int emblemNumber)
 {
-	m_tagPopupNote = note;
-	State *state = note-&gt;stateForEmblemNumber(emblemNumber);
-	State *nextState = state-&gt;nextState(/*cycle=*/false);
-	Tag *tag = state-&gt;parentTag();
-	m_tagPopup = tag;
-
-	QKeySequence sequence = tag-&gt;shortcut().primary();
-	bool sequenceOnDelete = (nextState == 0 &amp;&amp; !tag-&gt;shortcut().isEmpty());
-
-	KMenu menu(this);
-	if (tag-&gt;countStates() == 1) {
-		menu.addTitle(/*SmallIcon(state-&gt;icon()), */tag-&gt;name());
-		KAction* act;
-		act = new KAction(KIcon(&quot;edit-delete&quot;), i18n(&quot;&amp;Remove&quot;), &amp;menu);
-		act-&gt;setData(1);
-		menu.addAction(act);
-		act = new KAction( KIcon(&quot;configure&quot;),  i18n(&quot;&amp;Customize...&quot;), &amp;menu);
-		act-&gt;setData(2);
-		menu.addAction(act);
-
-		menu.addSeparator();
-
-		act = new KAction( KIcon(&quot;search-filter&quot;),     i18n(&quot;&amp;Filter by this Tag&quot;), &amp;menu);
-		act-&gt;setData(3);
-		menu.addAction(act);
-	} else {
-		menu.addTitle(tag-&gt;name());
-		QList&lt;State*&gt;::iterator it;
-		State *currentState;
-
-		int i = 10;
-		// QActionGroup makes the actions exclusive; turns checkboxes into radio
-		// buttons on some styles.
-		QActionGroup *emblemGroup = new QActionGroup(&amp;menu);
-		for (it = tag-&gt;states().begin(); it != tag-&gt;states().end(); ++it) {
-			currentState = *it;
-			QKeySequence sequence;
-			if (currentState == nextState &amp;&amp; !tag-&gt;shortcut().isEmpty())
-			    sequence = tag-&gt;shortcut().primary();
-
-			StateAction *sa = new StateAction(currentState, KShortcut(sequence), false);
-			sa-&gt;setChecked(state == currentState);
-			sa-&gt;setActionGroup(emblemGroup);
-			sa-&gt;setData(i);
-
-			menu.addAction(sa);
-			if (currentState == nextState &amp;&amp; !tag-&gt;shortcut().isEmpty())
-				sa-&gt;setShortcut(sequence);
-			++i;
-		}
-
-		menu.addSeparator();
-
-		KAction *act = new KAction(&amp;menu);
-	        act-&gt;setIcon(KIcon(&quot;edit-delete&quot;));
-        	act-&gt;setText(i18n(&quot;&amp;Remove&quot;));
-        	act-&gt;setShortcut(sequenceOnDelete ? sequence : QKeySequence());
-		act-&gt;setData(1);
-		menu.addAction(act);
-		act = new KAction(
-				   KIcon(&quot;configure&quot;),
-				   i18n(&quot;&amp;Customize...&quot;),
-				   &amp;menu
-				);
-		act-&gt;setData(2);
-		menu.addAction(act);
-
-		menu.addSeparator();
-
-		act = new KAction( KIcon(&quot;search-filter&quot;),
-				   i18n(&quot;&amp;Filter by this Tag&quot;),
-				   &amp;menu);
-		act-&gt;setData(3);
-		menu.addAction(act);
-		act = new KAction(
-				   KIcon(&quot;search-filter&quot;),
-				   i18n(&quot;Filter by this &amp;State&quot;),
-				   &amp;menu);
-		act-&gt;setData(4);
-		menu.addAction(act);
-	}
-	if (sequenceOnDelete) {
-		// Not sure if this is equivalent to menu.setAccel(sequence, 1);
-		menu.actionAt(QPoint(0, 1))-&gt;setShortcut(sequence);
-	}
-
-	connect( &amp;menu, SIGNAL(triggered(QAction *)), this, SLOT(toggledStateInMenu(QAction *)) );
-	connect( &amp;menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering())        );
-	connect( &amp;menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick())      );
-
-	m_lockedHovering = true;
-	menu.exec(QCursor::pos());
+    m_tagPopupNote = note;
+    State *state = note-&gt;stateForEmblemNumber(emblemNumber);
+    State *nextState = state-&gt;nextState(/*cycle=*/false);
+    Tag *tag = state-&gt;parentTag();
+    m_tagPopup = tag;
+
+    QKeySequence sequence = tag-&gt;shortcut().primary();
+    bool sequenceOnDelete = (nextState == 0 &amp;&amp; !tag-&gt;shortcut().isEmpty());
+
+    KMenu menu(this);
+    if (tag-&gt;countStates() == 1) {
+        menu.addTitle(/*SmallIcon(state-&gt;icon()), */tag-&gt;name());
+        KAction* act;
+        act = new KAction(KIcon(&quot;edit-delete&quot;), i18n(&quot;&amp;Remove&quot;), &amp;menu);
+        act-&gt;setData(1);
+        menu.addAction(act);
+        act = new KAction(KIcon(&quot;configure&quot;),  i18n(&quot;&amp;Customize...&quot;), &amp;menu);
+        act-&gt;setData(2);
+        menu.addAction(act);
+
+        menu.addSeparator();
+
+        act = new KAction(KIcon(&quot;search-filter&quot;),     i18n(&quot;&amp;Filter by this Tag&quot;), &amp;menu);
+        act-&gt;setData(3);
+        menu.addAction(act);
+    } else {
+        menu.addTitle(tag-&gt;name());
+        QList&lt;State*&gt;::iterator it;
+        State *currentState;
+
+        int i = 10;
+        // QActionGroup makes the actions exclusive; turns checkboxes into radio
+        // buttons on some styles.
+        QActionGroup *emblemGroup = new QActionGroup(&amp;menu);
+        for (it = tag-&gt;states().begin(); it != tag-&gt;states().end(); ++it) {
+            currentState = *it;
+            QKeySequence sequence;
+            if (currentState == nextState &amp;&amp; !tag-&gt;shortcut().isEmpty())
+                sequence = tag-&gt;shortcut().primary();
+
+            StateAction *sa = new StateAction(currentState, KShortcut(sequence), false);
+            sa-&gt;setChecked(state == currentState);
+            sa-&gt;setActionGroup(emblemGroup);
+            sa-&gt;setData(i);
+
+            menu.addAction(sa);
+            if (currentState == nextState &amp;&amp; !tag-&gt;shortcut().isEmpty())
+                sa-&gt;setShortcut(sequence);
+            ++i;
+        }
+
+        menu.addSeparator();
+
+        KAction *act = new KAction(&amp;menu);
+        act-&gt;setIcon(KIcon(&quot;edit-delete&quot;));
+        act-&gt;setText(i18n(&quot;&amp;Remove&quot;));
+        act-&gt;setShortcut(sequenceOnDelete ? sequence : QKeySequence());
+        act-&gt;setData(1);
+        menu.addAction(act);
+        act = new KAction(
+            KIcon(&quot;configure&quot;),
+            i18n(&quot;&amp;Customize...&quot;),
+            &amp;menu
+        );
+        act-&gt;setData(2);
+        menu.addAction(act);
+
+        menu.addSeparator();
+
+        act = new KAction(KIcon(&quot;search-filter&quot;),
+                          i18n(&quot;&amp;Filter by this Tag&quot;),
+                          &amp;menu);
+        act-&gt;setData(3);
+        menu.addAction(act);
+        act = new KAction(
+            KIcon(&quot;search-filter&quot;),
+            i18n(&quot;Filter by this &amp;State&quot;),
+            &amp;menu);
+        act-&gt;setData(4);
+        menu.addAction(act);
+    }
+    if (sequenceOnDelete) {
+        // Not sure if this is equivalent to menu.setAccel(sequence, 1);
+        menu.actionAt(QPoint(0, 1))-&gt;setShortcut(sequence);
+    }
+
+    connect(&amp;menu, SIGNAL(triggered(QAction *)), this, SLOT(toggledStateInMenu(QAction *)));
+    connect(&amp;menu, SIGNAL(aboutToHide()),  this, SLOT(unlockHovering()));
+    connect(&amp;menu, SIGNAL(aboutToHide()),  this, SLOT(disableNextClick()));
+
+    m_lockedHovering = true;
+    menu.exec(QCursor::pos());
 }
 
 void Basket::toggledStateInMenu(QAction* action)
 {
-	int id = action-&gt;data().toInt();
-	if (id == 1) {
-		removeTagFromSelectedNotes(m_tagPopup);
-		//m_tagPopupNote-&gt;removeTag(m_tagPopup);
-		//m_tagPopupNote-&gt;setWidth(0); // To force a new layout computation
-		updateEditorAppearance();
-		filterAgain();
-		save();
-		return;
-	}
-	if (id == 2) { // Customize this State:
-		TagsEditDialog dialog(this, m_tagPopupNote-&gt;stateOfTag(m_tagPopup));
-		dialog.exec();
-		return;
-	}
-	if (id == 3) { // Filter by this Tag
-		decoration()-&gt;filterBar()-&gt;filterTag(m_tagPopup);
-		return;
-	}
-	if (id == 4) { // Filter by this State
-		decoration()-&gt;filterBar()-&gt;filterState(m_tagPopupNote-&gt;stateOfTag(m_tagPopup));
-		return;
-	}
-
-	/*addStateToSelectedNotes*/changeStateOfSelectedNotes(m_tagPopup-&gt;states()[id - 10] /*, orReplace=true*/);
-	//m_tagPopupNote-&gt;addState(m_tagPopup-&gt;states()[id - 10], true);
-	filterAgain();
-	save();
+    int id = action-&gt;data().toInt();
+    if (id == 1) {
+        removeTagFromSelectedNotes(m_tagPopup);
+        //m_tagPopupNote-&gt;removeTag(m_tagPopup);
+        //m_tagPopupNote-&gt;setWidth(0); // To force a new layout computation
+        updateEditorAppearance();
+        filterAgain();
+        save();
+        return;
+    }
+    if (id == 2) { // Customize this State:
+        TagsEditDialog dialog(this, m_tagPopupNote-&gt;stateOfTag(m_tagPopup));
+        dialog.exec();
+        return;
+    }
+    if (id == 3) { // Filter by this Tag
+        decoration()-&gt;filterBar()-&gt;filterTag(m_tagPopup);
+        return;
+    }
+    if (id == 4) { // Filter by this State
+        decoration()-&gt;filterBar()-&gt;filterState(m_tagPopupNote-&gt;stateOfTag(m_tagPopup));
+        return;
+    }
+
+    /*addStateToSelectedNotes*/changeStateOfSelectedNotes(m_tagPopup-&gt;states()[id - 10] /*, orReplace=true*/);
+    //m_tagPopupNote-&gt;addState(m_tagPopup-&gt;states()[id - 10], true);
+    filterAgain();
+    save();
 }
 
 State* Basket::stateForTagFromSelectedNotes(Tag *tag)
 {
-	State *state = 0;
+    State *state = 0;
 
-	FOR_EACH_NOTE (note)
-		if (note-&gt;stateForTagFromSelectedNotes(tag, &amp;state) &amp;&amp; state == 0)
-			return 0;
-	return state;
+    FOR_EACH_NOTE(note)
+    if (note-&gt;stateForTagFromSelectedNotes(tag, &amp;state) &amp;&amp; state == 0)
+        return 0;
+    return state;
 }
 
 void Basket::activatedTagShortcut(Tag *tag)
 {
-	// Compute the next state to set:
-	State *state = stateForTagFromSelectedNotes(tag);
-	if (state)
-		state = state-&gt;nextState(/*cycle=*/false);
-	else
-		state = tag-&gt;states().first();
-
-	// Set or unset it:
-	if (state) {
-		FOR_EACH_NOTE (note)
-			note-&gt;addStateToSelectedNotes(state, /*orReplace=*/true);
-		updateEditorAppearance();
-	} else
-		removeTagFromSelectedNotes(tag);
+    // Compute the next state to set:
+    State *state = stateForTagFromSelectedNotes(tag);
+    if (state)
+        state = state-&gt;nextState(/*cycle=*/false);
+    else
+        state = tag-&gt;states().first();
+
+    // Set or unset it:
+    if (state) {
+        FOR_EACH_NOTE(note)
+        note-&gt;addStateToSelectedNotes(state, /*orReplace=*/true);
+        updateEditorAppearance();
+    } else
+        removeTagFromSelectedNotes(tag);
 
-	filterAgain();
-	save();
+    filterAgain();
+    save();
 }
 
 void Basket::popupTagsMenu(Note *note)
 {
-	m_tagPopupNote = note;
+    m_tagPopupNote = note;
 
-	KMenu menu(this);
-	menu.addTitle(i18n(&quot;Tags&quot;));
+    KMenu menu(this);
+    menu.addTitle(i18n(&quot;Tags&quot;));
 
-	Global::bnpView-&gt;populateTagsMenu(menu, note);
+    Global::bnpView-&gt;populateTagsMenu(menu, note);
 
-	m_lockedHovering = true;
-	menu.exec(QCursor::pos());
+    m_lockedHovering = true;
+    menu.exec(QCursor::pos());
 }
 
 void Basket::unlockHovering()
 {
-	m_lockedHovering = false;
-	doHoverEffects();
+    m_lockedHovering = false;
+    doHoverEffects();
 }
 
 void Basket::toggledTagInMenu(QAction *act)
 {
-	int id = act-&gt;data().toInt();
-	if (id == 1) { // Assign new Tag...
-		TagsEditDialog dialog(this, /*stateToEdit=*/0, /*addNewTag=*/true);
-		dialog.exec();
-		if (!dialog.addedStates().isEmpty()) {
-			State::List states = dialog.addedStates();
-			for (State::List::iterator itState = states.begin(); itState != states.end(); ++itState)
-				FOR_EACH_NOTE (note)
-					note-&gt;addStateToSelectedNotes(*itState);
-			updateEditorAppearance();
-			filterAgain();
-			save();
-		}
-		return;
-	}
-	if (id == 2) { // Remove All
-		removeAllTagsFromSelectedNotes();
-		filterAgain();
-		save();
-		return;
-	}
-	if (id == 3) { // Customize...
-		TagsEditDialog dialog(this);
-		dialog.exec();
-		return;
-	}
-
-	Tag *tag = Tag::all[id - 10];
-	if (!tag)
-		return;
-
-	if (m_tagPopupNote-&gt;hasTag(tag))
-		removeTagFromSelectedNotes(tag);
-	else
-		addTagToSelectedNotes(tag);
-	m_tagPopupNote-&gt;setWidth(0); // To force a new layout computation
-	filterAgain();
-	save();
+    int id = act-&gt;data().toInt();
+    if (id == 1) { // Assign new Tag...
+        TagsEditDialog dialog(this, /*stateToEdit=*/0, /*addNewTag=*/true);
+        dialog.exec();
+        if (!dialog.addedStates().isEmpty()) {
+            State::List states = dialog.addedStates();
+            for (State::List::iterator itState = states.begin(); itState != states.end(); ++itState)
+                FOR_EACH_NOTE(note)
+                note-&gt;addStateToSelectedNotes(*itState);
+            updateEditorAppearance();
+            filterAgain();
+            save();
+        }
+        return;
+    }
+    if (id == 2) { // Remove All
+        removeAllTagsFromSelectedNotes();
+        filterAgain();
+        save();
+        return;
+    }
+    if (id == 3) { // Customize...
+        TagsEditDialog dialog(this);
+        dialog.exec();
+        return;
+    }
+
+    Tag *tag = Tag::all[id - 10];
+    if (!tag)
+        return;
+
+    if (m_tagPopupNote-&gt;hasTag(tag))
+        removeTagFromSelectedNotes(tag);
+    else
+        addTagToSelectedNotes(tag);
+    m_tagPopupNote-&gt;setWidth(0); // To force a new layout computation
+    filterAgain();
+    save();
 }
 
 void Basket::addTagToSelectedNotes(Tag *tag)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;addTagToSelectedNotes(tag);
-	updateEditorAppearance();
+    FOR_EACH_NOTE(note)
+    note-&gt;addTagToSelectedNotes(tag);
+    updateEditorAppearance();
 }
 
 void Basket::removeTagFromSelectedNotes(Tag *tag)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;removeTagFromSelectedNotes(tag);
-	updateEditorAppearance();
+    FOR_EACH_NOTE(note)
+    note-&gt;removeTagFromSelectedNotes(tag);
+    updateEditorAppearance();
 }
 
 void Basket::addStateToSelectedNotes(State *state)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;addStateToSelectedNotes(state);
-	updateEditorAppearance();
+    FOR_EACH_NOTE(note)
+    note-&gt;addStateToSelectedNotes(state);
+    updateEditorAppearance();
 }
 
 void Basket::updateEditorAppearance()
 {
-	if (isDuringEdit() &amp;&amp; m_editor-&gt;widget()) {
-		m_editor-&gt;widget()-&gt;setFont(m_editor-&gt;note()-&gt;font());
-
-		QPalette palette;
-                palette.setColor(m_editor-&gt;widget()-&gt;backgroundRole(), m_editor-&gt;note()-&gt;backgroundColor());
-                palette.setColor(m_editor-&gt;widget()-&gt;foregroundRole(), m_editor-&gt;note()-&gt;textColor());
-                m_editor-&gt;widget()-&gt;setPalette(palette);
-
-		// Uggly Hack arround Qt bugs: placeCursor() don't call any signal:
-		HtmlEditor *htmlEditor = dynamic_cast&lt;HtmlEditor*&gt;(m_editor);
-		if (htmlEditor) {
-			if (m_editor-&gt;textEdit()-&gt;textCursor().atStart()) {
-				m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Right);
-				m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Left);
-			} else {
-				m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Left);
-				m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Right);
-			}
-			htmlEditor-&gt;cursorPositionChanged(); // Does not work anyway :-( (when clicking on a red bold text, the toolbar still show black normal text)
-		}
-	}
+    if (isDuringEdit() &amp;&amp; m_editor-&gt;widget()) {
+        m_editor-&gt;widget()-&gt;setFont(m_editor-&gt;note()-&gt;font());
+
+        QPalette palette;
+        palette.setColor(m_editor-&gt;widget()-&gt;backgroundRole(), m_editor-&gt;note()-&gt;backgroundColor());
+        palette.setColor(m_editor-&gt;widget()-&gt;foregroundRole(), m_editor-&gt;note()-&gt;textColor());
+        m_editor-&gt;widget()-&gt;setPalette(palette);
+
+        // Uggly Hack arround Qt bugs: placeCursor() don't call any signal:
+        HtmlEditor *htmlEditor = dynamic_cast&lt;HtmlEditor*&gt;(m_editor);
+        if (htmlEditor) {
+            if (m_editor-&gt;textEdit()-&gt;textCursor().atStart()) {
+                m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Right);
+                m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Left);
+            } else {
+                m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Left);
+                m_editor-&gt;textEdit()-&gt;moveCursor(QTextCursor::Right);
+            }
+            htmlEditor-&gt;cursorPositionChanged(); // Does not work anyway :-( (when clicking on a red bold text, the toolbar still show black normal text)
+        }
+    }
 }
 
 void Basket::editorPropertiesChanged()
 {
-	if (isDuringEdit() &amp;&amp; m_editor-&gt;note()-&gt;content()-&gt;type() == NoteType::Html) {
-		m_editor-&gt;textEdit()-&gt;setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll : QTextEdit::AutoNone);
-	}
+    if (isDuringEdit() &amp;&amp; m_editor-&gt;note()-&gt;content()-&gt;type() == NoteType::Html) {
+        m_editor-&gt;textEdit()-&gt;setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll : QTextEdit::AutoNone);
+    }
 }
 
 void Basket::changeStateOfSelectedNotes(State *state)
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;changeStateOfSelectedNotes(state);
-	updateEditorAppearance();
+    FOR_EACH_NOTE(note)
+    note-&gt;changeStateOfSelectedNotes(state);
+    updateEditorAppearance();
 }
 
 void Basket::removeAllTagsFromSelectedNotes()
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;removeAllTagsFromSelectedNotes();
-	updateEditorAppearance();
+    FOR_EACH_NOTE(note)
+    note-&gt;removeAllTagsFromSelectedNotes();
+    updateEditorAppearance();
 }
 
 bool Basket::selectedNotesHaveTags()
 {
-	FOR_EACH_NOTE (note)
-		if (note-&gt;selectedNotesHaveTags())
-			return true;
-	return false;
+    FOR_EACH_NOTE(note)
+    if (note-&gt;selectedNotesHaveTags())
+        return true;
+    return false;
 }
 
 QColor Basket::backgroundColor()
 {
-	if (m_backgroundColorSetting.isValid())
-		return m_backgroundColorSetting;
-	else
-		return palette().color(QPalette::Base);
+    if (m_backgroundColorSetting.isValid())
+        return m_backgroundColorSetting;
+    else
+        return palette().color(QPalette::Base);
 }
 
 QColor Basket::textColor()
 {
-	if (m_textColorSetting.isValid())
-		return m_textColorSetting;
-	else
-		return palette().color(QPalette::Text);
+    if (m_textColorSetting.isValid())
+        return m_textColorSetting;
+    else
+        return palette().color(QPalette::Text);
 }
 
 void Basket::unbufferizeAll()
 {
-	FOR_EACH_NOTE (note)
-		note-&gt;unbufferizeAll();
+    FOR_EACH_NOTE(note)
+    note-&gt;unbufferizeAll();
 }
 
 Note* Basket::editedNote()
 {
-	if (m_editor)
-		return m_editor-&gt;note();
-	else
-		return 0;
+    if (m_editor)
+        return m_editor-&gt;note();
+    else
+        return 0;
 }
 
 bool Basket::hasTextInEditor()
 {
-	if (!isDuringEdit() || !redirectEditActions())
-		return false;
+    if (!isDuringEdit() || !redirectEditActions())
+        return false;
 
-	if (m_editor-&gt;textEdit())
-		return ! m_editor-&gt;textEdit()-&gt;document()-&gt;isEmpty();
-	else if (m_editor-&gt;lineEdit())
-		return ! m_editor-&gt;lineEdit()-&gt;displayText().isEmpty();
-	else
-		return false;
+    if (m_editor-&gt;textEdit())
+        return ! m_editor-&gt;textEdit()-&gt;document()-&gt;isEmpty();
+    else if (m_editor-&gt;lineEdit())
+        return ! m_editor-&gt;lineEdit()-&gt;displayText().isEmpty();
+    else
+        return false;
 }
 
 bool Basket::hasSelectedTextInEditor()
 {
-	if (!isDuringEdit() || !redirectEditActions())
-		return false;
+    if (!isDuringEdit() || !redirectEditActions())
+        return false;
 
-	if (m_editor-&gt;textEdit()) {
-		// The following line does NOT work if one letter is selected and the user press Shift+Left or Shift+Right to unselect than letter:
-		// Qt misteriously tell us there is an invisible selection!!
-		//return m_editor-&gt;textEdit()-&gt;hasSelectedText();
-		return !m_editor-&gt;textEdit()-&gt;textCursor().selectedText().isEmpty();
-	} else if (m_editor-&gt;lineEdit())
-		return m_editor-&gt;lineEdit()-&gt;hasSelectedText();
-	else
-		return false;
+    if (m_editor-&gt;textEdit()) {
+        // The following line does NOT work if one letter is selected and the user press Shift+Left or Shift+Right to unselect than letter:
+        // Qt misteriously tell us there is an invisible selection!!
+        //return m_editor-&gt;textEdit()-&gt;hasSelectedText();
+        return !m_editor-&gt;textEdit()-&gt;textCursor().selectedText().isEmpty();
+    } else if (m_editor-&gt;lineEdit())
+        return m_editor-&gt;lineEdit()-&gt;hasSelectedText();
+    else
+        return false;
 }
 
 bool Basket::selectedAllTextInEditor()
 {
-	if (!isDuringEdit() || !redirectEditActions())
-		return false;
+    if (!isDuringEdit() || !redirectEditActions())
+        return false;
 
-	if (m_editor-&gt;textEdit()) {
-		return m_editor-&gt;textEdit()-&gt;document()-&gt;isEmpty() || m_editor-&gt;textEdit()-&gt;toPlainText() == m_editor-&gt;textEdit()-&gt;textCursor().selectedText();
-	} else if (m_editor-&gt;lineEdit())
-		return m_editor-&gt;lineEdit()-&gt;displayText().isEmpty() || m_editor-&gt;lineEdit()-&gt;displayText() == m_editor-&gt;lineEdit()-&gt;selectedText();
-	else
-		return false;
+    if (m_editor-&gt;textEdit()) {
+        return m_editor-&gt;textEdit()-&gt;document()-&gt;isEmpty() || m_editor-&gt;textEdit()-&gt;toPlainText() == m_editor-&gt;textEdit()-&gt;textCursor().selectedText();
+    } else if (m_editor-&gt;lineEdit())
+        return m_editor-&gt;lineEdit()-&gt;displayText().isEmpty() || m_editor-&gt;lineEdit()-&gt;displayText() == m_editor-&gt;lineEdit()-&gt;selectedText();
+    else
+        return false;
 }
 
 void Basket::selectionChangedInEditor()
 {
-	Global::bnpView-&gt;notesStateChanged();
+    Global::bnpView-&gt;notesStateChanged();
 }
 
 void Basket::contentChangedInEditor()
 {
-	// Do not wait 3 seconds, because we need the note to expand as needed (if a line is too wider... the note should grow wider):
-	if (m_editor-&gt;textEdit())
-		m_editor-&gt;autoSave(/*toFileToo=*/false);
-//	else {
-		if (m_inactivityAutoSaveTimer.isActive())
-			m_inactivityAutoSaveTimer.stop();
-		m_inactivityAutoSaveTimer.setSingleShot(true);
-		m_inactivityAutoSaveTimer.start(3 * 1000);
-		Global::bnpView-&gt;setUnsavedStatus(true);
-//	}
+    // Do not wait 3 seconds, because we need the note to expand as needed (if a line is too wider... the note should grow wider):
+    if (m_editor-&gt;textEdit())
+        m_editor-&gt;autoSave(/*toFileToo=*/false);
+//  else {
+    if (m_inactivityAutoSaveTimer.isActive())
+        m_inactivityAutoSaveTimer.stop();
+    m_inactivityAutoSaveTimer.setSingleShot(true);
+    m_inactivityAutoSaveTimer.start(3 * 1000);
+    Global::bnpView-&gt;setUnsavedStatus(true);
+//  }
 }
 
 void Basket::inactivityAutoSaveTimeout()
 {
-	if (m_editor)
-		m_editor-&gt;autoSave(/*toFileToo=*/true);
+    if (m_editor)
+        m_editor-&gt;autoSave(/*toFileToo=*/true);
 }
 
 void Basket::placeEditorAndEnsureVisible()
 {
-	placeEditor(/*andEnsureVisible=*/true);
+    placeEditor(/*andEnsureVisible=*/true);
 }
 
 // TODO: [kw] Oh boy, this will probably require some tweaking.
 void Basket::placeEditor(bool /*andEnsureVisible*/ /*= false*/)
 {
-	if (!isDuringEdit())
-		return;
-
-	QFrame    *editorQFrame = dynamic_cast&lt;QFrame*&gt;(m_editor-&gt;widget());
-	KTextEdit *textEdit     = m_editor-&gt;textEdit();
-//	QLineEdit *lineEdit     = m_editor-&gt;lineEdit();
-	Note      *note         = m_editor-&gt;note();
-
-	int frameWidth = (editorQFrame ? editorQFrame-&gt;frameWidth() : 0);
-	int x          = note-&gt;x() + note-&gt;contentX() + note-&gt;content()-&gt;xEditorIndent() - frameWidth;
-	int y;
-	int maxHeight  = qMax(visibleHeight(), contentsHeight());
-	int height, width;
-
-	if (textEdit) {
-		x -= 4;
-		// Need to do it 2 times, because it's wrong overwise
-		// (sometimes, width depends on height, and sometimes, height depends on with):
-		for (int i = 0; i &lt; 2; i++) {
-			// FIXME: CRASH: Select all text, press Del or [&lt;--] and editor-&gt;removeSelectedText() is called:
-			//        editor-&gt;sync() CRASH!!
-	//		editor-&gt;sync();
-			y = note-&gt;y() + Note::NOTE_MARGIN - frameWidth;
-			height = note-&gt;height() - 2*frameWidth - 2*Note::NOTE_MARGIN;
-//			height = /*qMax(*/height/*, note-&gt;height())*/;
-//			height = qMin(height, visibleHeight());
-			width  = note-&gt;x() + note-&gt;width() - x + 1;//      /*note-&gt;x() + note-&gt;width()*/note-&gt;rightLimit() - x + 2*frameWidth + 1;
+    if (!isDuringEdit())
+        return;
+
+    QFrame    *editorQFrame = dynamic_cast&lt;QFrame*&gt;(m_editor-&gt;widget());
+    KTextEdit *textEdit     = m_editor-&gt;textEdit();
+//  QLineEdit *lineEdit     = m_editor-&gt;lineEdit();
+    Note      *note         = m_editor-&gt;note();
+
+    int frameWidth = (editorQFrame ? editorQFrame-&gt;frameWidth() : 0);
+    int x          = note-&gt;x() + note-&gt;contentX() + note-&gt;content()-&gt;xEditorIndent() - frameWidth;
+    int y;
+    int maxHeight  = qMax(visibleHeight(), contentsHeight());
+    int height, width;
+
+    if (textEdit) {
+        x -= 4;
+        // Need to do it 2 times, because it's wrong overwise
+        // (sometimes, width depends on height, and sometimes, height depends on with):
+        for (int i = 0; i &lt; 2; i++) {
+            // FIXME: CRASH: Select all text, press Del or [&lt;--] and editor-&gt;removeSelectedText() is called:
+            //        editor-&gt;sync() CRASH!!
+            //      editor-&gt;sync();
+            y = note-&gt;y() + Note::NOTE_MARGIN - frameWidth;
+            height = note-&gt;height() - 2 * frameWidth - 2 * Note::NOTE_MARGIN;
+//          height = /*qMax(*/height/*, note-&gt;height())*/;
+//          height = qMin(height, visibleHeight());
+            width  = note-&gt;x() + note-&gt;width() - x + 1;//      /*note-&gt;x() + note-&gt;width()*/note-&gt;rightLimit() - x + 2*frameWidth + 1;
 //width=qMax(width,textEdit-&gt;contentsWidth()+2*frameWidth);
-			if (y + height &gt; maxHeight)
-				y = maxHeight - height;
-			textEdit-&gt;setFixedSize(width, height);
-		}
-	} else {
-		height = note-&gt;height() - 2*Note::NOTE_MARGIN + 2*frameWidth;
-		width  = note-&gt;x() + note-&gt;width() - x;//note-&gt;rightLimit() - x + 2*frameWidth;
-		m_editor-&gt;widget()-&gt;setFixedSize(width, height);
-		x -= 1;
-		y = note-&gt;y() + Note::NOTE_MARGIN - frameWidth;
-	}
-	if ((m_editorWidth &gt; 0 &amp;&amp; m_editorWidth != width) || (m_editorHeight &gt; 0 &amp;&amp; m_editorHeight != height)) {
-		m_editorWidth  = width; // Avoid infinite recursion!!!
-		m_editorHeight = height;
-		m_editor-&gt;autoSave(/*toFileToo=*/true);
-	}
-	m_editorWidth  = width;
-	m_editorHeight = height;
-	addChild(m_editor-&gt;widget(), x, y);
-	m_editorX = x;
-	m_editorY = y;
-
-	m_leftEditorBorder-&gt;setFixedSize( (m_editor-&gt;textEdit() ? 3 : 0), height);
-//	m_leftEditorBorder-&gt;raise();
-	addChild(m_leftEditorBorder,     x, y );
-	m_leftEditorBorder-&gt;setPosition( x, y );
-
-	m_rightEditorBorder-&gt;setFixedSize(3, height);
-//	m_rightEditorBorder-&gt;raise();
-//	addChild(m_rightEditorBorder,     note-&gt;rightLimit() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
-//	m_rightEditorBorder-&gt;setPosition( note-&gt;rightLimit() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
-	addChild(m_rightEditorBorder,     note-&gt;x() + note-&gt;width() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
-	m_rightEditorBorder-&gt;setPosition( note-&gt;x() + note-&gt;width() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
-
-//	if (andEnsureVisible)
-//		ensureNoteVisible(note);
+            if (y + height &gt; maxHeight)
+                y = maxHeight - height;
+            textEdit-&gt;setFixedSize(width, height);
+        }
+    } else {
+        height = note-&gt;height() - 2 * Note::NOTE_MARGIN + 2 * frameWidth;
+        width  = note-&gt;x() + note-&gt;width() - x;//note-&gt;rightLimit() - x + 2*frameWidth;
+        m_editor-&gt;widget()-&gt;setFixedSize(width, height);
+        x -= 1;
+        y = note-&gt;y() + Note::NOTE_MARGIN - frameWidth;
+    }
+    if ((m_editorWidth &gt; 0 &amp;&amp; m_editorWidth != width) || (m_editorHeight &gt; 0 &amp;&amp; m_editorHeight != height)) {
+        m_editorWidth  = width; // Avoid infinite recursion!!!
+        m_editorHeight = height;
+        m_editor-&gt;autoSave(/*toFileToo=*/true);
+    }
+    m_editorWidth  = width;
+    m_editorHeight = height;
+    addChild(m_editor-&gt;widget(), x, y);
+    m_editorX = x;
+    m_editorY = y;
+
+    m_leftEditorBorder-&gt;setFixedSize((m_editor-&gt;textEdit() ? 3 : 0), height);
+//  m_leftEditorBorder-&gt;raise();
+    addChild(m_leftEditorBorder,     x, y);
+    m_leftEditorBorder-&gt;setPosition(x, y);
+
+    m_rightEditorBorder-&gt;setFixedSize(3, height);
+//  m_rightEditorBorder-&gt;raise();
+//  addChild(m_rightEditorBorder,     note-&gt;rightLimit() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
+//  m_rightEditorBorder-&gt;setPosition( note-&gt;rightLimit() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN );
+    addChild(m_rightEditorBorder,     note-&gt;x() + note-&gt;width() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN);
+    m_rightEditorBorder-&gt;setPosition(note-&gt;x() + note-&gt;width() - Note::NOTE_MARGIN, note-&gt;y() + Note::NOTE_MARGIN);
+
+//  if (andEnsureVisible)
+//      ensureNoteVisible(note);
 }
 
 void Basket::editorCursorPositionChanged()
 {
-	if (!isDuringEdit())
-		return;
+    if (!isDuringEdit())
+        return;
 
-	FocusedTextEdit *textEdit = (FocusedTextEdit*) m_editor-&gt;textEdit();
+    FocusedTextEdit *textEdit = (FocusedTextEdit*) m_editor-&gt;textEdit();
 
-	QPoint cursorPoint = textEdit-&gt;viewport()-&gt;mapTo(
-		viewport(), textEdit-&gt;cursorRect().center()
-		);
-	ensureVisible(cursorPoint.x(), cursorPoint.y());
+    QPoint cursorPoint = textEdit-&gt;viewport()-&gt;mapTo(
+                             viewport(), textEdit-&gt;cursorRect().center()
+                         );
+    ensureVisible(cursorPoint.x(), cursorPoint.y());
 }
 
 void Basket::closeEditorDelayed()
 {
-	setFocus();
-	QTimer::singleShot( 0, this, SLOT(closeEditor()) );
+    setFocus();
+    QTimer::singleShot(0, this, SLOT(closeEditor()));
 }
 
 bool Basket::closeEditor()
 {
-	if (!isDuringEdit())
-		return true;
-
-	if (m_doNotCloseEditor)
-		return true;
-
-	if (m_redirectEditActions) {
-		disconnect( m_editor-&gt;widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()) );
-		if (m_editor-&gt;textEdit()) {
-			disconnect( m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(selectionChangedInEditor()) );
-			disconnect( m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(contentChangedInEditor())   );
-		} else if (m_editor-&gt;lineEdit()) {
-			disconnect( m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(selectionChangedInEditor()) );
-			disconnect( m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(contentChangedInEditor())   );
-		}
-	}
-	m_editor-&gt;widget()-&gt;disconnect();
-	m_editor-&gt;widget()-&gt;hide();
-	m_editor-&gt;validate();
-
-	delete m_leftEditorBorder;
-	delete m_rightEditorBorder;
-	m_leftEditorBorder  = 0;
-	m_rightEditorBorder = 0;
-
-	Note *note = m_editor-&gt;note();
-	note-&gt;setWidth(0); // For relayoutNotes() to succeed to take care of the change
-
-	// Delete the editor BEFORE unselecting the note because unselecting the note would trigger closeEditor() recursivly:
-	bool isEmpty = m_editor-&gt;isEmpty();
-	delete m_editor;
-	m_editor = 0;
-	m_redirectEditActions = false;
-	m_editorWidth  = -1;
-	m_editorHeight = -1;
-	m_inactivityAutoSaveTimer.stop();
-
-	// Delete the note if it is now empty:
-	if (isEmpty) {
-		focusANonSelectedNoteAboveOrThenBelow();
-		note-&gt;setSelected(true);
-		note-&gt;deleteSelectedNotes();
-		save();
-		note = 0;
-	}
-
-	unlockHovering();
-	filterAgain(/*andEnsureVisible=*/false);
+    if (!isDuringEdit())
+        return true;
+
+    if (m_doNotCloseEditor)
+        return true;
+
+    if (m_redirectEditActions) {
+        disconnect(m_editor-&gt;widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()));
+        if (m_editor-&gt;textEdit()) {
+            disconnect(m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(selectionChangedInEditor()));
+            disconnect(m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(contentChangedInEditor()));
+        } else if (m_editor-&gt;lineEdit()) {
+            disconnect(m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(selectionChangedInEditor()));
+            disconnect(m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(contentChangedInEditor()));
+        }
+    }
+    m_editor-&gt;widget()-&gt;disconnect();
+    m_editor-&gt;widget()-&gt;hide();
+    m_editor-&gt;validate();
+
+    delete m_leftEditorBorder;
+    delete m_rightEditorBorder;
+    m_leftEditorBorder  = 0;
+    m_rightEditorBorder = 0;
+
+    Note *note = m_editor-&gt;note();
+    note-&gt;setWidth(0); // For relayoutNotes() to succeed to take care of the change
+
+    // Delete the editor BEFORE unselecting the note because unselecting the note would trigger closeEditor() recursivly:
+    bool isEmpty = m_editor-&gt;isEmpty();
+    delete m_editor;
+    m_editor = 0;
+    m_redirectEditActions = false;
+    m_editorWidth  = -1;
+    m_editorHeight = -1;
+    m_inactivityAutoSaveTimer.stop();
+
+    // Delete the note if it is now empty:
+    if (isEmpty) {
+        focusANonSelectedNoteAboveOrThenBelow();
+        note-&gt;setSelected(true);
+        note-&gt;deleteSelectedNotes();
+        save();
+        note = 0;
+    }
+
+    unlockHovering();
+    filterAgain(/*andEnsureVisible=*/false);
 
 // Does not work:
-//	if (Settings::playAnimations())
-//		note-&gt;setOnTop(true); // So if it grew, do not obscure it temporarily while the notes below it are moving
+//  if (Settings::playAnimations())
+//      note-&gt;setOnTop(true); // So if it grew, do not obscure it temporarily while the notes below it are moving
 
-	if (note)
-		note-&gt;setSelected(false);//unselectAll();
-	doHoverEffects();
-//	save();
+    if (note)
+        note-&gt;setSelected(false);//unselectAll();
+    doHoverEffects();
+//  save();
 
-	Global::bnpView-&gt;m_actEditNote-&gt;setEnabled( !isLocked() &amp;&amp; countSelecteds() == 1 /*&amp;&amp; !isDuringEdit()*/ );
+    Global::bnpView-&gt;m_actEditNote-&gt;setEnabled(!isLocked() &amp;&amp; countSelecteds() == 1 /*&amp;&amp; !isDuringEdit()*/);
 
-	emit resetStatusBarText(); // Remove the &quot;Editing. ... to validate.&quot; text.
+    emit resetStatusBarText(); // Remove the &quot;Editing. ... to validate.&quot; text.
 
-	//if (kapp-&gt;activeWindow() == Global::mainContainer)
+    //if (kapp-&gt;activeWindow() == Global::mainContainer)
 
-	// Set focus to the basket, unless the user pressed a letter key in the filter bar and the currently edited note came hidden, then editing closed:
-	if (!decoration()-&gt;filterBar()-&gt;lineEdit()-&gt;hasFocus())
-		setFocus();
+    // Set focus to the basket, unless the user pressed a letter key in the filter bar and the currently edited note came hidden, then editing closed:
+    if (!decoration()-&gt;filterBar()-&gt;lineEdit()-&gt;hasFocus())
+        setFocus();
 
-	// Return true if the note is still there:
-	return (note != 0);
+    // Return true if the note is still there:
+    return (note != 0);
 }
 
 void Basket::closeBasket()
 {
-	closeEditor();
-	unbufferizeAll(); // Keep the memory footprint low
-	if (isEncrypted()) {
-		if (Settings::enableReLockTimeout()) {
-			int seconds = Settings::reLockTimeoutMinutes() * 60;
-			m_inactivityAutoLockTimer.setSingleShot(true);
-			m_inactivityAutoLockTimer.start(seconds * 1000);
-		}
-	}
+    closeEditor();
+    unbufferizeAll(); // Keep the memory footprint low
+    if (isEncrypted()) {
+        if (Settings::enableReLockTimeout()) {
+            int seconds = Settings::reLockTimeoutMinutes() * 60;
+            m_inactivityAutoLockTimer.setSingleShot(true);
+            m_inactivityAutoLockTimer.start(seconds * 1000);
+        }
+    }
 }
 
 void Basket::openBasket()
 {
-        if (m_inactivityAutoLockTimer.isActive())
-                m_inactivityAutoLockTimer.stop();
+    if (m_inactivityAutoLockTimer.isActive())
+        m_inactivityAutoLockTimer.stop();
 }
 
 Note* Basket::theSelectedNote()
 {
-	if (countSelecteds() != 1) {
-		kDebug() &lt;&lt; &quot;NO SELECTED NOTE !!!!&quot;;
-		return 0;
-	}
+    if (countSelecteds() != 1) {
+        kDebug() &lt;&lt; &quot;NO SELECTED NOTE !!!!&quot;;
+        return 0;
+    }
 
-	Note *selectedOne;
-	FOR_EACH_NOTE (note) {
-		selectedOne = note-&gt;theSelectedNote();
-		if (selectedOne)
-			return selectedOne;
-	}
+    Note *selectedOne;
+    FOR_EACH_NOTE(note) {
+        selectedOne = note-&gt;theSelectedNote();
+        if (selectedOne)
+            return selectedOne;
+    }
 
-	kDebug() &lt;&lt; &quot;One selected note, BUT NOT FOUND !!!!&quot;;
+    kDebug() &lt;&lt; &quot;One selected note, BUT NOT FOUND !!!!&quot;;
 
-	return 0;
+    return 0;
 }
 
 void debugSel(NoteSelection* sel, int n = 0)
 {
-	for (NoteSelection *node = sel; node; node = node-&gt;next) {
-		for (int i = 0; i &lt; n; i++)
-			kDebug() &lt;&lt; &quot;-&quot;;
-		kDebug() &lt;&lt; (node-&gt;firstChild ? &quot;Group&quot; : node-&gt;note-&gt;content()-&gt;toText(&quot;&quot;));
-		if (node-&gt;firstChild)
-			debugSel(node-&gt;firstChild, n+1);
-	}
+    for (NoteSelection *node = sel; node; node = node-&gt;next) {
+        for (int i = 0; i &lt; n; i++)
+            kDebug() &lt;&lt; &quot;-&quot;;
+        kDebug() &lt;&lt; (node-&gt;firstChild ? &quot;Group&quot; : node-&gt;note-&gt;content()-&gt;toText(&quot;&quot;));
+        if (node-&gt;firstChild)
+            debugSel(node-&gt;firstChild, n + 1);
+    }
 }
 
 NoteSelection* Basket::selectedNotes()
 {
-	NoteSelection selection;
-
-	FOR_EACH_NOTE (note)
-		selection.append(note-&gt;selectedNotes());
-
-	if (!selection.firstChild)
-		return 0;
-
-	for (NoteSelection *node = selection.firstChild; node; node = node-&gt;next)
-		node-&gt;parent = 0;
-
-	// If the top-most groups are columns, export only childs of those groups
-	// (because user is not consciencious that columns are groups, and don't care: it's not what she want):
-	if (selection.firstChild-&gt;note-&gt;isColumn()) {
-		NoteSelection tmpSelection;
-		NoteSelection *nextNode;
-		NoteSelection *nextSubNode;
-		for (NoteSelection *node = selection.firstChild; node; node = nextNode) {
-			nextNode = node-&gt;next;
-			if (node-&gt;note-&gt;isColumn()) {
-				for (NoteSelection *subNode = node-&gt;firstChild; subNode; subNode = nextSubNode) {
-					nextSubNode = subNode-&gt;next;
-					tmpSelection.append(subNode);
-					subNode-&gt;parent = 0;
-					subNode-&gt;next = 0;
-				}
-			} else {
-				tmpSelection.append(node);
-				node-&gt;parent = 0;
-				node-&gt;next = 0;
-			}
-		}
-//		debugSel(tmpSelection.firstChild);
-		return tmpSelection.firstChild;
-	} else {
-//		debugSel(selection.firstChild);
-		return selection.firstChild;
-	}
+    NoteSelection selection;
+
+    FOR_EACH_NOTE(note)
+    selection.append(note-&gt;selectedNotes());
+
+    if (!selection.firstChild)
+        return 0;
+
+    for (NoteSelection *node = selection.firstChild; node; node = node-&gt;next)
+        node-&gt;parent = 0;
+
+    // If the top-most groups are columns, export only childs of those groups
+    // (because user is not consciencious that columns are groups, and don't care: it's not what she want):
+    if (selection.firstChild-&gt;note-&gt;isColumn()) {
+        NoteSelection tmpSelection;
+        NoteSelection *nextNode;
+        NoteSelection *nextSubNode;
+        for (NoteSelection *node = selection.firstChild; node; node = nextNode) {
+            nextNode = node-&gt;next;
+            if (node-&gt;note-&gt;isColumn()) {
+                for (NoteSelection *subNode = node-&gt;firstChild; subNode; subNode = nextSubNode) {
+                    nextSubNode = subNode-&gt;next;
+                    tmpSelection.append(subNode);
+                    subNode-&gt;parent = 0;
+                    subNode-&gt;next = 0;
+                }
+            } else {
+                tmpSelection.append(node);
+                node-&gt;parent = 0;
+                node-&gt;next = 0;
+            }
+        }
+//      debugSel(tmpSelection.firstChild);
+        return tmpSelection.firstChild;
+    } else {
+//      debugSel(selection.firstChild);
+        return selection.firstChild;
+    }
 }
 
 void Basket::showEditedNoteWhileFiltering()
 {
-	if (m_editor) {
-		Note *note = m_editor-&gt;note();
-		filterAgain();
-		note-&gt;setSelected(true);
-		relayoutNotes(false);
-		note-&gt;setX(note-&gt;finalX());
-		note-&gt;setY(note-&gt;finalY());
-		filterAgainDelayed();
-	}
+    if (m_editor) {
+        Note *note = m_editor-&gt;note();
+        filterAgain();
+        note-&gt;setSelected(true);
+        relayoutNotes(false);
+        note-&gt;setX(note-&gt;finalX());
+        note-&gt;setY(note-&gt;finalY());
+        filterAgainDelayed();
+    }
 }
 
 void Basket::noteEdit(Note *note, bool justAdded, const QPoint &amp;clickedPoint) // TODO: Remove the first parameter!!!
 {
-	if (!note)
-		note = theSelectedNote(); // TODO: Or pick the focused note!
-	if (!note)
-		return;
-
-	if (isDuringEdit()) {
-		closeEditor(); // Validate the noteeditors in KLineEdit that does not intercept Enter key press (and edit is triggered with Enter too... Can conflict)
-		return;
-	}
-
-	if (note != m_focusedNote) {
-		setFocusedNote(note);
-		m_startOfShiftSelectionNote = note;
-	}
-
-	if (justAdded &amp;&amp; isFiltering()) {
-		QTimer::singleShot( 0, this, SLOT(showEditedNoteWhileFiltering()) );
-	}
-
-	doHoverEffects(note, Note::Content); // Be sure (in the case Edit was triggered by menu or Enter key...): better feedback!
-	//m_lockedHovering = true;
-
-	//m_editorWidget = note-&gt;content()-&gt;launchEdit(this);
-	NoteEditor *editor = NoteEditor::editNoteContent(note-&gt;content(), this);
-
-	if (editor-&gt;widget()) {
-		m_editor = editor;
-		m_leftEditorBorder  = new TransparentWidget(this);
-		m_rightEditorBorder = new TransparentWidget(this);
-		//m_editor-&gt;widget()-&gt;reparent(viewport(), QPoint(0,0), true);
-		//m_leftEditorBorder-&gt;reparent(viewport(), QPoint(0,0), true);
-		//m_rightEditorBorder-&gt;reparent(viewport(), QPoint(0,0), true);
-		m_editor-&gt;widget()-&gt;setParent(viewport());
-		m_leftEditorBorder-&gt;setParent(viewport());
-		m_rightEditorBorder-&gt;setParent(viewport());
-		addChild(m_editor-&gt;widget(), 0, 0);
-		placeEditorAndEnsureVisible(); //       placeEditor(); // FIXME: After?
-		m_redirectEditActions = m_editor-&gt;lineEdit() || m_editor-&gt;textEdit();
-		if (m_redirectEditActions) {
-			connect( m_editor-&gt;widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()) );
-			// In case there is NO text, &quot;Select All&quot; is disabled. But if the user press a key the there is now a text:
-			// selection has not changed but &quot;Select All&quot; should be re-enabled:
-			if (m_editor-&gt;textEdit()) {
-				connect( m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(selectionChangedInEditor()) );
-				connect( m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(contentChangedInEditor())   );
-			} else if (m_editor-&gt;lineEdit()) {
-				connect( m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(selectionChangedInEditor()) );
-				connect( m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(contentChangedInEditor())   );
-			}
-		}
-		m_editor-&gt;widget()-&gt;show();
-		//m_editor-&gt;widget()-&gt;raise();
-		m_editor-&gt;widget()-&gt;setFocus();
+    if (!note)
+        note = theSelectedNote(); // TODO: Or pick the focused note!
+    if (!note)
+        return;
+
+    if (isDuringEdit()) {
+        closeEditor(); // Validate the noteeditors in KLineEdit that does not intercept Enter key press (and edit is triggered with Enter too... Can conflict)
+        return;
+    }
+
+    if (note != m_focusedNote) {
+        setFocusedNote(note);
+        m_startOfShiftSelectionNote = note;
+    }
+
+    if (justAdded &amp;&amp; isFiltering()) {
+        QTimer::singleShot(0, this, SLOT(showEditedNoteWhileFiltering()));
+    }
+
+    doHoverEffects(note, Note::Content); // Be sure (in the case Edit was triggered by menu or Enter key...): better feedback!
+    //m_lockedHovering = true;
+
+    //m_editorWidget = note-&gt;content()-&gt;launchEdit(this);
+    NoteEditor *editor = NoteEditor::editNoteContent(note-&gt;content(), this);
+
+    if (editor-&gt;widget()) {
+        m_editor = editor;
+        m_leftEditorBorder  = new TransparentWidget(this);
+        m_rightEditorBorder = new TransparentWidget(this);
+        //m_editor-&gt;widget()-&gt;reparent(viewport(), QPoint(0,0), true);
+        //m_leftEditorBorder-&gt;reparent(viewport(), QPoint(0,0), true);
+        //m_rightEditorBorder-&gt;reparent(viewport(), QPoint(0,0), true);
+        m_editor-&gt;widget()-&gt;setParent(viewport());
+        m_leftEditorBorder-&gt;setParent(viewport());
+        m_rightEditorBorder-&gt;setParent(viewport());
+        addChild(m_editor-&gt;widget(), 0, 0);
+        placeEditorAndEnsureVisible(); //       placeEditor(); // FIXME: After?
+        m_redirectEditActions = m_editor-&gt;lineEdit() || m_editor-&gt;textEdit();
+        if (m_redirectEditActions) {
+            connect(m_editor-&gt;widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()));
+            // In case there is NO text, &quot;Select All&quot; is disabled. But if the user press a key the there is now a text:
+            // selection has not changed but &quot;Select All&quot; should be re-enabled:
+            if (m_editor-&gt;textEdit()) {
+                connect(m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(selectionChangedInEditor()));
+                connect(m_editor-&gt;textEdit(), SIGNAL(textChanged()),               this, SLOT(contentChangedInEditor()));
+            } else if (m_editor-&gt;lineEdit()) {
+                connect(m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(selectionChangedInEditor()));
+                connect(m_editor-&gt;lineEdit(), SIGNAL(textChanged(const QString&amp;)), this, SLOT(contentChangedInEditor()));
+            }
+        }
+        m_editor-&gt;widget()-&gt;show();
+        //m_editor-&gt;widget()-&gt;raise();
+        m_editor-&gt;widget()-&gt;setFocus();
         connect(m_editor, SIGNAL(askValidation()),
                 this, SLOT(closeEditorDelayed()));
         connect(m_editor, SIGNAL(mouseEnteredEditorWidget()),
@@ -4145,206 +4142,206 @@ void Basket::noteEdit(Note *note, bool justAdded, const QPoint &amp;clickedPoint) //
             }
         }
 
-//		kapp-&gt;processEvents();     // Show the editor toolbar before ensuring the note is visible
-		ensureNoteVisible(note);   //  because toolbar can create a new line and then partially hide the note
-		m_editor-&gt;widget()-&gt;setFocus(); // When clicking in the basket, a QTimer::singleShot(0, ...) focus the basket! So we focus the the widget after kapp-&gt;processEvents()
-		emit resetStatusBarText(); // Display &quot;Editing. ... to validate.&quot;
-	} else {
-		// Delete the note user have canceled the addition:
-		if ((justAdded &amp;&amp; editor-&gt;canceled()) || editor-&gt;isEmpty() /*) &amp;&amp; editor-&gt;note()-&gt;states().count() &lt;= 0*/) {
-			focusANonSelectedNoteAboveOrThenBelow();
-			editor-&gt;note()-&gt;setSelected(true);
-			editor-&gt;note()-&gt;deleteSelectedNotes();
-			save();
-		}
-		editor-&gt;deleteLater();
-		unlockHovering();
-		filterAgain();
-		unselectAll();
-	}
-	Global::bnpView-&gt;m_actEditNote-&gt;setEnabled(false);
+//      kapp-&gt;processEvents();     // Show the editor toolbar before ensuring the note is visible
+        ensureNoteVisible(note);   //  because toolbar can create a new line and then partially hide the note
+        m_editor-&gt;widget()-&gt;setFocus(); // When clicking in the basket, a QTimer::singleShot(0, ...) focus the basket! So we focus the the widget after kapp-&gt;processEvents()
+        emit resetStatusBarText(); // Display &quot;Editing. ... to validate.&quot;
+    } else {
+        // Delete the note user have canceled the addition:
+        if ((justAdded &amp;&amp; editor-&gt;canceled()) || editor-&gt;isEmpty() /*) &amp;&amp; editor-&gt;note()-&gt;states().count() &lt;= 0*/) {
+            focusANonSelectedNoteAboveOrThenBelow();
+            editor-&gt;note()-&gt;setSelected(true);
+            editor-&gt;note()-&gt;deleteSelectedNotes();
+            save();
+        }
+        editor-&gt;deleteLater();
+        unlockHovering();
+        filterAgain();
+        unselectAll();
+    }
+    Global::bnpView-&gt;m_actEditNote-&gt;setEnabled(false);
 }
 
 void Basket::noteDelete()
 {
-	if (redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;textCursor().deleteChar();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;del();
-		return;
-	}
-
-	if (countSelecteds() &lt;= 0)
-		return;
-	int really = KMessageBox::Yes;
-	if (Settings::confirmNoteDeletion())
-		really = KMessageBox::questionYesNo( this,
-			i18np(&quot;&lt;qt&gt;Do you really want to delete this note?&lt;/qt&gt;&quot;,
-			     &quot;&lt;qt&gt;Do you really want to delete these &lt;b&gt;%1&lt;/b&gt; notes?&lt;/qt&gt;&quot;,
-			     countSelecteds()),
-			i18np(&quot;Delete Note&quot;, &quot;Delete Notes&quot;, countSelecteds())
+    if (redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;textCursor().deleteChar();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;del();
+        return;
+    }
+
+    if (countSelecteds() &lt;= 0)
+        return;
+    int really = KMessageBox::Yes;
+    if (Settings::confirmNoteDeletion())
+        really = KMessageBox::questionYesNo(this,
+                                            i18np(&quot;&lt;qt&gt;Do you really want to delete this note?&lt;/qt&gt;&quot;,
+                                                  &quot;&lt;qt&gt;Do you really want to delete these &lt;b&gt;%1&lt;/b&gt; notes?&lt;/qt&gt;&quot;,
+                                                  countSelecteds()),
+                                            i18np(&quot;Delete Note&quot;, &quot;Delete Notes&quot;, countSelecteds())
 #if KDE_IS_VERSION( 3, 2, 90 )   // KDE 3.3.x
-			, KStandardGuiItem::del(), KStandardGuiItem::cancel());
+                                            , KStandardGuiItem::del(), KStandardGuiItem::cancel());
 #else
-		);
+                                           );
 #endif
-	if (really == KMessageBox::No)
-		return;
+    if (really == KMessageBox::No)
+        return;
 
-	noteDeleteWithoutConfirmation();
+    noteDeleteWithoutConfirmation();
 }
 
 void Basket::focusANonSelectedNoteBelow(bool inSameColumn)
 {
-	// First focus another unselected one below it...:
-	if (m_focusedNote &amp;&amp; m_focusedNote-&gt;isSelected()) {
-		Note *next = m_focusedNote-&gt;nextShownInStack();
-		while (next &amp;&amp; next-&gt;isSelected())
-			next = next-&gt;nextShownInStack();
-		if (next) {
-			if (inSameColumn &amp;&amp; isColumnsLayout() &amp;&amp; m_focusedNote-&gt;parentPrimaryNote() == next-&gt;parentPrimaryNote()) {
-				setFocusedNote(next);
-				m_startOfShiftSelectionNote = next;
-			}
-		}
-	}
+    // First focus another unselected one below it...:
+    if (m_focusedNote &amp;&amp; m_focusedNote-&gt;isSelected()) {
+        Note *next = m_focusedNote-&gt;nextShownInStack();
+        while (next &amp;&amp; next-&gt;isSelected())
+            next = next-&gt;nextShownInStack();
+        if (next) {
+            if (inSameColumn &amp;&amp; isColumnsLayout() &amp;&amp; m_focusedNote-&gt;parentPrimaryNote() == next-&gt;parentPrimaryNote()) {
+                setFocusedNote(next);
+                m_startOfShiftSelectionNote = next;
+            }
+        }
+    }
 }
 
 void Basket::focusANonSelectedNoteAbove(bool inSameColumn)
 {
-	// ... Or above it:
-	if (m_focusedNote &amp;&amp; m_focusedNote-&gt;isSelected()) {
-		Note *prev = m_focusedNote-&gt;prevShownInStack();
-		while (prev &amp;&amp; prev-&gt;isSelected())
-			prev = prev-&gt;prevShownInStack();
-		if (prev) {
-			if (inSameColumn &amp;&amp; isColumnsLayout() &amp;&amp; m_focusedNote-&gt;parentPrimaryNote() == prev-&gt;parentPrimaryNote()) {
-				setFocusedNote(prev);
-				m_startOfShiftSelectionNote = prev;
-			}
-		}
-	}
+    // ... Or above it:
+    if (m_focusedNote &amp;&amp; m_focusedNote-&gt;isSelected()) {
+        Note *prev = m_focusedNote-&gt;prevShownInStack();
+        while (prev &amp;&amp; prev-&gt;isSelected())
+            prev = prev-&gt;prevShownInStack();
+        if (prev) {
+            if (inSameColumn &amp;&amp; isColumnsLayout() &amp;&amp; m_focusedNote-&gt;parentPrimaryNote() == prev-&gt;parentPrimaryNote()) {
+                setFocusedNote(prev);
+                m_startOfShiftSelectionNote = prev;
+            }
+        }
+    }
 }
 
 void Basket::focusANonSelectedNoteBelowOrThenAbove()
 {
-	focusANonSelectedNoteBelow(/*inSameColumn=*/true);
-	focusANonSelectedNoteAbove(/*inSameColumn=*/true);
-	focusANonSelectedNoteBelow(/*inSameColumn=*/false);
-	focusANonSelectedNoteAbove(/*inSameColumn=*/false);
+    focusANonSelectedNoteBelow(/*inSameColumn=*/true);
+    focusANonSelectedNoteAbove(/*inSameColumn=*/true);
+    focusANonSelectedNoteBelow(/*inSameColumn=*/false);
+    focusANonSelectedNoteAbove(/*inSameColumn=*/false);
 }
 
 void Basket::focusANonSelectedNoteAboveOrThenBelow()
 {
-	focusANonSelectedNoteAbove(/*inSameColumn=*/true);
-	focusANonSelectedNoteBelow(/*inSameColumn=*/true);
-	focusANonSelectedNoteAbove(/*inSameColumn=*/false);
-	focusANonSelectedNoteBelow(/*inSameColumn=*/false);
+    focusANonSelectedNoteAbove(/*inSameColumn=*/true);
+    focusANonSelectedNoteBelow(/*inSameColumn=*/true);
+    focusANonSelectedNoteAbove(/*inSameColumn=*/false);
+    focusANonSelectedNoteBelow(/*inSameColumn=*/false);
 }
 
 void Basket::noteDeleteWithoutConfirmation(bool deleteFilesToo)
 {
-	// If the currently focused note is selected, it will be deleted.
-	focusANonSelectedNoteBelowOrThenAbove();
+    // If the currently focused note is selected, it will be deleted.
+    focusANonSelectedNoteBelowOrThenAbove();
 
-	// Do the deletion:
-	Note *note = firstNote();
-	Note *next;
-	while (note) {
-		next = note-&gt;next(); // If we delete 'note' on the next line, note-&gt;next() will be 0!
-		note-&gt;deleteSelectedNotes(deleteFilesToo);
-		note = next;
-	}
+    // Do the deletion:
+    Note *note = firstNote();
+    Note *next;
+    while (note) {
+        next = note-&gt;next(); // If we delete 'note' on the next line, note-&gt;next() will be 0!
+        note-&gt;deleteSelectedNotes(deleteFilesToo);
+        note = next;
+    }
 
-	relayoutNotes(true); // FIXME: filterAgain()?
-	save();
+    relayoutNotes(true); // FIXME: filterAgain()?
+    save();
 }
 
 void Basket::doCopy(CopyMode copyMode)
 {
-	QClipboard *cb = KApplication::clipboard();
-	QClipboard::Mode mode = (copyMode == CopyToSelection ? QClipboard::Selection : QClipboard::Clipboard);
-
-	NoteSelection *selection = selectedNotes();
-	int countCopied = countSelecteds();
-	if (selection-&gt;firstStacked()) {
-		QDrag *d = NoteDrag::dragObject(selection, copyMode == CutToClipboard, /*source=*/0); // d will be deleted by QT
-//		/*bool shouldRemove = */d-&gt;drag();
-//		delete selection;
-		cb-&gt;setMimeData(d-&gt;mimeData(), mode); // NoteMultipleDrag will be deleted by QT
-//		if (copyMode == CutToClipboard &amp;&amp; !note-&gt;useFile()) // If useFile(), NoteDrag::dragObject() will delete it TODO
-//			note-&gt;slotDelete();
-
-		if (copyMode == CutToClipboard)
-			noteDeleteWithoutConfirmation(/*deleteFilesToo=*/false);
-
-		switch (copyMode) {
-			default:
-			case CopyToClipboard: emit postMessage(i18np(&quot;Copied note to clipboard.&quot;, &quot;Copied notes to clipboard.&quot;, countCopied)); break;
-			case CutToClipboard:  emit postMessage(i18np(&quot;Cut note to clipboard.&quot;,    &quot;Cut notes to clipboard.&quot;,    countCopied)); break;
-			case CopyToSelection: emit postMessage(i18np(&quot;Copied note to selection.&quot;, &quot;Copied notes to selection.&quot;, countCopied)); break;
-		}
-	}
+    QClipboard *cb = KApplication::clipboard();
+    QClipboard::Mode mode = (copyMode == CopyToSelection ? QClipboard::Selection : QClipboard::Clipboard);
+
+    NoteSelection *selection = selectedNotes();
+    int countCopied = countSelecteds();
+    if (selection-&gt;firstStacked()) {
+        QDrag *d = NoteDrag::dragObject(selection, copyMode == CutToClipboard, /*source=*/0); // d will be deleted by QT
+//      /*bool shouldRemove = */d-&gt;drag();
+//      delete selection;
+        cb-&gt;setMimeData(d-&gt;mimeData(), mode); // NoteMultipleDrag will be deleted by QT
+//      if (copyMode == CutToClipboard &amp;&amp; !note-&gt;useFile()) // If useFile(), NoteDrag::dragObject() will delete it TODO
+//          note-&gt;slotDelete();
+
+        if (copyMode == CutToClipboard)
+            noteDeleteWithoutConfirmation(/*deleteFilesToo=*/false);
+
+        switch (copyMode) {
+        default:
+        case CopyToClipboard: emit postMessage(i18np(&quot;Copied note to clipboard.&quot;, &quot;Copied notes to clipboard.&quot;, countCopied)); break;
+        case CutToClipboard:  emit postMessage(i18np(&quot;Cut note to clipboard.&quot;,    &quot;Cut notes to clipboard.&quot;,    countCopied)); break;
+        case CopyToSelection: emit postMessage(i18np(&quot;Copied note to selection.&quot;, &quot;Copied notes to selection.&quot;, countCopied)); break;
+        }
+    }
 }
 
 void Basket::noteCopy()
 {
-	if (redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;copy();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;copy();
-	} else
-		doCopy(CopyToClipboard);
+    if (redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;copy();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;copy();
+    } else
+        doCopy(CopyToClipboard);
 }
 
 void Basket::noteCut()
 {
-	if (redirectEditActions()) {
-		if (m_editor-&gt;textEdit())
-			m_editor-&gt;textEdit()-&gt;cut();
-		else if (m_editor-&gt;lineEdit())
-			m_editor-&gt;lineEdit()-&gt;cut();
-	} else
-		doCopy(CutToClipboard);
+    if (redirectEditActions()) {
+        if (m_editor-&gt;textEdit())
+            m_editor-&gt;textEdit()-&gt;cut();
+        else if (m_editor-&gt;lineEdit())
+            m_editor-&gt;lineEdit()-&gt;cut();
+    } else
+        doCopy(CutToClipboard);
 }
 
 void Basket::noteOpen(Note *note)
 {
-	/*
-	GetSelectedNotes
-	NoSelectedNote || Count == 0 ? return
-	AllTheSameType ?
-	Get { url, message(count) }
-	*/
-
-	// TODO: Open ALL selected notes!
-	if (!note)
-		note = theSelectedNote();
-	if (!note)
-		return;
-
-	KUrl    url     = note-&gt;content()-&gt;urlToOpen(/*with=*/false);
-	QString message = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOne /*NoteContent::OpenSeveral*/);
-	if (url.isEmpty()) {
-		if (message.isEmpty())
-			emit postMessage(i18n(&quot;Unable to open this note.&quot;) /*&quot;Unable to open those notes.&quot;*/);
-		else {
-			int result = KMessageBox::warningContinueCancel(this, message, /*caption=*/QString::null, KGuiItem(i18n(&quot;&amp;Edit&quot;), &quot;edit&quot;));
-			if (result == KMessageBox::Continue)
-				noteEdit(note);
-		}
-	} else {
-		emit postMessage(message); // &quot;Openning link target...&quot; / &quot;Launching application...&quot; / &quot;Openning note file...&quot;
-		// Finally do the opening job:
-		QString customCommand = note-&gt;content()-&gt;customOpenCommand();
-		if (customCommand.isEmpty()) {
-			KRun *run = new KRun(url, window());
-			run-&gt;setAutoDelete(true);
-		} else
-			KRun::run(customCommand, url, window());
-	}
+    /*
+    GetSelectedNotes
+    NoSelectedNote || Count == 0 ? return
+    AllTheSameType ?
+    Get { url, message(count) }
+    */
+
+    // TODO: Open ALL selected notes!
+    if (!note)
+        note = theSelectedNote();
+    if (!note)
+        return;
+
+    KUrl    url     = note-&gt;content()-&gt;urlToOpen(/*with=*/false);
+    QString message = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOne /*NoteContent::OpenSeveral*/);
+    if (url.isEmpty()) {
+        if (message.isEmpty())
+            emit postMessage(i18n(&quot;Unable to open this note.&quot;) /*&quot;Unable to open those notes.&quot;*/);
+        else {
+            int result = KMessageBox::warningContinueCancel(this, message, /*caption=*/QString::null, KGuiItem(i18n(&quot;&amp;Edit&quot;), &quot;edit&quot;));
+            if (result == KMessageBox::Continue)
+                noteEdit(note);
+        }
+    } else {
+        emit postMessage(message); // &quot;Openning link target...&quot; / &quot;Launching application...&quot; / &quot;Openning note file...&quot;
+        // Finally do the opening job:
+        QString customCommand = note-&gt;content()-&gt;customOpenCommand();
+        if (customCommand.isEmpty()) {
+            KRun *run = new KRun(url, window());
+            run-&gt;setAutoDelete(true);
+        } else
+            KRun::run(customCommand, url, window());
+    }
 }
 
 /** Code from bool KRun::displayOpenWithDialog(const KUrl::List&amp; lst, bool tempFiles)
@@ -4352,408 +4349,408 @@ void Basket::noteOpen(Note *note)
   */
 bool KRun__displayOpenWithDialog(const KUrl::List&amp; lst, QWidget *window, bool tempFiles, const QString &amp;text)
 {
-	if (kapp &amp;&amp; !KAuthorized::authorizeKAction(&quot;openwith&quot;)) {
-		KMessageBox::sorry(window, i18n(&quot;You are not authorized to open this file.&quot;)); // TODO: Better message, i18n freeze :-(
-		return false;
-	}
-	KOpenWithDialog l(lst, text, QString::null, 0L);
-	if (l.exec()) {
-		KService::Ptr service = l.service();
-		if (!!service)
-			return KRun::run(*service, lst, window, tempFiles);
-		//kDebug(250) &lt;&lt; &quot;No service set, running &quot; &lt;&lt; l.text() &lt;&lt; endl;
-		return KRun::run(l.text(), lst, window); // TODO handle tempFiles
-	}
-	return false;
+    if (kapp &amp;&amp; !KAuthorized::authorizeKAction(&quot;openwith&quot;)) {
+        KMessageBox::sorry(window, i18n(&quot;You are not authorized to open this file.&quot;)); // TODO: Better message, i18n freeze :-(
+        return false;
+    }
+    KOpenWithDialog l(lst, text, QString::null, 0L);
+    if (l.exec()) {
+        KService::Ptr service = l.service();
+        if (!!service)
+            return KRun::run(*service, lst, window, tempFiles);
+        //kDebug(250) &lt;&lt; &quot;No service set, running &quot; &lt;&lt; l.text() &lt;&lt; endl;
+        return KRun::run(l.text(), lst, window); // TODO handle tempFiles
+    }
+    return false;
 }
 
 void Basket::noteOpenWith(Note *note)
 {
-	if (!note)
-		note = theSelectedNote();
-	if (!note)
-		return;
+    if (!note)
+        note = theSelectedNote();
+    if (!note)
+        return;
 
-	KUrl    url     = note-&gt;content()-&gt;urlToOpen(/*with=*/true);
-	QString message = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOneWith /*NoteContent::OpenSeveralWith*/);
-	QString text    = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOneWithDialog /*NoteContent::OpenSeveralWithDialog*/);
-	if (url.isEmpty())
-		emit postMessage(i18n(&quot;Unable to open this note.&quot;) /*&quot;Unable to open those notes.&quot;*/);
-	else if (KRun__displayOpenWithDialog(url, window(), false, text))
-		emit postMessage(message); // &quot;Opening link target with...&quot; / &quot;Opening note file with...&quot;
+    KUrl    url     = note-&gt;content()-&gt;urlToOpen(/*with=*/true);
+    QString message = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOneWith /*NoteContent::OpenSeveralWith*/);
+    QString text    = note-&gt;content()-&gt;messageWhenOpening(NoteContent::OpenOneWithDialog /*NoteContent::OpenSeveralWithDialog*/);
+    if (url.isEmpty())
+        emit postMessage(i18n(&quot;Unable to open this note.&quot;) /*&quot;Unable to open those notes.&quot;*/);
+    else if (KRun__displayOpenWithDialog(url, window(), false, text))
+        emit postMessage(message); // &quot;Opening link target with...&quot; / &quot;Opening note file with...&quot;
 }
 
 void Basket::noteSaveAs()
 {
-//	if (!note)
-//		note = theSelectedNote();
-	Note *note = theSelectedNote();
-	if (!note)
-		return;
+//  if (!note)
+//      note = theSelectedNote();
+    Note *note = theSelectedNote();
+    if (!note)
+        return;
 
-	KUrl url = note-&gt;content()-&gt;urlToOpen(/*with=*/false);
-	if (url.isEmpty())
-		return;
+    KUrl url = note-&gt;content()-&gt;urlToOpen(/*with=*/false);
+    if (url.isEmpty())
+        return;
 
-	QString fileName = KFileDialog::getSaveFileName(url.fileName(), note-&gt;content()-&gt;saveAsFilters(), this, i18n(&quot;Save to File&quot;));
-	// TODO: Ask to overwrite !
-	if (fileName.isEmpty())
-		return;
+    QString fileName = KFileDialog::getSaveFileName(url.fileName(), note-&gt;content()-&gt;saveAsFilters(), this, i18n(&quot;Save to File&quot;));
+    // TODO: Ask to overwrite !
+    if (fileName.isEmpty())
+        return;
 
-	// TODO: Convert format, etc. (use NoteContent::saveAs(fileName))
-	KIO::copy(url, KUrl(fileName));
+    // TODO: Convert format, etc. (use NoteContent::saveAs(fileName))
+    KIO::copy(url, KUrl(fileName));
 }
 
 Note* Basket::selectedGroup()
 {
-	FOR_EACH_NOTE (note) {
-		Note *selectedGroup = note-&gt;selectedGroup();
-		if (selectedGroup) {
-			// If the selected group is one group in a column, then return that group, and not the column,
-			// because the column is not ungrouppage, and the Ungroup action would be disabled.
-			if (selectedGroup-&gt;isColumn() &amp;&amp; selectedGroup-&gt;firstChild() &amp;&amp; !selectedGroup-&gt;firstChild()-&gt;next()) {
-				return selectedGroup-&gt;firstChild();
-			}
-			return selectedGroup;
-		}
-	}
-	return 0;
+    FOR_EACH_NOTE(note) {
+        Note *selectedGroup = note-&gt;selectedGroup();
+        if (selectedGroup) {
+            // If the selected group is one group in a column, then return that group, and not the column,
+            // because the column is not ungrouppage, and the Ungroup action would be disabled.
+            if (selectedGroup-&gt;isColumn() &amp;&amp; selectedGroup-&gt;firstChild() &amp;&amp; !selectedGroup-&gt;firstChild()-&gt;next()) {
+                return selectedGroup-&gt;firstChild();
+            }
+            return selectedGroup;
+        }
+    }
+    return 0;
 }
 
 bool Basket::selectionIsOneGroup()
 {
-	return (selectedGroup() != 0);
+    return (selectedGroup() != 0);
 }
 
 Note* Basket::firstSelected()
 {
-	Note *first = 0;
-	FOR_EACH_NOTE (note) {
-		first = note-&gt;firstSelected();
-		if (first)
-			return first;
-	}
-	return 0;
+    Note *first = 0;
+    FOR_EACH_NOTE(note) {
+        first = note-&gt;firstSelected();
+        if (first)
+            return first;
+    }
+    return 0;
 }
 
 Note* Basket::lastSelected()
 {
-	Note *last = 0, *tmp = 0;
-	FOR_EACH_NOTE (note) {
-		tmp = note-&gt;lastSelected();
-		if (tmp)
-			last = tmp;
-	}
-	return last;
+    Note *last = 0, *tmp = 0;
+    FOR_EACH_NOTE(note) {
+        tmp = note-&gt;lastSelected();
+        if (tmp)
+            last = tmp;
+    }
+    return last;
 }
 
 bool Basket::convertTexts()
 {
-	m_watcher-&gt;stopScan();
-	bool convertedNotes = false;
+    m_watcher-&gt;stopScan();
+    bool convertedNotes = false;
 
-	if (!isLoaded())
-		load();
+    if (!isLoaded())
+        load();
 
-	FOR_EACH_NOTE (note)
-		if (note-&gt;convertTexts())
-			convertedNotes = true;
+    FOR_EACH_NOTE(note)
+    if (note-&gt;convertTexts())
+        convertedNotes = true;
 
-	if (convertedNotes)
-		save();
-	m_watcher-&gt;startScan();
-	return convertedNotes;
+    if (convertedNotes)
+        save();
+    m_watcher-&gt;startScan();
+    return convertedNotes;
 }
 
 void Basket::noteGroup()
 {
-/*	// Nothing to do?
-	if (isLocked() || countSelecteds() &lt;= 1)
-		return;
-
-	// If every selected notes are ALREADY in one group, then don't touch anything:
-	Note *selectedGroup = this-&gt;selectedGroup();
-	if (selectedGroup &amp;&amp; !selectedGroup-&gt;isColumn())
-		return;
-*/
-
-	// Copied from BNPView::updateNotesActions()
-	bool severalSelected = countSelecteds() &gt;= 2;
-	Note *selectedGroup = (severalSelected ? this-&gt;selectedGroup() : 0);
-	bool enabled = !isLocked() &amp;&amp; severalSelected &amp;&amp; (!selectedGroup || selectedGroup-&gt;isColumn());
-	if (!enabled)
-		return;
-
-	// Get the first selected note: we will group selected items just before:
-	Note *first = firstSelected();
-//	if (selectedGroup != 0 || first == 0)
-//		return;
-
-	m_loaded = false; // Hack to avoid notes to be unselected and new notes to be selected:
-
-	// Create and insert the receiving group:
-	Note *group = new Note(this);
-	if (first-&gt;isFree()) {
-		insertNote(group, 0L, Note::BottomColumn, QPoint(first-&gt;finalX(), first-&gt;finalY()), /*animateNewPosition=*/false);
-	} else {
-		insertNote(group, first, Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
-	}
-
-	// Put a FAKE UNSELECTED note in the new group, so if the new group is inside an allSelected() group, the parent group is not moved inside the new group!
-	Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
-	insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
-
-	// Group the notes:
-	Note *nextNote;
-	Note *note = firstNote();
-	while (note) {
-		nextNote = note-&gt;next();
-		note-&gt;groupIn(group);
-		note = nextNote;
-	}
-
-	m_loaded = true; // Part 2 / 2 of the workarround!
-
-	// Do cleanup:
-	unplugNote(fakeNote);
-	unselectAll();
-	group-&gt;setSelectedRecursively(true); // Notes were unselected by unplugging
-
-	relayoutNotes(true);
-	save();
+    /*  // Nothing to do?
+        if (isLocked() || countSelecteds() &lt;= 1)
+            return;
+
+        // If every selected notes are ALREADY in one group, then don't touch anything:
+        Note *selectedGroup = this-&gt;selectedGroup();
+        if (selectedGroup &amp;&amp; !selectedGroup-&gt;isColumn())
+            return;
+    */
+
+    // Copied from BNPView::updateNotesActions()
+    bool severalSelected = countSelecteds() &gt;= 2;
+    Note *selectedGroup = (severalSelected ? this-&gt;selectedGroup() : 0);
+    bool enabled = !isLocked() &amp;&amp; severalSelected &amp;&amp; (!selectedGroup || selectedGroup-&gt;isColumn());
+    if (!enabled)
+        return;
+
+    // Get the first selected note: we will group selected items just before:
+    Note *first = firstSelected();
+//  if (selectedGroup != 0 || first == 0)
+//      return;
+
+    m_loaded = false; // Hack to avoid notes to be unselected and new notes to be selected:
+
+    // Create and insert the receiving group:
+    Note *group = new Note(this);
+    if (first-&gt;isFree()) {
+        insertNote(group, 0L, Note::BottomColumn, QPoint(first-&gt;finalX(), first-&gt;finalY()), /*animateNewPosition=*/false);
+    } else {
+        insertNote(group, first, Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
+    }
+
+    // Put a FAKE UNSELECTED note in the new group, so if the new group is inside an allSelected() group, the parent group is not moved inside the new group!
+    Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+    insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+
+    // Group the notes:
+    Note *nextNote;
+    Note *note = firstNote();
+    while (note) {
+        nextNote = note-&gt;next();
+        note-&gt;groupIn(group);
+        note = nextNote;
+    }
+
+    m_loaded = true; // Part 2 / 2 of the workarround!
+
+    // Do cleanup:
+    unplugNote(fakeNote);
+    unselectAll();
+    group-&gt;setSelectedRecursively(true); // Notes were unselected by unplugging
+
+    relayoutNotes(true);
+    save();
 }
 
 void Basket::noteUngroup()
 {
-	Note *group = selectedGroup();
-	if (group &amp;&amp; !group-&gt;isColumn())
-		ungroupNote(group);
-	save();
+    Note *group = selectedGroup();
+    if (group &amp;&amp; !group-&gt;isColumn())
+        ungroupNote(group);
+    save();
 }
 
 void Basket::unplugSelection(NoteSelection *selection)
 {
-	for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked())
-		unplugNote(toUnplug-&gt;note);
+    for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked())
+        unplugNote(toUnplug-&gt;note);
 }
 
 void Basket::insertSelection(NoteSelection *selection, Note *after)
 {
-	for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked()) {
-		if (toUnplug-&gt;note-&gt;isGroup()) {
-			Note *group = new Note(this);
-			insertNote(group, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
-			Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
-			insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
-			insertSelection(toUnplug-&gt;firstChild, fakeNote);
-			unplugNote(fakeNote);
-			after = group;
-		} else {
-			Note *note = toUnplug-&gt;note;
-			note-&gt;setPrev(0);
-			note-&gt;setNext(0);
-			insertNote(note, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/true);
-			after = note;
-		}
-	}
+    for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked()) {
+        if (toUnplug-&gt;note-&gt;isGroup()) {
+            Note *group = new Note(this);
+            insertNote(group, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+            Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+            insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+            insertSelection(toUnplug-&gt;firstChild, fakeNote);
+            unplugNote(fakeNote);
+            after = group;
+        } else {
+            Note *note = toUnplug-&gt;note;
+            note-&gt;setPrev(0);
+            note-&gt;setNext(0);
+            insertNote(note, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/true);
+            after = note;
+        }
+    }
 }
 
 void Basket::selectSelection(NoteSelection *selection)
 {
-	for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked()) {
-		if (toUnplug-&gt;note-&gt;isGroup())
-			selectSelection(toUnplug);
-		else
-			toUnplug-&gt;note-&gt;setSelected(true);
-	}
+    for (NoteSelection *toUnplug = selection-&gt;firstStacked(); toUnplug; toUnplug = toUnplug-&gt;nextStacked()) {
+        if (toUnplug-&gt;note-&gt;isGroup())
+            selectSelection(toUnplug);
+        else
+            toUnplug-&gt;note-&gt;setSelected(true);
+    }
 }
 
 void Basket::noteMoveOnTop()
 {
-	// TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
-	// TODO: Move on top/bottom... of the column or basjet
-
-	NoteSelection *selection = selectedNotes();
-	unplugSelection(selection);
-	// Replug the notes:
-	Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
-	if (isColumnsLayout()) {
-		if (firstNote()-&gt;firstChild())
-			insertNote(fakeNote, firstNote()-&gt;firstChild(), Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
-		else
-			insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
-	} else {
-		// TODO: Also allow to move notes on top of a group!!!!!!!
-		insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
-	}
-	insertSelection(selection, fakeNote);
-	unplugNote(fakeNote);
-	selectSelection(selection);
-	relayoutNotes(true);
-	save();
+    // TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
+    // TODO: Move on top/bottom... of the column or basjet
+
+    NoteSelection *selection = selectedNotes();
+    unplugSelection(selection);
+    // Replug the notes:
+    Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+    if (isColumnsLayout()) {
+        if (firstNote()-&gt;firstChild())
+            insertNote(fakeNote, firstNote()-&gt;firstChild(), Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
+        else
+            insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+    } else {
+        // TODO: Also allow to move notes on top of a group!!!!!!!
+        insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+    }
+    insertSelection(selection, fakeNote);
+    unplugNote(fakeNote);
+    selectSelection(selection);
+    relayoutNotes(true);
+    save();
 }
 
 void Basket::noteMoveOnBottom()
 {
 
-	// TODO: Duplicate code: void noteMoveOn();
+    // TODO: Duplicate code: void noteMoveOn();
 
-	// TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
-	// TODO: Move on top/bottom... of the column or basjet
+    // TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
+    // TODO: Move on top/bottom... of the column or basjet
 
-	NoteSelection *selection = selectedNotes();
-	unplugSelection(selection);
-	// Replug the notes:
-	Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
-	if (isColumnsLayout())
-		insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
-	else {
-		// TODO: Also allow to move notes on top of a group!!!!!!!
-		insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
-	}
-	insertSelection(selection, fakeNote);
-	unplugNote(fakeNote);
-	selectSelection(selection);
-	relayoutNotes(true);
-	save();
+    NoteSelection *selection = selectedNotes();
+    unplugSelection(selection);
+    // Replug the notes:
+    Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+    if (isColumnsLayout())
+        insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+    else {
+        // TODO: Also allow to move notes on top of a group!!!!!!!
+        insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+    }
+    insertSelection(selection, fakeNote);
+    unplugNote(fakeNote);
+    selectSelection(selection);
+    relayoutNotes(true);
+    save();
 }
 
 void Basket::moveSelectionTo(Note *here, bool below/* = true*/)
 {
-	NoteSelection *selection = selectedNotes();
-	unplugSelection(selection);
-	// Replug the notes:
-	Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
-//	if (isColumnsLayout())
-		insertNote(fakeNote, here, (below ? Note::BottomInsert : Note::TopInsert), QPoint(), /*animateNewPosition=*/false);
-//	else {
-//		// TODO: Also allow to move notes on top of a group!!!!!!!
-//		insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
-//	}
-	insertSelection(selection, fakeNote);
-	unplugNote(fakeNote);
-	selectSelection(selection);
-	relayoutNotes(true);
-	save();
+    NoteSelection *selection = selectedNotes();
+    unplugSelection(selection);
+    // Replug the notes:
+    Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+//  if (isColumnsLayout())
+    insertNote(fakeNote, here, (below ? Note::BottomInsert : Note::TopInsert), QPoint(), /*animateNewPosition=*/false);
+//  else {
+//      // TODO: Also allow to move notes on top of a group!!!!!!!
+//      insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+//  }
+    insertSelection(selection, fakeNote);
+    unplugNote(fakeNote);
+    selectSelection(selection);
+    relayoutNotes(true);
+    save();
 }
 
 void Basket::noteMoveNoteUp()
 {
 
-	// TODO: Move between columns, even if they are empty !!!!!!!
+    // TODO: Move between columns, even if they are empty !!!!!!!
 
-	// TODO: if first note of a group, move just above the group! And let that even if there is no note before that group!!!
+    // TODO: if first note of a group, move just above the group! And let that even if there is no note before that group!!!
 
-	Note *first    = firstSelected();
-	Note *previous = first-&gt;prevShownInStack();
-	if (previous)
-		moveSelectionTo(previous, /*below=*/false);
+    Note *first    = firstSelected();
+    Note *previous = first-&gt;prevShownInStack();
+    if (previous)
+        moveSelectionTo(previous, /*below=*/false);
 }
 
 void Basket::noteMoveNoteDown()
 {
-	Note *first = lastSelected();
-	Note *next  = first-&gt;nextShownInStack();
-	if (next)
-		moveSelectionTo(next, /*below=*/true);
+    Note *first = lastSelected();
+    Note *next  = first-&gt;nextShownInStack();
+    if (next)
+        moveSelectionTo(next, /*below=*/true);
 }
 
 void Basket::wheelEvent(QWheelEvent *event)
 {
-	Q3ScrollView::wheelEvent(event);
+    Q3ScrollView::wheelEvent(event);
 }
 
 void Basket::linkLookChanged()
 {
-	Note *note = m_firstNote;
-	while (note) {
-		note-&gt;linkLookChanged();
-		note = note-&gt;next();
-	}
-	relayoutNotes(true);
+    Note *note = m_firstNote;
+    while (note) {
+        note-&gt;linkLookChanged();
+        note = note-&gt;next();
+    }
+    relayoutNotes(true);
 }
 
 void Basket::slotCopyingDone2(KIO::Job *job,
                               const KUrl &amp;/*from*/,
                               const KUrl &amp;to)
 {
-	if (job-&gt;error()) {
-		DEBUG_WIN &lt;&lt; &quot;Copy finished, ERROR&quot;;
-		return;
-	}
-	Note *note = noteForFullPath(to.path());
-	DEBUG_WIN &lt;&lt; &quot;Copy finished, load note: &quot; + to.path() + (note ? &quot;&quot; : &quot; --- NO CORRESPONDING NOTE&quot;);
-	if (note != 0L) {
-		note-&gt;content()-&gt;loadFromFile(/*lazyLoad=*/false);
-		if(isEncrypted())
-			note-&gt;content()-&gt;saveToFile();
-		if (m_focusedNote == note)   // When inserting a new note we ensure it visble
-			ensureNoteVisible(note); //  But after loading it has certainly grown and if it was
-	}                                //  on bottom of the basket it's not visible entirly anymore
+    if (job-&gt;error()) {
+        DEBUG_WIN &lt;&lt; &quot;Copy finished, ERROR&quot;;
+        return;
+    }
+    Note *note = noteForFullPath(to.path());
+    DEBUG_WIN &lt;&lt; &quot;Copy finished, load note: &quot; + to.path() + (note ? &quot;&quot; : &quot; --- NO CORRESPONDING NOTE&quot;);
+    if (note != 0L) {
+        note-&gt;content()-&gt;loadFromFile(/*lazyLoad=*/false);
+        if (isEncrypted())
+            note-&gt;content()-&gt;saveToFile();
+        if (m_focusedNote == note)   // When inserting a new note we ensure it visble
+            ensureNoteVisible(note); //  But after loading it has certainly grown and if it was
+    }                                //  on bottom of the basket it's not visible entirly anymore
 }
 
 Note* Basket::noteForFullPath(const QString &amp;path)
 {
-	Note *note = firstNote();
-	Note *found;
-	while (note) {
-		found = note-&gt;noteForFullPath(path);
-		if (found)
-			return found;
-		note = note-&gt;next();
-	}
-	return 0;
+    Note *note = firstNote();
+    Note *found;
+    while (note) {
+        found = note-&gt;noteForFullPath(path);
+        if (found)
+            return found;
+        note = note-&gt;next();
+    }
+    return 0;
 }
 
 void Basket::deleteFiles()
 {
-	m_watcher-&gt;stopScan();
-	Tools::deleteRecursively(fullPath());
+    m_watcher-&gt;stopScan();
+    Tools::deleteRecursively(fullPath());
 }
 
 QList&lt;State*&gt; Basket::usedStates()
 {
-	QList&lt;State*&gt; states;
-	FOR_EACH_NOTE (note)
-		note-&gt;usedStates(states);
-	return states;
+    QList&lt;State*&gt; states;
+    FOR_EACH_NOTE(note)
+    note-&gt;usedStates(states);
+    return states;
 }
 
 QString Basket::saveGradientBackground(const QColor &amp;color, const QFont &amp;font, const QString &amp;folder)
 {
-	// Construct file name and return if the file already exists:
-	QString fileName = &quot;note_background_&quot; + color.name().toLower().mid(1) + &quot;.png&quot;;
-	QString fullPath = folder + fileName;
-	if (QFile::exists(fullPath))
-		return fileName;
+    // Construct file name and return if the file already exists:
+    QString fileName = &quot;note_background_&quot; + color.name().toLower().mid(1) + &quot;.png&quot;;
+    QString fullPath = folder + fileName;
+    if (QFile::exists(fullPath))
+        return fileName;
 
-	// Get the gradient top and bottom colors:
-	QColor topBgColor;
-	QColor bottomBgColor;
-	Note::getGradientColors(color, &amp;topBgColor, &amp;bottomBgColor);
+    // Get the gradient top and bottom colors:
+    QColor topBgColor;
+    QColor bottomBgColor;
+    Note::getGradientColors(color, &amp;topBgColor, &amp;bottomBgColor);
 
-	// Draw and save the gradient image:
-	int sampleTextHeight = QFontMetrics(font)
-	                       .boundingRect(0, 0, /*width=*/10000, /*height=*/0, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, &quot;Test text&quot;)
-	                       .height();
-	QPixmap noteGradient(100, sampleTextHeight + Note::NOTE_MARGIN);
-	QPainter painter(&amp;noteGradient);
-	drawGradient(&amp;painter, topBgColor, bottomBgColor, 0, 0, noteGradient.width(), noteGradient.height(), /*sunken=*/false, /*horz=*/true, /*flat=*/false);
-	painter.end();
-	noteGradient.save(fullPath, &quot;PNG&quot;);
+    // Draw and save the gradient image:
+    int sampleTextHeight = QFontMetrics(font)
+                           .boundingRect(0, 0, /*width=*/10000, /*height=*/0, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, &quot;Test text&quot;)
+                           .height();
+    QPixmap noteGradient(100, sampleTextHeight + Note::NOTE_MARGIN);
+    QPainter painter(&amp;noteGradient);
+    drawGradient(&amp;painter, topBgColor, bottomBgColor, 0, 0, noteGradient.width(), noteGradient.height(), /*sunken=*/false, /*horz=*/true, /*flat=*/false);
+    painter.end();
+    noteGradient.save(fullPath, &quot;PNG&quot;);
 
-	// Return the name of the created file:
-	return fileName;
+    // Return the name of the created file:
+    return fileName;
 }
 
 void Basket::listUsedTags(QList&lt;Tag*&gt; &amp;list)
 {
-	if (!isLoaded()) {
-		load();
-	}
+    if (!isLoaded()) {
+        load();
+    }
 
-	FOR_EACH_NOTE (child)
-		child-&gt;listUsedTags(list);
+    FOR_EACH_NOTE(child)
+    child-&gt;listUsedTags(list);
 }
 
 
@@ -4763,23 +4760,23 @@ void Basket::listUsedTags(QList&lt;Tag*&gt; &amp;list)
   */
 void Basket::setFocusedNote(Note *note) // void Basket::changeFocusTo(Note *note)
 {
-	// Don't focus an hidden note:
-	if (note != 0L &amp;&amp; !note-&gt;isShown())
-		return;
-	// When clicking a group, this group gets focused. But only content-based notes should be focused:
-	if (note &amp;&amp; note-&gt;isGroup())
-		note = note-&gt;firstRealChild();
-	// The first time a note is focused, it becomes the start of the Shift selection:
-	if (m_startOfShiftSelectionNote == 0)
-		m_startOfShiftSelectionNote = note;
-	// Unfocus the old focused note:
-	if (m_focusedNote != 0L)
-		m_focusedNote-&gt;setFocused(false);
-	// Notify the new one to draw a focus rectangle... only if the basket is focused:
-	if (hasFocus() &amp;&amp; note != 0L)
-		note-&gt;setFocused(true);
-	// Save the new focused note:
-	m_focusedNote = note;
+    // Don't focus an hidden note:
+    if (note != 0L &amp;&amp; !note-&gt;isShown())
+        return;
+    // When clicking a group, this group gets focused. But only content-based notes should be focused:
+    if (note &amp;&amp; note-&gt;isGroup())
+        note = note-&gt;firstRealChild();
+    // The first time a note is focused, it becomes the start of the Shift selection:
+    if (m_startOfShiftSelectionNote == 0)
+        m_startOfShiftSelectionNote = note;
+    // Unfocus the old focused note:
+    if (m_focusedNote != 0L)
+        m_focusedNote-&gt;setFocused(false);
+    // Notify the new one to draw a focus rectangle... only if the basket is focused:
+    if (hasFocus() &amp;&amp; note != 0L)
+        note-&gt;setFocused(true);
+    // Save the new focused note:
+    m_focusedNote = note;
 }
 
 /** If no shown note is currently focused, try to find a shown note and focus it
@@ -4787,304 +4784,304 @@ void Basket::setFocusedNote(Note *note) // void Basket::changeFocusTo(Note *note
   */
 void Basket::focusANote()
 {
-	if (countFounds() == 0) { // No note to focus
-		setFocusedNote(0L);
-//		m_startOfShiftSelectionNote = 0;
-		return;
-	}
-
-	if (m_focusedNote == 0L) { // No focused note yet : focus the first shown
-		Note *toFocus = (isFreeLayout() ? noteOnHome() : firstNoteShownInStack());
-		setFocusedNote(toFocus);
-//		m_startOfShiftSelectionNote = m_focusedNote;
-		return;
-	}
-
-	// Search a visible note to focus if the focused one isn't shown :
-	Note *toFocus = m_focusedNote;
-	if (toFocus &amp;&amp; !toFocus-&gt;isShown())
-		toFocus = toFocus-&gt;nextShownInStack();
-	if (!toFocus &amp;&amp; m_focusedNote)
-		toFocus = m_focusedNote-&gt;prevShownInStack();
-	setFocusedNote(toFocus);
-//	m_startOfShiftSelectionNote = toFocus;
+    if (countFounds() == 0) { // No note to focus
+        setFocusedNote(0L);
+//      m_startOfShiftSelectionNote = 0;
+        return;
+    }
+
+    if (m_focusedNote == 0L) { // No focused note yet : focus the first shown
+        Note *toFocus = (isFreeLayout() ? noteOnHome() : firstNoteShownInStack());
+        setFocusedNote(toFocus);
+//      m_startOfShiftSelectionNote = m_focusedNote;
+        return;
+    }
+
+    // Search a visible note to focus if the focused one isn't shown :
+    Note *toFocus = m_focusedNote;
+    if (toFocus &amp;&amp; !toFocus-&gt;isShown())
+        toFocus = toFocus-&gt;nextShownInStack();
+    if (!toFocus &amp;&amp; m_focusedNote)
+        toFocus = m_focusedNote-&gt;prevShownInStack();
+    setFocusedNote(toFocus);
+//  m_startOfShiftSelectionNote = toFocus;
 }
 
 Note* Basket::firstNoteInStack()
 {
-	if (!firstNote())
-		return 0;
+    if (!firstNote())
+        return 0;
 
-	if (firstNote()-&gt;content())
-		return firstNote();
-	else
-		return firstNote()-&gt;nextInStack();
+    if (firstNote()-&gt;content())
+        return firstNote();
+    else
+        return firstNote()-&gt;nextInStack();
 }
 
 Note* Basket::lastNoteInStack()
 {
-	Note *note = lastNote();
-	while (note) {
-		if (note-&gt;content())
-			return note;
-		Note *possibleNote = note-&gt;lastRealChild();
-		if (possibleNote &amp;&amp; possibleNote-&gt;content())
-			return possibleNote;
-		note = note-&gt;prev();
-	}
-	return 0;
+    Note *note = lastNote();
+    while (note) {
+        if (note-&gt;content())
+            return note;
+        Note *possibleNote = note-&gt;lastRealChild();
+        if (possibleNote &amp;&amp; possibleNote-&gt;content())
+            return possibleNote;
+        note = note-&gt;prev();
+    }
+    return 0;
 }
 
 Note* Basket::firstNoteShownInStack()
 {
-	Note *first = firstNoteInStack();
-	while (first &amp;&amp; !first-&gt;isShown())
-		first = first-&gt;nextInStack();
-	return first;
+    Note *first = firstNoteInStack();
+    while (first &amp;&amp; !first-&gt;isShown())
+        first = first-&gt;nextInStack();
+    return first;
 }
 
 Note* Basket::lastNoteShownInStack()
 {
-	Note *last = lastNoteInStack();
-	while (last &amp;&amp; !last-&gt;isShown())
-		last = last-&gt;prevInStack();
-	return last;
+    Note *last = lastNoteInStack();
+    while (last &amp;&amp; !last-&gt;isShown())
+        last = last-&gt;prevInStack();
+    return last;
 }
 
 inline int abs(int n)
 {
-	return (n &lt; 0 ? -n : n);
+    return (n &lt; 0 ? -n : n);
 }
 
 Note* Basket::noteOn(NoteOn side)
 {
-	Note *bestNote = 0;
-	int   distance = -1;
-	int   bestDistance = contentsWidth() * contentsHeight() * 10;
-
-	Note *note    = firstNoteShownInStack();
-	Note *primary = m_focusedNote-&gt;parentPrimaryNote();
-	while (note) {
-		switch (side) {
-			case LEFT_SIDE:   distance = m_focusedNote-&gt;distanceOnLeftRight(note, LEFT_SIDE);   break;
-			case RIGHT_SIDE:  distance = m_focusedNote-&gt;distanceOnLeftRight(note, RIGHT_SIDE);  break;
-			case TOP_SIDE:    distance = m_focusedNote-&gt;distanceOnTopBottom(note, TOP_SIDE);    break;
-			case BOTTOM_SIDE: distance = m_focusedNote-&gt;distanceOnTopBottom(note, BOTTOM_SIDE); break;
-		}
-		if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note-&gt;parentPrimaryNote()) &amp;&amp; note != m_focusedNote &amp;&amp; distance &gt; 0 &amp;&amp; distance &lt; bestDistance) {
-			bestNote     = note;
-			bestDistance = distance;
-		}
-		note = note -&gt;nextShownInStack();
-	}
-
-	return bestNote;
+    Note *bestNote = 0;
+    int   distance = -1;
+    int   bestDistance = contentsWidth() * contentsHeight() * 10;
+
+    Note *note    = firstNoteShownInStack();
+    Note *primary = m_focusedNote-&gt;parentPrimaryNote();
+    while (note) {
+        switch (side) {
+        case LEFT_SIDE:   distance = m_focusedNote-&gt;distanceOnLeftRight(note, LEFT_SIDE);   break;
+        case RIGHT_SIDE:  distance = m_focusedNote-&gt;distanceOnLeftRight(note, RIGHT_SIDE);  break;
+        case TOP_SIDE:    distance = m_focusedNote-&gt;distanceOnTopBottom(note, TOP_SIDE);    break;
+        case BOTTOM_SIDE: distance = m_focusedNote-&gt;distanceOnTopBottom(note, BOTTOM_SIDE); break;
+        }
+        if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note-&gt;parentPrimaryNote()) &amp;&amp; note != m_focusedNote &amp;&amp; distance &gt; 0 &amp;&amp; distance &lt; bestDistance) {
+            bestNote     = note;
+            bestDistance = distance;
+        }
+        note = note -&gt;nextShownInStack();
+    }
+
+    return bestNote;
 }
 
 Note* Basket::firstNoteInGroup()
 {
-	Note *child  = m_focusedNote;
-	Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
-	while (parent) {
-		if (parent-&gt;firstChild() != child &amp;&amp; !parent-&gt;isColumn())
-			return parent-&gt;firstRealChild();
-		child  = parent;
-		parent = parent-&gt;parentNote();
-	}
-	return 0;
+    Note *child  = m_focusedNote;
+    Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
+    while (parent) {
+        if (parent-&gt;firstChild() != child &amp;&amp; !parent-&gt;isColumn())
+            return parent-&gt;firstRealChild();
+        child  = parent;
+        parent = parent-&gt;parentNote();
+    }
+    return 0;
 }
 
 Note* Basket::noteOnHome()
 {
-	// First try to find the first note of the group containing the focused note:
-	Note *child  = m_focusedNote;
-	Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
-	while (parent) {
-		if (parent-&gt;nextShownInStack() != m_focusedNote)
-			return parent-&gt;nextShownInStack();
-		child  = parent;
-		parent = parent-&gt;parentNote();
-	}
-
-	// If it was not found, then focus the very first note in the basket:
-	if (isFreeLayout()) {
-		Note *first = firstNoteShownInStack(); // The effective first note found
-		Note *note  = first; // The current note, to conpare with the previous first note, if this new note is more on top
-		if (note)
-			note = note-&gt;nextShownInStack();
-		while (note) {
-			if (note-&gt;finalY() &lt; first-&gt;finalY() || (note-&gt;finalY() == first-&gt;finalY() &amp;&amp; note-&gt;finalX() &lt; first-&gt;finalX()))
-				first = note;
-			note = note-&gt;nextShownInStack();
-		}
-		return first;
-	} else
-		return firstNoteShownInStack();
+    // First try to find the first note of the group containing the focused note:
+    Note *child  = m_focusedNote;
+    Note *parent = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
+    while (parent) {
+        if (parent-&gt;nextShownInStack() != m_focusedNote)
+            return parent-&gt;nextShownInStack();
+        child  = parent;
+        parent = parent-&gt;parentNote();
+    }
+
+    // If it was not found, then focus the very first note in the basket:
+    if (isFreeLayout()) {
+        Note *first = firstNoteShownInStack(); // The effective first note found
+        Note *note  = first; // The current note, to conpare with the previous first note, if this new note is more on top
+        if (note)
+            note = note-&gt;nextShownInStack();
+        while (note) {
+            if (note-&gt;finalY() &lt; first-&gt;finalY() || (note-&gt;finalY() == first-&gt;finalY() &amp;&amp; note-&gt;finalX() &lt; first-&gt;finalX()))
+                first = note;
+            note = note-&gt;nextShownInStack();
+        }
+        return first;
+    } else
+        return firstNoteShownInStack();
 }
 
 Note* Basket::noteOnEnd()
 {
-	Note *child     = m_focusedNote;
-	Note *parent    = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
-	Note *lastChild;
-	while (parent) {
-		lastChild = parent-&gt;lastRealChild();
-		if (lastChild &amp;&amp; lastChild != m_focusedNote) {
-			if (lastChild-&gt;isShown())
-				return lastChild;
-			lastChild = lastChild-&gt;prevShownInStack();
-			if (lastChild &amp;&amp; lastChild-&gt;isShown() &amp;&amp; lastChild != m_focusedNote)
-				return lastChild;
-		}
-		child  = parent;
-		parent = parent-&gt;parentNote();
-	}
-	if (isFreeLayout()) {
-		Note *last;
-		Note *note;
-		last = note = firstNoteShownInStack();
-		note = note-&gt;nextShownInStack();
-		while (note) {
-			if (note-&gt;finalBottom() &gt; last-&gt;finalBottom() || (note-&gt;finalBottom() == last-&gt;finalBottom() &amp;&amp; note-&gt;finalX() &gt; last-&gt;finalX()))
-				last = note;
-			note = note-&gt;nextShownInStack();
-		}
-		return last;
-	} else
-		return lastNoteShownInStack();
+    Note *child     = m_focusedNote;
+    Note *parent    = (m_focusedNote ? m_focusedNote-&gt;parentNote() : 0);
+    Note *lastChild;
+    while (parent) {
+        lastChild = parent-&gt;lastRealChild();
+        if (lastChild &amp;&amp; lastChild != m_focusedNote) {
+            if (lastChild-&gt;isShown())
+                return lastChild;
+            lastChild = lastChild-&gt;prevShownInStack();
+            if (lastChild &amp;&amp; lastChild-&gt;isShown() &amp;&amp; lastChild != m_focusedNote)
+                return lastChild;
+        }
+        child  = parent;
+        parent = parent-&gt;parentNote();
+    }
+    if (isFreeLayout()) {
+        Note *last;
+        Note *note;
+        last = note = firstNoteShownInStack();
+        note = note-&gt;nextShownInStack();
+        while (note) {
+            if (note-&gt;finalBottom() &gt; last-&gt;finalBottom() || (note-&gt;finalBottom() == last-&gt;finalBottom() &amp;&amp; note-&gt;finalX() &gt; last-&gt;finalX()))
+                last = note;
+            note = note-&gt;nextShownInStack();
+        }
+        return last;
+    } else
+        return lastNoteShownInStack();
 }
 
 
 void Basket::keyPressEvent(QKeyEvent *event)
 {
-	if (isDuringEdit() &amp;&amp; event-&gt;key() == Qt::Key_Return) {
-		//if (m_editor-&gt;lineEdit())
-		//	closeEditor();
-		//else
-		m_editor-&gt;widget()-&gt;setFocus();
-	} else if (event-&gt;key() == Qt::Key_Escape) {
-		if (isDuringEdit())
-			closeEditor();
-		else if (decoration()-&gt;filterData().isFiltering)
-			decoration()-&gt;filterBar()-&gt;reset();
-		else
-			unselectAll();
-	}
-
-	if (countFounds() == 0)
-		return;
-
-	if (!m_focusedNote)
-		return;
-
-	Note *toFocus = 0L;
-
-	switch (event-&gt;key()) {
-		case Qt::Key_Down:
-			toFocus = (isFreeLayout() ? noteOn(BOTTOM_SIDE) : m_focusedNote-&gt;nextShownInStack());
-			if (toFocus)
-				break;
-			scrollBy(0, 30); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_Up:
-			toFocus = (isFreeLayout() ? noteOn(TOP_SIDE) : m_focusedNote-&gt;prevShownInStack());
-			if (toFocus)
-				break;
-			scrollBy(0, -30); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_PageDown:
-			if (isFreeLayout()) {
-				Note *lastFocused = m_focusedNote;
-				for (int i = 0; i &lt; 10 &amp;&amp; m_focusedNote; ++i)
-					m_focusedNote = noteOn(BOTTOM_SIDE);
-				toFocus = m_focusedNote;
-				m_focusedNote = lastFocused;
-			} else {
-				toFocus = m_focusedNote;
-				for (int i = 0; i &lt; 10 &amp;&amp; toFocus; ++i)
-					toFocus = toFocus-&gt;nextShownInStack();
-			}
-			if (toFocus == 0L)
-				toFocus = (isFreeLayout() ? noteOnEnd() : lastNoteShownInStack());
-			if (toFocus &amp;&amp; toFocus != m_focusedNote)
-				break;
-			scrollBy(0, visibleHeight() / 2); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_PageUp:
-			if (isFreeLayout()) {
-				Note *lastFocused = m_focusedNote;
-				for (int i = 0; i &lt; 10 &amp;&amp; m_focusedNote; ++i)
-					m_focusedNote = noteOn(TOP_SIDE);
-				toFocus = m_focusedNote;
-				m_focusedNote = lastFocused;
-			} else {
-				toFocus = m_focusedNote;
-				for (int i = 0; i &lt; 10 &amp;&amp; toFocus; ++i)
-					toFocus = toFocus-&gt;prevShownInStack();
-			}
-			if (toFocus == 0L)
-				toFocus = (isFreeLayout() ? noteOnHome() : firstNoteShownInStack());
-			if (toFocus &amp;&amp; toFocus != m_focusedNote)
-				break;
-			scrollBy(0, - visibleHeight() / 2); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_Home:
-			toFocus = noteOnHome();
-			break;
-		case Qt::Key_End:
-			toFocus = noteOnEnd();
-			break;
-		case Qt::Key_Left:
-			if (m_focusedNote-&gt;tryFoldParent())
-				return;
-			if ( (toFocus = noteOn(LEFT_SIDE)) )
-				break;
-			if ( (toFocus = firstNoteInGroup()) )
-				break;
-			scrollBy(-30, 0); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_Right:
-			if (m_focusedNote-&gt;tryExpandParent())
-				return;
-			if ( (toFocus = noteOn(RIGHT_SIDE)) )
-				break;
-			scrollBy(30, 0); // This cases do not move focus to another note...
-			return;
-		case Qt::Key_Space:  // This case do not move focus to another note...
-			if (m_focusedNote) {
-				m_focusedNote-&gt;setSelected( ! m_focusedNote-&gt;isSelected() );
-				event-&gt;accept();
-			} else
-				event-&gt;ignore();
-			return;          // ... so we return after the process
-		default:
-			return;
-	}
-
-	if (toFocus == 0L) { // If no direction keys have been pressed OR reached out the begin or end
-		event-&gt;ignore(); // Important !!
-		return;
-	}
-
-	if (event-&gt;modifiers() &amp; Qt::ShiftModifier) { // Shift+arrowKeys selection
-		if (m_startOfShiftSelectionNote == 0L)
-			m_startOfShiftSelectionNote = toFocus;
-		ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
-		selectRange(m_startOfShiftSelectionNote, toFocus);
-		setFocusedNote(toFocus);
-		event-&gt;accept();
-		return;
-	} else /*if (toFocus != m_focusedNote)*/ {  // Move focus to ANOTHER note...
-		ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
-		setFocusedNote(toFocus);
-		m_startOfShiftSelectionNote = toFocus;
-		if ( ! (event-&gt;modifiers() &amp; Qt::ControlModifier) )       // ... select only current note if Control
-			unselectAllBut(m_focusedNote);
-		event-&gt;accept();
-		return;
-	}
-
-	event-&gt;ignore(); // Important !!
+    if (isDuringEdit() &amp;&amp; event-&gt;key() == Qt::Key_Return) {
+        //if (m_editor-&gt;lineEdit())
+        //  closeEditor();
+        //else
+        m_editor-&gt;widget()-&gt;setFocus();
+    } else if (event-&gt;key() == Qt::Key_Escape) {
+        if (isDuringEdit())
+            closeEditor();
+        else if (decoration()-&gt;filterData().isFiltering)
+            decoration()-&gt;filterBar()-&gt;reset();
+        else
+            unselectAll();
+    }
+
+    if (countFounds() == 0)
+        return;
+
+    if (!m_focusedNote)
+        return;
+
+    Note *toFocus = 0L;
+
+    switch (event-&gt;key()) {
+    case Qt::Key_Down:
+        toFocus = (isFreeLayout() ? noteOn(BOTTOM_SIDE) : m_focusedNote-&gt;nextShownInStack());
+        if (toFocus)
+            break;
+        scrollBy(0, 30); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_Up:
+        toFocus = (isFreeLayout() ? noteOn(TOP_SIDE) : m_focusedNote-&gt;prevShownInStack());
+        if (toFocus)
+            break;
+        scrollBy(0, -30); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_PageDown:
+        if (isFreeLayout()) {
+            Note *lastFocused = m_focusedNote;
+            for (int i = 0; i &lt; 10 &amp;&amp; m_focusedNote; ++i)
+                m_focusedNote = noteOn(BOTTOM_SIDE);
+            toFocus = m_focusedNote;
+            m_focusedNote = lastFocused;
+        } else {
+            toFocus = m_focusedNote;
+            for (int i = 0; i &lt; 10 &amp;&amp; toFocus; ++i)
+                toFocus = toFocus-&gt;nextShownInStack();
+        }
+        if (toFocus == 0L)
+            toFocus = (isFreeLayout() ? noteOnEnd() : lastNoteShownInStack());
+        if (toFocus &amp;&amp; toFocus != m_focusedNote)
+            break;
+        scrollBy(0, visibleHeight() / 2); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_PageUp:
+        if (isFreeLayout()) {
+            Note *lastFocused = m_focusedNote;
+            for (int i = 0; i &lt; 10 &amp;&amp; m_focusedNote; ++i)
+                m_focusedNote = noteOn(TOP_SIDE);
+            toFocus = m_focusedNote;
+            m_focusedNote = lastFocused;
+        } else {
+            toFocus = m_focusedNote;
+            for (int i = 0; i &lt; 10 &amp;&amp; toFocus; ++i)
+                toFocus = toFocus-&gt;prevShownInStack();
+        }
+        if (toFocus == 0L)
+            toFocus = (isFreeLayout() ? noteOnHome() : firstNoteShownInStack());
+        if (toFocus &amp;&amp; toFocus != m_focusedNote)
+            break;
+        scrollBy(0, - visibleHeight() / 2); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_Home:
+        toFocus = noteOnHome();
+        break;
+    case Qt::Key_End:
+        toFocus = noteOnEnd();
+        break;
+    case Qt::Key_Left:
+        if (m_focusedNote-&gt;tryFoldParent())
+            return;
+        if ((toFocus = noteOn(LEFT_SIDE)))
+            break;
+        if ((toFocus = firstNoteInGroup()))
+            break;
+        scrollBy(-30, 0); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_Right:
+        if (m_focusedNote-&gt;tryExpandParent())
+            return;
+        if ((toFocus = noteOn(RIGHT_SIDE)))
+            break;
+        scrollBy(30, 0); // This cases do not move focus to another note...
+        return;
+    case Qt::Key_Space:  // This case do not move focus to another note...
+        if (m_focusedNote) {
+            m_focusedNote-&gt;setSelected(! m_focusedNote-&gt;isSelected());
+            event-&gt;accept();
+        } else
+            event-&gt;ignore();
+        return;          // ... so we return after the process
+    default:
+        return;
+    }
+
+    if (toFocus == 0L) { // If no direction keys have been pressed OR reached out the begin or end
+        event-&gt;ignore(); // Important !!
+        return;
+    }
+
+    if (event-&gt;modifiers() &amp; Qt::ShiftModifier) { // Shift+arrowKeys selection
+        if (m_startOfShiftSelectionNote == 0L)
+            m_startOfShiftSelectionNote = toFocus;
+        ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
+        selectRange(m_startOfShiftSelectionNote, toFocus);
+        setFocusedNote(toFocus);
+        event-&gt;accept();
+        return;
+    } else /*if (toFocus != m_focusedNote)*/ {  // Move focus to ANOTHER note...
+        ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
+        setFocusedNote(toFocus);
+        m_startOfShiftSelectionNote = toFocus;
+        if (!(event-&gt;modifiers() &amp; Qt::ControlModifier))          // ... select only current note if Control
+            unselectAllBut(m_focusedNote);
+        event-&gt;accept();
+        return;
+    }
+
+    event-&gt;ignore(); // Important !!
 }
 
 /** Select a range of notes and deselect the others.
@@ -5092,226 +5089,219 @@ void Basket::keyPressEvent(QKeyEvent *event)
   */
 void Basket::selectRange(Note *start, Note *end, bool unselectOthers /*= true*/)
 {
-	Note *cur;
-	Note *realEnd = 0L;
-
-	// Avoid crash when start (or end) is null
-	if (start == 0L)
-		start = end;
-	else if (end == 0L)
-		end = start;
-	// And if *both* are null
-	if (start == 0L) {
-		if (unselectOthers)
-			unselectAll();
-		return;
-	}
-	// In case there is only one note to select
-	if (start == end) {
-		if (unselectOthers)
-			unselectAllBut(start);
-		else
-			start-&gt;setSelected(true);
-		return;
-	}
-
-	// Free layout baskets should select range as if we were drawing a rectangle between start and end:
-	if (isFreeLayout()) {
-		QRect startRect( start-&gt;finalX(), start-&gt;finalY(), start-&gt;width(), start-&gt;finalHeight() );
-		QRect endRect(     end-&gt;finalX(),   end-&gt;finalY(),   end-&gt;width(),   end-&gt;finalHeight() );
-		QRect toSelect = startRect.unite(endRect);
-		selectNotesIn(toSelect, /*invertSelection=*/false, unselectOthers);
-		return;
-	}
-
-	// Search the REAL first (and deselect the others before it) :
-	for (cur = firstNoteInStack(); cur != 0L; cur = cur-&gt;nextInStack()) {
-		if (cur == start || cur == end)
-			break;
-		if (unselectOthers)
-			cur-&gt;setSelected(false);
-	}
-
-	// Select the notes after REAL start, until REAL end :
-	if (cur == start)
-		realEnd = end;
-	else if (cur == end)
-		realEnd = start;
-
-	for (/*cur = cur*/; cur != 0L; cur = cur-&gt;nextInStack()) {
-		cur-&gt;setSelected(cur-&gt;isShown()); // Select all notes in the range, but only if they are shown
-		if (cur == realEnd)
-			break;
-	}
-
-	if (!unselectOthers)
-		return;
-
-	// Deselect the remaining notes :
-	if (cur)
-		cur = cur-&gt;nextInStack();
-	for (/*cur = cur*/; cur != 0L; cur = cur-&gt;nextInStack())
-		cur-&gt;setSelected(false);
+    Note *cur;
+    Note *realEnd = 0L;
+
+    // Avoid crash when start (or end) is null
+    if (start == 0L)
+        start = end;
+    else if (end == 0L)
+        end = start;
+    // And if *both* are null
+    if (start == 0L) {
+        if (unselectOthers)
+            unselectAll();
+        return;
+    }
+    // In case there is only one note to select
+    if (start == end) {
+        if (unselectOthers)
+            unselectAllBut(start);
+        else
+            start-&gt;setSelected(true);
+        return;
+    }
+
+    // Free layout baskets should select range as if we were drawing a rectangle between start and end:
+    if (isFreeLayout()) {
+        QRect startRect(start-&gt;finalX(), start-&gt;finalY(), start-&gt;width(), start-&gt;finalHeight());
+        QRect endRect(end-&gt;finalX(),   end-&gt;finalY(),   end-&gt;width(),   end-&gt;finalHeight());
+        QRect toSelect = startRect.unite(endRect);
+        selectNotesIn(toSelect, /*invertSelection=*/false, unselectOthers);
+        return;
+    }
+
+    // Search the REAL first (and deselect the others before it) :
+    for (cur = firstNoteInStack(); cur != 0L; cur = cur-&gt;nextInStack()) {
+        if (cur == start || cur == end)
+            break;
+        if (unselectOthers)
+            cur-&gt;setSelected(false);
+    }
+
+    // Select the notes after REAL start, until REAL end :
+    if (cur == start)
+        realEnd = end;
+    else if (cur == end)
+        realEnd = start;
+
+    for (/*cur = cur*/; cur != 0L; cur = cur-&gt;nextInStack()) {
+        cur-&gt;setSelected(cur-&gt;isShown()); // Select all notes in the range, but only if they are shown
+        if (cur == realEnd)
+            break;
+    }
+
+    if (!unselectOthers)
+        return;
+
+    // Deselect the remaining notes :
+    if (cur)
+        cur = cur-&gt;nextInStack();
+    for (/*cur = cur*/; cur != 0L; cur = cur-&gt;nextInStack())
+        cur-&gt;setSelected(false);
 }
 
 void Basket::focusInEvent(QFocusEvent*)
 {
-	// Focus cannot be get with Tab when locked, but a click can focus the basket!
-	if (isLocked()) {
-		if (m_button)
-			QTimer::singleShot( 0, m_button, SLOT(setFocus()) );
-	} else
-		focusANote();      // hasFocus() is true at this stage, note will be focused
+    // Focus cannot be get with Tab when locked, but a click can focus the basket!
+    if (isLocked()) {
+        if (m_button)
+            QTimer::singleShot(0, m_button, SLOT(setFocus()));
+    } else
+        focusANote();      // hasFocus() is true at this stage, note will be focused
 }
 
 void Basket::focusOutEvent(QFocusEvent*)
 {
-	if (m_focusedNote != 0L)
-		m_focusedNote-&gt;setFocused(false);
+    if (m_focusedNote != 0L)
+        m_focusedNote-&gt;setFocused(false);
 }
 
 void Basket::ensureNoteVisible(Note *note)
 {
-	if (!note-&gt;isShown()) // Logical!
-		return;
+    if (!note-&gt;isShown()) // Logical!
+        return;
 
-	if (note == editedNote()) // HACK: When filtering while editing big notes, etc... cause unwanted scrolls
-		return;
+    if (note == editedNote()) // HACK: When filtering while editing big notes, etc... cause unwanted scrolls
+        return;
 
-	int finalBottom = note-&gt;finalY() + qMin(note-&gt;finalHeight(),                                             visibleHeight());
-	int finalRight  = note-&gt;finalX() + qMin(note-&gt;width() + (note-&gt;hasResizer() ? Note::RESIZER_WIDTH : 0),  visibleWidth());
-	ensureVisible( finalRight,     finalBottom,    0,0 );
-	ensureVisible( note-&gt;finalX(), note-&gt;finalY(), 0,0 );
+    int finalBottom = note-&gt;finalY() + qMin(note-&gt;finalHeight(),                                             visibleHeight());
+    int finalRight  = note-&gt;finalX() + qMin(note-&gt;width() + (note-&gt;hasResizer() ? Note::RESIZER_WIDTH : 0),  visibleWidth());
+    ensureVisible(finalRight,     finalBottom,    0, 0);
+    ensureVisible(note-&gt;finalX(), note-&gt;finalY(), 0, 0);
 }
 
 void Basket::addWatchedFile(const QString &amp;fullPath)
 {
-//	DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Add Monitoring Of : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
-	m_watcher-&gt;addFile(fullPath);
+//  DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Add Monitoring Of : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
+    m_watcher-&gt;addFile(fullPath);
 }
 
 void Basket::removeWatchedFile(const QString &amp;fullPath)
 {
-//	DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Remove Monitoring Of : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
-	m_watcher-&gt;removeFile(fullPath);
+//  DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Remove Monitoring Of : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
+    m_watcher-&gt;removeFile(fullPath);
 }
 
 void Basket::watchedFileModified(const QString &amp;fullPath)
 {
-	if (!m_modifiedFiles.contains(fullPath))
-		m_modifiedFiles.append(fullPath);
-	// If a big file is saved by an application, notifications are send several times.
-	// We wait they are not sent anymore to considere the file complete!
-	m_watcherTimer.setSingleShot(true);
-	m_watcherTimer.start(200);
-	DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Modified : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
+    if (!m_modifiedFiles.contains(fullPath))
+        m_modifiedFiles.append(fullPath);
+    // If a big file is saved by an application, notifications are send several times.
+    // We wait they are not sent anymore to considere the file complete!
+    m_watcherTimer.setSingleShot(true);
+    m_watcherTimer.start(200);
+    DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Modified : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
 }
 
 void Basket::watchedFileDeleted(const QString &amp;fullPath)
 {
-	Note *note = noteForFullPath(fullPath);
-	removeWatchedFile(fullPath);
-	if (note) {
-		NoteSelection *selection = selectedNotes();
-		unselectAllBut(note);
-		noteDeleteWithoutConfirmation();
-		while (selection) {
-			selection-&gt;note-&gt;setSelected(true);
-			selection = selection-&gt;nextStacked();
-		}
-	}
-	DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Removed : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
+    Note *note = noteForFullPath(fullPath);
+    removeWatchedFile(fullPath);
+    if (note) {
+        NoteSelection *selection = selectedNotes();
+        unselectAllBut(note);
+        noteDeleteWithoutConfirmation();
+        while (selection) {
+            selection-&gt;note-&gt;setSelected(true);
+            selection = selection-&gt;nextStacked();
+        }
+    }
+    DEBUG_WIN &lt;&lt; &quot;Watcher&gt;Removed : &lt;font color=blue&gt;&quot; + fullPath + &quot;&lt;/font&gt;&quot;;
 }
 
 void Basket::updateModifiedNotes()
 {
-	for (QList&lt;QString&gt;::iterator it = m_modifiedFiles.begin(); it != m_modifiedFiles.end(); ++it) {
-		Note *note = noteForFullPath(*it);
-		if (note)
-			note-&gt;content()-&gt;loadFromFile(/*lazyLoad=*/false);
-	}
-	m_modifiedFiles.clear();
+    for (QList&lt;QString&gt;::iterator it = m_modifiedFiles.begin(); it != m_modifiedFiles.end(); ++it) {
+        Note *note = noteForFullPath(*it);
+        if (note)
+            note-&gt;content()-&gt;loadFromFile(/*lazyLoad=*/false);
+    }
+    m_modifiedFiles.clear();
 }
 
 bool Basket::setProtection(int type, QString key)
 {
 #ifdef HAVE_LIBGPGME
-	if(type == PasswordEncryption || // Ask a new password
-		m_encryptionType != type || m_encryptionKey != key)
-	{
-		int savedType = m_encryptionType;
-		QString savedKey = m_encryptionKey;
-
-		m_encryptionType = type;
-		m_encryptionKey = key;
-		m_gpg-&gt;clearCache();
-
-		if(saveAgain())
-		{
-			emit propertiesChanged(this);
-		}
-		else
-		{
-			m_encryptionType = savedType;
-			m_encryptionKey = savedKey;
-			m_gpg-&gt;clearCache();
-			return false;
-		}
-	}
-	return true;
+    if (type == PasswordEncryption || // Ask a new password
+            m_encryptionType != type || m_encryptionKey != key) {
+        int savedType = m_encryptionType;
+        QString savedKey = m_encryptionKey;
+
+        m_encryptionType = type;
+        m_encryptionKey = key;
+        m_gpg-&gt;clearCache();
+
+        if (saveAgain()) {
+            emit propertiesChanged(this);
+        } else {
+            m_encryptionType = savedType;
+            m_encryptionKey = savedKey;
+            m_gpg-&gt;clearCache();
+            return false;
+        }
+    }
+    return true;
 #else
-	m_encryptionType = type;
-	m_encryptionKey = key;
-	return false;
+    m_encryptionType = type;
+    m_encryptionKey = key;
+    return false;
 #endif
 }
 
 bool Basket::saveAgain()
 {
-	bool result = false;
-
-	m_watcher-&gt;stopScan();
-	// Re-encrypt basket file:
-	result = save();
-	// Re-encrypt every note files recursively:
-	if(result)
-	{
-		FOR_EACH_NOTE (note)
-		{
-			result = note-&gt;saveAgain();
-			if(!result)
-				break;
-		}
-	}
-	m_watcher-&gt;startScan();
-	return result;
+    bool result = false;
+
+    m_watcher-&gt;stopScan();
+    // Re-encrypt basket file:
+    result = save();
+    // Re-encrypt every note files recursively:
+    if (result) {
+        FOR_EACH_NOTE(note) {
+            result = note-&gt;saveAgain();
+            if (!result)
+                break;
+        }
+    }
+    m_watcher-&gt;startScan();
+    return result;
 }
 
 bool Basket::loadFromFile(const QString &amp;fullPath, QString *string, bool isLocalEncoding)
 {
-	QByteArray array;
+    QByteArray array;
 
-	if(loadFromFile(fullPath, &amp;array)){
-		if (isLocalEncoding)
-			*string = QString::fromLocal8Bit(array.data(), array.size());
-		else
-			*string = QString::fromUtf8(array.data(), array.size());
-		return true;
-	}
-	else
-		return false;
+    if (loadFromFile(fullPath, &amp;array)) {
+        if (isLocalEncoding)
+            *string = QString::fromLocal8Bit(array.data(), array.size());
+        else
+            *string = QString::fromUtf8(array.data(), array.size());
+        return true;
+    } else
+        return false;
 }
 
 bool Basket::isEncrypted()
 {
-	return (m_encryptionType != NoEncryption);
+    return (m_encryptionType != NoEncryption);
 }
 
 bool Basket::isFileEncrypted()
 {
     QFile file(fullPath() + &quot;.basket&quot;);
 
-    if (file.open(QIODevice::ReadOnly)){
+    if (file.open(QIODevice::ReadOnly)) {
         // Should be ASCII anyways
         QString line = file.readLine(32);
         if (line.startsWith(&quot;-----BEGIN PGP MESSAGE-----&quot;))
@@ -5322,101 +5312,94 @@ bool Basket::isFileEncrypted()
 
 bool Basket::loadFromFile(const QString &amp;fullPath, QByteArray *array)
 {
-	QFile file(fullPath);
-	bool encrypted = false;
-
-	if (file.open(QIODevice::ReadOnly)){
-		*array = file.readAll();
-		QByteArray magic = &quot;-----BEGIN PGP MESSAGE-----&quot;;
-		int i = 0;
-
-		if(array-&gt;size() &gt; magic.size())
-			for (i = 0; array-&gt;at(i) == magic[i]; ++i)
-				;
-		if (i == magic.size())
-		{
-			encrypted = true;
-		}
-		file.close();
+    QFile file(fullPath);
+    bool encrypted = false;
+
+    if (file.open(QIODevice::ReadOnly)) {
+        *array = file.readAll();
+        QByteArray magic = &quot;-----BEGIN PGP MESSAGE-----&quot;;
+        int i = 0;
+
+        if (array-&gt;size() &gt; magic.size())
+            for (i = 0; array-&gt;at(i) == magic[i]; ++i)
+                ;
+        if (i == magic.size()) {
+            encrypted = true;
+        }
+        file.close();
 #ifdef HAVE_LIBGPGME
-		if(encrypted)
-		{
-			QByteArray tmp(*array);
-
-			tmp.detach();
-			// Only use gpg-agent for private key encryption since it doesn't
-			// cache password used in symmetric encryption.
-			m_gpg-&gt;setUseGnuPGAgent(Settings::useGnuPGAgent() &amp;&amp; m_encryptionType == PrivateKeyEncryption);
-			if(m_encryptionType == PrivateKeyEncryption)
-				m_gpg-&gt;setText(i18n(&quot;Please enter the password for the following private key:&quot;), false);
-			else
-				m_gpg-&gt;setText(i18n(&quot;Please enter the password for the basket &lt;b&gt;%1&lt;/b&gt;:&quot;, basketName()), false); // Used when decrypting
-			return m_gpg-&gt;decrypt(tmp, array);
-		}
+        if (encrypted) {
+            QByteArray tmp(*array);
+
+            tmp.detach();
+            // Only use gpg-agent for private key encryption since it doesn't
+            // cache password used in symmetric encryption.
+            m_gpg-&gt;setUseGnuPGAgent(Settings::useGnuPGAgent() &amp;&amp; m_encryptionType == PrivateKeyEncryption);
+            if (m_encryptionType == PrivateKeyEncryption)
+                m_gpg-&gt;setText(i18n(&quot;Please enter the password for the following private key:&quot;), false);
+            else
+                m_gpg-&gt;setText(i18n(&quot;Please enter the password for the basket &lt;b&gt;%1&lt;/b&gt;:&quot;, basketName()), false); // Used when decrypting
+            return m_gpg-&gt;decrypt(tmp, array);
+        }
 #else
-		if(encrypted)
-		{
-			return false;
-		}
+        if (encrypted) {
+            return false;
+        }
 #endif
-		return true;
-	} else
-		return false;
+        return true;
+    } else
+        return false;
 }
 
 bool Basket::saveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding)
 {
-	QByteArray bytes = (isLocalEncoding ? string.toLocal8Bit() : string.toUtf8());
-	return saveToFile(fullPath, bytes, bytes.length());
+    QByteArray bytes = (isLocalEncoding ? string.toLocal8Bit() : string.toUtf8());
+    return saveToFile(fullPath, bytes, bytes.length());
 }
 
 bool Basket::saveToFile(const QString&amp; fullPath, const QByteArray&amp; array)
 {
-	return saveToFile(fullPath, array, array.size());
+    return saveToFile(fullPath, array, array.size());
 }
 
 bool Basket::saveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsigned long length)
 {
-	bool success = true;
-	QByteArray tmp;
+    bool success = true;
+    QByteArray tmp;
 
 #ifdef HAVE_LIBGPGME
-	if(isEncrypted())
-	{
-		QString key = QString::null;
-
-		// We only use gpg-agent for private key encryption and saving without
-		// public key doesn't need one.
-		m_gpg-&gt;setUseGnuPGAgent(false);
-		if(m_encryptionType == PrivateKeyEncryption)
-		{
-			key = m_encryptionKey;
-			// public key doesn't need password
-			m_gpg-&gt;setText(&quot;&quot;, false);
-		}
-		else
-			m_gpg-&gt;setText(i18n(&quot;Please assign a password to the basket &lt;b&gt;%1&lt;/b&gt;:&quot;, basketName()), true); // Used when defining a new password
-
-		success = m_gpg-&gt;encrypt(array, length, &amp;tmp, key);
-		length = tmp.size();
-	}
-	else
-		tmp = array;
+    if (isEncrypted()) {
+        QString key = QString::null;
+
+        // We only use gpg-agent for private key encryption and saving without
+        // public key doesn't need one.
+        m_gpg-&gt;setUseGnuPGAgent(false);
+        if (m_encryptionType == PrivateKeyEncryption) {
+            key = m_encryptionKey;
+            // public key doesn't need password
+            m_gpg-&gt;setText(&quot;&quot;, false);
+        } else
+            m_gpg-&gt;setText(i18n(&quot;Please assign a password to the basket &lt;b&gt;%1&lt;/b&gt;:&quot;, basketName()), true); // Used when defining a new password
+
+        success = m_gpg-&gt;encrypt(array, length, &amp;tmp, key);
+        length = tmp.size();
+    } else
+        tmp = array;
 
 #else
-	success = !isEncrypted();
-	if(success)
-		tmp = array;
+    success = !isEncrypted();
+    if (success)
+        tmp = array;
 #endif
-	/*if (success &amp;&amp; (success = file.open(QIODevice::WriteOnly))){
-		success = (file.write(tmp) == (Q_LONG)tmp.size());
-		file.close();
-	}*/
+    /*if (success &amp;&amp; (success = file.open(QIODevice::WriteOnly))){
+        success = (file.write(tmp) == (Q_LONG)tmp.size());
+        file.close();
+    }*/
 
-	if (success)
-		return safelySaveToFile(fullPath, tmp, length);
-	else
-		return false;
+    if (success)
+        return safelySaveToFile(fullPath, tmp, length);
+    else
+        return false;
 }
 
 /**
@@ -5426,8 +5409,8 @@ bool Basket::saveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsign
  * instead.
  */
 /*static*/ bool Basket::safelySaveToFile(const QString&amp; fullPath,
-                                         const QByteArray&amp; array,
-                                         unsigned long length)
+        const QByteArray&amp; array,
+        unsigned long length)
 {
     // Modulus operandi:
     // 1. Use KSaveFile to try and save the file
@@ -5476,39 +5459,39 @@ bool Basket::saveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsign
 
 /*static*/ bool Basket::safelySaveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding)
 {
-	QByteArray bytes = (isLocalEncoding ? string.toLocal8Bit() : string.toUtf8());
-	return safelySaveToFile(fullPath, bytes, bytes.length() - 1);
+    QByteArray bytes = (isLocalEncoding ? string.toLocal8Bit() : string.toUtf8());
+    return safelySaveToFile(fullPath, bytes, bytes.length() - 1);
 }
 
 /*static*/ bool Basket::safelySaveToFile(const QString&amp; fullPath, const QByteArray&amp; array)
 {
-	return safelySaveToFile(fullPath, array, array.size());
+    return safelySaveToFile(fullPath, array, array.size());
 }
 
 DiskErrorDialog::DiskErrorDialog(const QString &amp;titleMessage, const QString &amp;message, QWidget *parent)
-     : KDialog(parent)
-{
-	setObjectName(&quot;DiskError&quot;);
-	setCaption(i18n(&quot;Save Error&quot;));
-	setMainWidget(new QWidget(this));
-	//enableButtonCancel(false);
-	//enableButtonClose(false);
-	//enableButton(Close, false);
-	//enableButtonOk(false);
-	setModal(true);
-	//QHBoxLayout *layout = new QHBoxLayout(mainWidget(), /*margin=*/0, spacingHint());
-	QHBoxLayout *layout = new QHBoxLayout(mainWidget());
-	QPixmap icon = KIconLoader::global()-&gt;loadIcon(
-        &quot;hdd_unmount&quot;, KIconLoader::NoGroup, 64, KIconLoader::DefaultState,
-        QStringList(), /*path_store=*/0L, /*canReturnNull=*/true
-        );
-	QLabel *iconLabel  = new QLabel(mainWidget());
-	iconLabel-&gt;setPixmap(icon);
-	iconLabel-&gt;setFixedSize(iconLabel-&gt;sizeHint());
-	QLabel *label = new QLabel(&quot;&lt;p&gt;&lt;nobr&gt;&lt;b&gt;&lt;font size='+1'&gt;&quot; + titleMessage + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/nobr&gt;&lt;/p&gt;&lt;p&gt;&quot; + message + &quot;&lt;/p&gt;&quot;, mainWidget());
-	if (!icon.isNull())
-		layout-&gt;addWidget(iconLabel);
-	layout-&gt;addWidget(label);
+        : KDialog(parent)
+{
+    setObjectName(&quot;DiskError&quot;);
+    setCaption(i18n(&quot;Save Error&quot;));
+    setMainWidget(new QWidget(this));
+    //enableButtonCancel(false);
+    //enableButtonClose(false);
+    //enableButton(Close, false);
+    //enableButtonOk(false);
+    setModal(true);
+    //QHBoxLayout *layout = new QHBoxLayout(mainWidget(), /*margin=*/0, spacingHint());
+    QHBoxLayout *layout = new QHBoxLayout(mainWidget());
+    QPixmap icon = KIconLoader::global()-&gt;loadIcon(
+                       &quot;hdd_unmount&quot;, KIconLoader::NoGroup, 64, KIconLoader::DefaultState,
+                       QStringList(), /*path_store=*/0L, /*canReturnNull=*/true
+                   );
+    QLabel *iconLabel  = new QLabel(mainWidget());
+    iconLabel-&gt;setPixmap(icon);
+    iconLabel-&gt;setFixedSize(iconLabel-&gt;sizeHint());
+    QLabel *label = new QLabel(&quot;&lt;p&gt;&lt;nobr&gt;&lt;b&gt;&lt;font size='+1'&gt;&quot; + titleMessage + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/nobr&gt;&lt;/p&gt;&lt;p&gt;&quot; + message + &quot;&lt;/p&gt;&quot;, mainWidget());
+    if (!icon.isNull())
+        layout-&gt;addWidget(iconLabel);
+    layout-&gt;addWidget(label);
 }
 
 DiskErrorDialog::~DiskErrorDialog()
@@ -5517,24 +5500,24 @@ DiskErrorDialog::~DiskErrorDialog()
 
 void DiskErrorDialog::closeEvent(QCloseEvent *event)
 {
-	event-&gt;ignore();
+    event-&gt;ignore();
 }
 
 void DiskErrorDialog::keyPressEvent(QKeyEvent*)
 {
-	// Escape should not close the window...
+    // Escape should not close the window...
 }
 
 void Basket::lock()
 {
 #ifdef HAVE_LIBGPGME
-	closeEditor();
-	m_gpg-&gt;clearCache();
-	m_locked = true;
-	enableActions();
-	deleteNotes();
-	m_loaded = false;
-	m_loadingLaunched = false;
-	updateContents();
+    closeEditor();
+    m_gpg-&gt;clearCache();
+    m_locked = true;
+    enableActions();
+    deleteNotes();
+    m_loaded = false;
+    m_loadingLaunched = false;
+    updateContents();
 #endif
 }</diff>
      <filename>src/basket.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -74,13 +74,13 @@ class KGpgMe;
   */
 class DiskErrorDialog : public KDialog
 {
-  Q_OBJECT
-  public:
-	DiskErrorDialog(const QString &amp;titleMessage, const QString &amp;message, QWidget *parent = 0);
-	~DiskErrorDialog();
-  protected:
-	void closeEvent(QCloseEvent *event);
-	void keyPressEvent(QKeyEvent*);
+    Q_OBJECT
+public:
+    DiskErrorDialog(const QString &amp;titleMessage, const QString &amp;message, QWidget *parent = 0);
+    ~DiskErrorDialog();
+protected:
+    void closeEvent(QCloseEvent *event);
+    void keyPressEvent(QKeyEvent*);
 };
 
 
@@ -90,12 +90,12 @@ class DiskErrorDialog : public KDialog
   */
 namespace PlugOptions
 {
-	enum Flags {
-		SelectOnlyNewNotes = 0x01, /// &lt;&lt; Unselect every notes in the basket and select the newly inserted ones
-		DoTagsInheriting   = 0x02  /// &lt;&lt; The new notes inherit the tags of the sibbling note
-	};
-	// TODO: FocusLastInsertedNote (last visible!), EnsureVisibleAddedNotes, PopupFeebackBaloon (if not called by hand), AnimateNewPosition, FeedbackUnmatched
-	// TODO: moveNoteInTree(bool animate);
+enum Flags {
+    SelectOnlyNewNotes = 0x01, /// &lt;&lt; Unselect every notes in the basket and select the newly inserted ones
+    DoTagsInheriting   = 0x02  /// &lt;&lt; The new notes inherit the tags of the sibbling note
+};
+// TODO: FocusLastInsertedNote (last visible!), EnsureVisibleAddedNotes, PopupFeebackBaloon (if not called by hand), AnimateNewPosition, FeedbackUnmatched
+// TODO: moveNoteInTree(bool animate);
 }
 
 /** This represent a hierarchy of the selected classes.
@@ -103,38 +103,38 @@ namespace PlugOptions
   */
 class NoteSelection
 {
-  public:
-	NoteSelection()        : note(0), parent(0), firstChild(0), next(0), fullPath() {}
-	NoteSelection(Note *n) : note(n), parent(0), firstChild(0), next(0), fullPath() {}
-
-	Note          *note;
-	NoteSelection *parent;
-	NoteSelection *firstChild;
-	NoteSelection *next;
-	QString        fullPath; // Needeed for 'Cut' code to store temporary path of the cutted note.
-
-	NoteSelection* firstStacked();
-	NoteSelection* nextStacked();
-	void append(NoteSelection *node);
-	int count();
-
-	QList&lt;Note*&gt; parentGroups();
+public:
+    NoteSelection()        : note(0), parent(0), firstChild(0), next(0), fullPath() {}
+    NoteSelection(Note *n) : note(n), parent(0), firstChild(0), next(0), fullPath() {}
+
+    Note          *note;
+    NoteSelection *parent;
+    NoteSelection *firstChild;
+    NoteSelection *next;
+    QString        fullPath; // Needeed for 'Cut' code to store temporary path of the cutted note.
+
+    NoteSelection* firstStacked();
+    NoteSelection* nextStacked();
+    void append(NoteSelection *node);
+    int count();
+
+    QList&lt;Note*&gt; parentGroups();
 };
 
 /** This store all needed information when exporting to HTML
   */
 class HtmlExportData
 {
-  public:
-	QString iconsFolderPath;
-	QString iconsFolderName;
-	QString imagesFolderPath;
-	QString imagesFolderName;
-	QString dataFolderPath;
-	QString dataFolderName;
-	bool    formatForImpression;
-	bool    embedLinkedFiles;
-	bool    embedLinkedFolders;
+public:
+    QString iconsFolderPath;
+    QString iconsFolderName;
+    QString imagesFolderPath;
+    QString imagesFolderName;
+    QString dataFolderPath;
+    QString dataFolderName;
+    bool    formatForImpression;
+    bool    embedLinkedFiles;
+    bool    embedLinkedFolders;
 };
 
 /** This class handle Basket and add a FilterWidget on top of it.
@@ -142,38 +142,46 @@ class HtmlExportData
   */
 class DecoratedBasket : public QWidget
 {
-  Q_OBJECT
-  public:
-	DecoratedBasket(QWidget *parent, const QString &amp;folderName, Qt::WFlags fl = 0);
-	~DecoratedBasket();
-	void setFilterBarPosition(bool onTop);
-	void resetFilter();
-	void setFilterBarVisible(bool show, bool switchFocus = true);
-	bool isFilterBarVisible()        { return m_filter-&gt;isVisible();    }
-	const FilterData&amp; filterData() { return m_filter-&gt;filterData(); }
-	FilterBar* filterBar()         { return m_filter;               }
-	Basket*    basket()            { return m_basket;               }
-  private:
-	QVBoxLayout *m_layout;
-	FilterBar   *m_filter;
-	Basket      *m_basket;
+    Q_OBJECT
+public:
+    DecoratedBasket(QWidget *parent, const QString &amp;folderName, Qt::WFlags fl = 0);
+    ~DecoratedBasket();
+    void setFilterBarPosition(bool onTop);
+    void resetFilter();
+    void setFilterBarVisible(bool show, bool switchFocus = true);
+    bool isFilterBarVisible()        {
+        return m_filter-&gt;isVisible();
+    }
+    const FilterData&amp; filterData() {
+        return m_filter-&gt;filterData();
+    }
+    FilterBar* filterBar()         {
+        return m_filter;
+    }
+    Basket*    basket()            {
+        return m_basket;
+    }
+private:
+    QVBoxLayout *m_layout;
+    FilterBar   *m_filter;
+    Basket      *m_basket;
 };
 
 class TransparentWidget : public QWidget
 {
-  Q_OBJECT
-  public:
-	TransparentWidget(Basket *basket);
-	void setPosition(int x, int y);
-	//void reparent(QWidget *parent, Qt::WFlags f, const QPoint &amp;p, bool showIt = FALSE);
-  protected:
-	void paintEvent(QPaintEvent*);
-	void mouseMoveEvent(QMouseEvent *event);
-	bool eventFilter(QObject *object, QEvent *event);
-  private:
-	Basket *m_basket;
-	int     m_x;
-	int     m_y;
+    Q_OBJECT
+public:
+    TransparentWidget(Basket *basket);
+    void setPosition(int x, int y);
+    //void reparent(QWidget *parent, Qt::WFlags f, const QPoint &amp;p, bool showIt = FALSE);
+protected:
+    void paintEvent(QPaintEvent*);
+    void mouseMoveEvent(QMouseEvent *event);
+    bool eventFilter(QObject *object, QEvent *event);
+private:
+    Basket *m_basket;
+    int     m_x;
+    int     m_y;
 };
 
 /**
@@ -182,516 +190,598 @@ class TransparentWidget : public QWidget
 class Basket : public Q3ScrollView
 {
 /// CONSTRUCTOR AND DESTRUCTOR:
-  Q_OBJECT
-	public:
-		enum EncryptionTypes {
-			NoEncryption         = 0,
-			PasswordEncryption   = 1,
-			PrivateKeyEncryption = 2
-		};
-
-	public:
-	Basket(QWidget *parent, const QString &amp;folderName);
-	~Basket();
+    Q_OBJECT
+public:
+    enum EncryptionTypes {
+        NoEncryption         = 0,
+        PasswordEncryption   = 1,
+        PrivateKeyEncryption = 2
+    };
+
+public:
+    Basket(QWidget *parent, const QString &amp;folderName);
+    ~Basket();
 
 /// USER INTERACTION:
-  private:
-	bool   m_noActionOnMouseRelease;
-	bool   m_ignoreCloseEditorOnNextMouseRelease;
-	QPoint m_pressPos;
-	bool   m_canDrag;
-  public:
-	void viewportResizeEvent(QResizeEvent *);
-	void drawContents(QPainter *painter);
-	void drawContents(QPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight);
-	void enterEvent(QEvent *);
-	void leaveEvent(QEvent *);
-	void contentsMouseMoveEvent(QMouseEvent *event);
-	void contentsMousePressEvent(QMouseEvent *event);
-	void contentsMouseReleaseEvent(QMouseEvent *event);
-	void contentsMouseDoubleClickEvent(QMouseEvent *event);
-	void contentsContextMenuEvent(QContextMenuEvent *event);
-	void updateNote(Note *note);
-	void clickedToInsert(QMouseEvent *event, Note *clicked = 0, int zone = 0);
-  private slots:
-	void setFocusIfNotInPopupMenu();
+private:
+    bool   m_noActionOnMouseRelease;
+    bool   m_ignoreCloseEditorOnNextMouseRelease;
+    QPoint m_pressPos;
+    bool   m_canDrag;
+public:
+    void viewportResizeEvent(QResizeEvent *);
+    void drawContents(QPainter *painter);
+    void drawContents(QPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight);
+    void enterEvent(QEvent *);
+    void leaveEvent(QEvent *);
+    void contentsMouseMoveEvent(QMouseEvent *event);
+    void contentsMousePressEvent(QMouseEvent *event);
+    void contentsMouseReleaseEvent(QMouseEvent *event);
+    void contentsMouseDoubleClickEvent(QMouseEvent *event);
+    void contentsContextMenuEvent(QContextMenuEvent *event);
+    void updateNote(Note *note);
+    void clickedToInsert(QMouseEvent *event, Note *clicked = 0, int zone = 0);
+private slots:
+    void setFocusIfNotInPopupMenu();
 
 /// LAYOUT:
-  private:
-	Note   *m_firstNote;
-	int     m_columnsCount;
-	bool    m_mindMap;
-	Note   *m_resizingNote;
-	int     m_pickedResizer;
-	Note   *m_movingNote;
-	QPoint  m_pickedHandle;
-  public:
-	int tmpWidth;
-	int tmpHeight;
-  public:
-	void unsetNotesWidth();
-	void relayoutNotes(bool animate);
-	Note* noteAt(int x, int y);
-	inline Note* firstNote()       { return m_firstNote;                 }
-	inline int   columnsCount()    { return m_columnsCount;              }
-	inline bool  isColumnsLayout() { return m_columnsCount &gt; 0;          }
-	inline bool  isFreeLayout()    { return m_columnsCount &lt;= 0;         }
-	inline bool  isMindMap()       { return isFreeLayout() &amp;&amp; m_mindMap; }
-	Note* resizingNote()           { return m_resizingNote;              }
-	void  deleteNotes();
-	Note* lastNote();
-	void setDisposition(int disposition, int columnCount);
-	void equalizeColumnSizes();
+private:
+    Note   *m_firstNote;
+    int     m_columnsCount;
+    bool    m_mindMap;
+    Note   *m_resizingNote;
+    int     m_pickedResizer;
+    Note   *m_movingNote;
+    QPoint  m_pickedHandle;
+public:
+    int tmpWidth;
+    int tmpHeight;
+public:
+    void unsetNotesWidth();
+    void relayoutNotes(bool animate);
+    Note* noteAt(int x, int y);
+    inline Note* firstNote()       {
+        return m_firstNote;
+    }
+    inline int   columnsCount()    {
+        return m_columnsCount;
+    }
+    inline bool  isColumnsLayout() {
+        return m_columnsCount &gt; 0;
+    }
+    inline bool  isFreeLayout()    {
+        return m_columnsCount &lt;= 0;
+    }
+    inline bool  isMindMap()       {
+        return isFreeLayout() &amp;&amp; m_mindMap;
+    }
+    Note* resizingNote()           {
+        return m_resizingNote;
+    }
+    void  deleteNotes();
+    Note* lastNote();
+    void setDisposition(int disposition, int columnCount);
+    void equalizeColumnSizes();
 
 /// NOTES INSERTION AND REMOVAL:
-  public:
-	/// The following methods assume that the note(s) to insert already all have 'this' as the parent basket:
-	void prependNoteIn(   Note *note, Note *in);     /// &lt;&lt; Add @p note (and the next linked notes) as the first note(s) of the group @p in.
-	void appendNoteIn(    Note *note, Note *in);     /// &lt;&lt; Add @p note (and the next linked notes) as the last note(s) of the group @p in.
-	void appendNoteAfter( Note *note, Note *after);  /// &lt;&lt; Add @p note (and the next linked notes) just after (just below) the note @p after.
-	void appendNoteBefore(Note *note, Note *before); /// &lt;&lt; Add @p note (and the next linked notes) just before (just above) the note @p before.
-	void groupNoteAfter(  Note *note, Note *with);   /// &lt;&lt; Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just after the group.
-	void groupNoteBefore( Note *note, Note *with);   /// &lt;&lt; Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just before the group.
-	void unplugNote(      Note *note);               /// &lt;&lt; Unplug @p note (and its child notes) from the basket (and also decrease counts...).
-	                                                 /// &lt;&lt;  After that, you should delete the notes yourself. Do not call prepend/append/group... functions two times: unplug and ok
-	void ungroupNote(     Note *group);              /// &lt;&lt; Unplug @p group but put child notes at its place.
-	/// And this one do almost all the above methods depending on the context:
-	void insertNote(Note *note, Note *clicked, int zone, const QPoint &amp;pos = QPoint(), bool animateNewPosition = false);
-	void insertCreatedNote(Note *note);
-	/// And working with selections:
-	void unplugSelection(NoteSelection *selection);
-	void insertSelection(NoteSelection *selection, Note *after);
-	void selectSelection(NoteSelection *selection);
-  private:
-	void preparePlug(Note *note);
-  private:
-	Note  *m_clickedToInsert;
-	int    m_zoneToInsert;
-	QPoint m_posToInsert;
-	Note  *m_savedClickedToInsert;
-	int    m_savedZoneToInsert;
-	QPoint m_savedPosToInsert;
-	bool   m_isInsertPopupMenu;
+public:
+    /// The following methods assume that the note(s) to insert already all have 'this' as the parent basket:
+    void prependNoteIn(Note *note, Note *in);        /// &lt;&lt; Add @p note (and the next linked notes) as the first note(s) of the group @p in.
+    void appendNoteIn(Note *note, Note *in);         /// &lt;&lt; Add @p note (and the next linked notes) as the last note(s) of the group @p in.
+    void appendNoteAfter(Note *note, Note *after);   /// &lt;&lt; Add @p note (and the next linked notes) just after (just below) the note @p after.
+    void appendNoteBefore(Note *note, Note *before); /// &lt;&lt; Add @p note (and the next linked notes) just before (just above) the note @p before.
+    void groupNoteAfter(Note *note, Note *with);     /// &lt;&lt; Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just after the group.
+    void groupNoteBefore(Note *note, Note *with);    /// &lt;&lt; Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just before the group.
+    void unplugNote(Note *note);                     /// &lt;&lt; Unplug @p note (and its child notes) from the basket (and also decrease counts...).
+    /// &lt;&lt;  After that, you should delete the notes yourself. Do not call prepend/append/group... functions two times: unplug and ok
+    void ungroupNote(Note *group);                   /// &lt;&lt; Unplug @p group but put child notes at its place.
+    /// And this one do almost all the above methods depending on the context:
+    void insertNote(Note *note, Note *clicked, int zone, const QPoint &amp;pos = QPoint(), bool animateNewPosition = false);
+    void insertCreatedNote(Note *note);
+    /// And working with selections:
+    void unplugSelection(NoteSelection *selection);
+    void insertSelection(NoteSelection *selection, Note *after);
+    void selectSelection(NoteSelection *selection);
+private:
+    void preparePlug(Note *note);
+private:
+    Note  *m_clickedToInsert;
+    int    m_zoneToInsert;
+    QPoint m_posToInsert;
+    Note  *m_savedClickedToInsert;
+    int    m_savedZoneToInsert;
+    QPoint m_savedPosToInsert;
+    bool   m_isInsertPopupMenu;
     QAction *m_insertMenuTitle;
-  public:
-	void saveInsertionData();
-	void restoreInsertionData();
-	void resetInsertionData();
-  public slots:
-	void insertEmptyNote(int type);
-	void insertWizard(int type);
-	void insertColor(const QColor &amp;color);
-	void insertImage(const QPixmap &amp;image);
-	void pasteNote(QClipboard::Mode mode = QClipboard::Clipboard);
-	void delayedCancelInsertPopupMenu();
-	void setInsertPopupMenu()    { m_isInsertPopupMenu = true;  }
-	void cancelInsertPopupMenu() { m_isInsertPopupMenu = false; }
-  private slots:
-	void hideInsertPopupMenu();
-	void timeoutHideInsertPopupMenu();
+public:
+    void saveInsertionData();
+    void restoreInsertionData();
+    void resetInsertionData();
+public slots:
+    void insertEmptyNote(int type);
+    void insertWizard(int type);
+    void insertColor(const QColor &amp;color);
+    void insertImage(const QPixmap &amp;image);
+    void pasteNote(QClipboard::Mode mode = QClipboard::Clipboard);
+    void delayedCancelInsertPopupMenu();
+    void setInsertPopupMenu()    {
+        m_isInsertPopupMenu = true;
+    }
+    void cancelInsertPopupMenu() {
+        m_isInsertPopupMenu = false;
+    }
+private slots:
+    void hideInsertPopupMenu();
+    void timeoutHideInsertPopupMenu();
 
 /// TOOL TIPS:
-  protected:
+protected:
     bool event(QEvent *event);
     // TODO: replace with QGraphicsScene::helpEvent()
     void tooltipEvent(QHelpEvent *event);
 
 /// ANIMATIONS:
-  private:
-	QList&lt;Note*&gt; m_animatedNotes;
-	QTimer            m_animationTimer;
-	int               m_deltaY;
-	QTime             m_lastFrameTime;
-	static const int FRAME_DELAY;
-  private slots:
-	void animateObjects();
-  public slots:
-	void animateLoad();
-  public:
-	void addAnimatedNote(Note *note);
+private:
+    QList&lt;Note*&gt; m_animatedNotes;
+    QTimer            m_animationTimer;
+    int               m_deltaY;
+    QTime             m_lastFrameTime;
+    static const int FRAME_DELAY;
+private slots:
+    void animateObjects();
+public slots:
+    void animateLoad();
+public:
+    void addAnimatedNote(Note *note);
 
 /// LOAD AND SAVE:
-  private:
-	bool m_loaded;
-	bool m_loadingLaunched;
-	bool m_locked;
-	bool m_shouldConvertPlainTextNotes;
-	QFrame* m_decryptBox;
-	QPushButton* m_button;
-	int m_encryptionType;
-	QString m_encryptionKey;
+private:
+    bool m_loaded;
+    bool m_loadingLaunched;
+    bool m_locked;
+    bool m_shouldConvertPlainTextNotes;
+    QFrame* m_decryptBox;
+    QPushButton* m_button;
+    int m_encryptionType;
+    QString m_encryptionKey;
 #ifdef HAVE_LIBGPGME
-	KGpgMe* m_gpg;
+    KGpgMe* m_gpg;
 #endif
-        QTimer      m_inactivityAutoLockTimer;
-        void enableActions();
+    QTimer      m_inactivityAutoLockTimer;
+    void enableActions();
 
-  private slots:
-	void loadNotes(const QDomElement &amp;notes, Note *parent);
-	void saveNotes(QDomDocument &amp;document, QDomElement &amp;element, Note *parent);
-	void unlock();
+private slots:
+    void loadNotes(const QDomElement &amp;notes, Note *parent);
+    void saveNotes(QDomDocument &amp;document, QDomElement &amp;element, Note *parent);
+    void unlock();
 protected slots:
-        void inactivityAutoLockTimeout();
+    void inactivityAutoLockTimeout();
 public slots:
-	void load();
-	void loadProperties(const QDomElement &amp;properties);
-	void saveProperties(QDomDocument &amp;document, QDomElement &amp;properties);
-	bool save();
-	void reload();
-  public:
-	bool isEncrypted();
-	bool isFileEncrypted();
-	bool isLocked()        { return m_locked;          };
-	void lock();
-	bool isLoaded()        { return m_loaded;          };
-	bool loadingLaunched() { return m_loadingLaunched; };
-	bool loadFromFile(const QString &amp;fullPath, QString* string, bool isLocalEncoding = false);
-	bool loadFromFile(const QString &amp;fullPath, QByteArray* array);
-	bool saveToFile(const QString&amp; fullPath, const QByteArray&amp; array);
-	bool saveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsigned long length);
-	bool saveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding = false);
-	static bool safelySaveToFile(const QString&amp; fullPath, const QByteArray&amp; array);
-	static bool safelySaveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsigned long length);
-	static bool safelySaveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding = false);
-	bool setProtection(int type, QString key);
-	int  encryptionType()  { return m_encryptionType;  };
-	QString encryptionKey(){ return m_encryptionKey;   };
-	bool saveAgain();
+    void load();
+    void loadProperties(const QDomElement &amp;properties);
+    void saveProperties(QDomDocument &amp;document, QDomElement &amp;properties);
+    bool save();
+    void reload();
+public:
+    bool isEncrypted();
+    bool isFileEncrypted();
+    bool isLocked()        {
+        return m_locked;
+    };
+    void lock();
+    bool isLoaded()        {
+        return m_loaded;
+    };
+    bool loadingLaunched() {
+        return m_loadingLaunched;
+    };
+    bool loadFromFile(const QString &amp;fullPath, QString* string, bool isLocalEncoding = false);
+    bool loadFromFile(const QString &amp;fullPath, QByteArray* array);
+    bool saveToFile(const QString&amp; fullPath, const QByteArray&amp; array);
+    bool saveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsigned long length);
+    bool saveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding = false);
+    static bool safelySaveToFile(const QString&amp; fullPath, const QByteArray&amp; array);
+    static bool safelySaveToFile(const QString&amp; fullPath, const QByteArray&amp; array, unsigned long length);
+    static bool safelySaveToFile(const QString&amp; fullPath, const QString&amp; string, bool isLocalEncoding = false);
+    bool setProtection(int type, QString key);
+    int  encryptionType()  {
+        return m_encryptionType;
+    };
+    QString encryptionKey() {
+        return m_encryptionKey;
+    };
+    bool saveAgain();
 
 /// BACKGROUND:
-  private:
-	QColor   m_backgroundColorSetting;
-	QString  m_backgroundImageName;
-	QPixmap *m_backgroundPixmap;
-	QPixmap *m_opaqueBackgroundPixmap;
-	QPixmap *m_selectedBackgroundPixmap;
-	bool     m_backgroundTiled;
-	QColor   m_textColorSetting;
-  public:
-	inline bool           hasBackgroundImage()     { return m_backgroundPixmap != 0;  }
-	inline const QPixmap* backgroundPixmap()       { return m_backgroundPixmap;       }
-	inline bool           isTiledBackground()      { return m_backgroundTiled;        }
-	inline QString        backgroundImageName()    { return m_backgroundImageName;    }
-	inline QColor         backgroundColorSetting() { return m_backgroundColorSetting; }
-	inline QColor         textColorSetting()       { return m_textColorSetting;       }
-	QColor backgroundColor();
-	QColor textColor();
-	void setAppearance(const QString &amp;icon, const QString &amp;name, const QString &amp;backgroundImage, const QColor &amp;backgroundColor, const QColor &amp;textColor);
-	void blendBackground(QPainter &amp;painter, const QRect &amp;rect, int xPainter = -1, int yPainter = -1, bool opaque = false, QPixmap *bg = 0);
-	void unbufferizeAll();
-	void subscribeBackgroundImages();
-	void unsubscribeBackgroundImages();
+private:
+    QColor   m_backgroundColorSetting;
+    QString  m_backgroundImageName;
+    QPixmap *m_backgroundPixmap;
+    QPixmap *m_opaqueBackgroundPixmap;
+    QPixmap *m_selectedBackgroundPixmap;
+    bool     m_backgroundTiled;
+    QColor   m_textColorSetting;
+public:
+    inline bool           hasBackgroundImage()     {
+        return m_backgroundPixmap != 0;
+    }
+    inline const QPixmap* backgroundPixmap()       {
+        return m_backgroundPixmap;
+    }
+    inline bool           isTiledBackground()      {
+        return m_backgroundTiled;
+    }
+    inline QString        backgroundImageName()    {
+        return m_backgroundImageName;
+    }
+    inline QColor         backgroundColorSetting() {
+        return m_backgroundColorSetting;
+    }
+    inline QColor         textColorSetting()       {
+        return m_textColorSetting;
+    }
+    QColor backgroundColor();
+    QColor textColor();
+    void setAppearance(const QString &amp;icon, const QString &amp;name, const QString &amp;backgroundImage, const QColor &amp;backgroundColor, const QColor &amp;textColor);
+    void blendBackground(QPainter &amp;painter, const QRect &amp;rect, int xPainter = -1, int yPainter = -1, bool opaque = false, QPixmap *bg = 0);
+    void unbufferizeAll();
+    void subscribeBackgroundImages();
+    void unsubscribeBackgroundImages();
 
 /// KEYBOARD SHORTCUT:
-  public:
-	KAction *m_action;
-  private:
-	int      m_shortcutAction;
-  private slots:
-	void activatedShortcut();
-  public:
-	KShortcut shortcut() { return m_action-&gt;shortcut(); }
-	int shortcutAction() { return m_shortcutAction;     }
-	void setShortcut(KShortcut shortcut, int action);
+public:
+    KAction *m_action;
+private:
+    int      m_shortcutAction;
+private slots:
+    void activatedShortcut();
+public:
+    KShortcut shortcut() {
+        return m_action-&gt;shortcut();
+    }
+    int shortcutAction() {
+        return m_shortcutAction;
+    }
+    void setShortcut(KShortcut shortcut, int action);
 
 /// USER INTERACTION:
-  private:
-	Note  *m_hoveredNote;
-	int    m_hoveredZone;
-	bool   m_lockedHovering;
-	bool   m_underMouse;
-	QRect  m_inserterRect;
-	bool   m_inserterShown;
-	bool   m_inserterSplit;
-	bool   m_inserterTop;
-	bool   m_inserterGroup;
-	void placeInserter(Note *note, int zone);
-	void removeInserter();
-  public:
-//	bool inserterShown() { return m_inserterShown; }
-	bool inserterSplit() { return m_inserterSplit; }
-	bool inserterGroup() { return m_inserterGroup; }
-  public slots:
-	void doHoverEffects(Note *note, Note::Zone zone, const QPoint &amp;pos = QPoint(0, 0)); /// &lt;&lt; @p pos is optionnal and only used to show the link target in the statusbar
-	void doHoverEffects(const QPoint &amp;pos);
-	void doHoverEffects(); // The same, but using the current cursor position
-	void mouseEnteredEditorWidget();
-  public:
-	void popupTagsMenu(Note *note);
-	void popupEmblemMenu(Note *note, int emblemNumber);
-	void addTagToSelectedNotes(Tag *tag);
-	void removeTagFromSelectedNotes(Tag *tag);
-	void removeAllTagsFromSelectedNotes();
-	void addStateToSelectedNotes(State *state);
-	void changeStateOfSelectedNotes(State *state);
-	bool selectedNotesHaveTags();
-	const QRect&amp; inserterRect()  { return m_inserterRect;  }
-	bool         inserterShown() { return m_inserterShown; }
-	void drawInserter(QPainter &amp;painter, int xPainter, int yPainter);
-	DecoratedBasket* decoration();
-	State *stateForTagFromSelectedNotes(Tag *tag);
-  public slots:
-	void activatedTagShortcut(Tag *tag);
-	void recomputeAllStyles();
-	void removedStates(const QList&lt;State*&gt; &amp;deletedStates);
-  private slots:
-	void toggledTagInMenu(QAction *act);
-	void toggledStateInMenu(QAction *act);
-	void unlockHovering();
-	void disableNextClick();
-	void contentsMoved();
-  public:
-	Note  *m_tagPopupNote;
-  private:
-	Tag   *m_tagPopup;
-	QTime  m_lastDisableClick;
+private:
+    Note  *m_hoveredNote;
+    int    m_hoveredZone;
+    bool   m_lockedHovering;
+    bool   m_underMouse;
+    QRect  m_inserterRect;
+    bool   m_inserterShown;
+    bool   m_inserterSplit;
+    bool   m_inserterTop;
+    bool   m_inserterGroup;
+    void placeInserter(Note *note, int zone);
+    void removeInserter();
+public:
+//  bool inserterShown() { return m_inserterShown; }
+    bool inserterSplit() {
+        return m_inserterSplit;
+    }
+    bool inserterGroup() {
+        return m_inserterGroup;
+    }
+public slots:
+    void doHoverEffects(Note *note, Note::Zone zone, const QPoint &amp;pos = QPoint(0, 0)); /// &lt;&lt; @p pos is optionnal and only used to show the link target in the statusbar
+    void doHoverEffects(const QPoint &amp;pos);
+    void doHoverEffects(); // The same, but using the current cursor position
+    void mouseEnteredEditorWidget();
+public:
+    void popupTagsMenu(Note *note);
+    void popupEmblemMenu(Note *note, int emblemNumber);
+    void addTagToSelectedNotes(Tag *tag);
+    void removeTagFromSelectedNotes(Tag *tag);
+    void removeAllTagsFromSelectedNotes();
+    void addStateToSelectedNotes(State *state);
+    void changeStateOfSelectedNotes(State *state);
+    bool selectedNotesHaveTags();
+    const QRect&amp; inserterRect()  {
+        return m_inserterRect;
+    }
+    bool         inserterShown() {
+        return m_inserterShown;
+    }
+    void drawInserter(QPainter &amp;painter, int xPainter, int yPainter);
+    DecoratedBasket* decoration();
+    State *stateForTagFromSelectedNotes(Tag *tag);
+public slots:
+    void activatedTagShortcut(Tag *tag);
+    void recomputeAllStyles();
+    void removedStates(const QList&lt;State*&gt; &amp;deletedStates);
+private slots:
+    void toggledTagInMenu(QAction *act);
+    void toggledStateInMenu(QAction *act);
+    void unlockHovering();
+    void disableNextClick();
+    void contentsMoved();
+public:
+    Note  *m_tagPopupNote;
+private:
+    Tag   *m_tagPopup;
+    QTime  m_lastDisableClick;
 
 /// SELECTION:
-  private:
-	bool   m_isSelecting;
-	bool   m_selectionStarted;
-	bool   m_selectionInvert;
-	QPoint m_selectionBeginPoint;
-	QPoint m_selectionEndPoint;
-	QRect  m_selectionRect;
-	QTimer m_autoScrollSelectionTimer;
-	void stopAutoScrollSelection();
-  private slots:
-	void doAutoScrollSelection();
-  public:
-	inline bool isSelecting() { return m_isSelecting; }
-	inline const QRect&amp; selectionRect() { return m_selectionRect; }
-	void selectNotesIn(const QRect &amp;rect, bool invertSelection, bool unselectOthers = true);
-	void resetWasInLastSelectionRect();
-	void selectAll();
-	void unselectAll();
-	void invertSelection();
-	void unselectAllBut(Note *toSelect);
-	void invertSelectionOf(Note *toSelect);
-	QColor selectionRectInsideColor();
-	Note* theSelectedNote();
-	NoteSelection* selectedNotes();
+private:
+    bool   m_isSelecting;
+    bool   m_selectionStarted;
+    bool   m_selectionInvert;
+    QPoint m_selectionBeginPoint;
+    QPoint m_selectionEndPoint;
+    QRect  m_selectionRect;
+    QTimer m_autoScrollSelectionTimer;
+    void stopAutoScrollSelection();
+private slots:
+    void doAutoScrollSelection();
+public:
+    inline bool isSelecting() {
+        return m_isSelecting;
+    }
+    inline const QRect&amp; selectionRect() {
+        return m_selectionRect;
+    }
+    void selectNotesIn(const QRect &amp;rect, bool invertSelection, bool unselectOthers = true);
+    void resetWasInLastSelectionRect();
+    void selectAll();
+    void unselectAll();
+    void invertSelection();
+    void unselectAllBut(Note *toSelect);
+    void invertSelectionOf(Note *toSelect);
+    QColor selectionRectInsideColor();
+    Note* theSelectedNote();
+    NoteSelection* selectedNotes();
 
 /// BLANK SPACES DRAWING:
-  private:
-	QList&lt;QRect&gt; m_blankAreas;
-	void recomputeBlankRects();
-	QWidget *m_cornerWidget;
+private:
+    QList&lt;QRect&gt; m_blankAreas;
+    void recomputeBlankRects();
+    QWidget *m_cornerWidget;
 
 /// COMMUNICATION WITH ITS CONTAINER:
-  signals:
-	void postMessage(const QString &amp;message);      /// &lt;&lt; Post a temporar message in the statusBar.
-	void setStatusBarText(const QString &amp;message); /// &lt;&lt; Set the permanent statusBar text or reset it if message isEmpty().
-	void resetStatusBarText();                     /// &lt;&lt; Equivalent to setStatusBarText(&quot;&quot;).
-	void propertiesChanged(Basket *basket);
-	void countsChanged(Basket *basket);
-  public slots:
-	void linkLookChanged();
-	void signalCountsChanged();
-  private:
-	QTimer m_timerCountsChanged;
-  private slots:
-	void countsChangedTimeOut();
+signals:
+    void postMessage(const QString &amp;message);      /// &lt;&lt; Post a temporar message in the statusBar.
+    void setStatusBarText(const QString &amp;message); /// &lt;&lt; Set the permanent statusBar text or reset it if message isEmpty().
+    void resetStatusBarText();                     /// &lt;&lt; Equivalent to setStatusBarText(&quot;&quot;).
+    void propertiesChanged(Basket *basket);
+    void countsChanged(Basket *basket);
+public slots:
+    void linkLookChanged();
+    void signalCountsChanged();
+private:
+    QTimer m_timerCountsChanged;
+private slots:
+    void countsChangedTimeOut();
 
 /// NOTES COUNTING:
-  public:
-	void addSelectedNote()    { ++m_countSelecteds;   signalCountsChanged(); }
-	void removeSelectedNote() { --m_countSelecteds;   signalCountsChanged(); }
-	void resetSelectedNote()  { m_countSelecteds = 0; signalCountsChanged(); } // FIXME: Useful ???
-	int count()               { return m_count;          }
-	int countFounds()         { return m_countFounds;    }
-	int countSelecteds()      { return m_countSelecteds; }
-  private:
-	int m_count;
-	int m_countFounds;
-	int m_countSelecteds;
+public:
+    void addSelectedNote()    {
+        ++m_countSelecteds;   signalCountsChanged();
+    }
+    void removeSelectedNote() {
+        --m_countSelecteds;   signalCountsChanged();
+    }
+    void resetSelectedNote()  {
+        m_countSelecteds = 0; signalCountsChanged();
+    } // FIXME: Useful ???
+    int count()               {
+        return m_count;
+    }
+    int countFounds()         {
+        return m_countFounds;
+    }
+    int countSelecteds()      {
+        return m_countSelecteds;
+    }
+private:
+    int m_count;
+    int m_countFounds;
+    int m_countSelecteds;
 
 /// PROPERTIES:
-  public:
-	QString basketName() { return m_basketName; }
-	QString icon()       { return m_icon;       }
-	QString folderName() { return m_folderName; }
-	QString fullPath();
-	QString fullPathForFileName(const QString &amp;fileName); // Full path of an [existing or not] note in this basket
-	static QString fullPathForFolderName(const QString &amp;folderName);
-  private:
-	QString m_basketName;
-	QString m_icon;
-	QString m_folderName;
+public:
+    QString basketName() {
+        return m_basketName;
+    }
+    QString icon()       {
+        return m_icon;
+    }
+    QString folderName() {
+        return m_folderName;
+    }
+    QString fullPath();
+    QString fullPathForFileName(const QString &amp;fileName); // Full path of an [existing or not] note in this basket
+    static QString fullPathForFolderName(const QString &amp;folderName);
+private:
+    QString m_basketName;
+    QString m_icon;
+    QString m_folderName;
 
 /// ACTIONS ON SELECTED NOTES FROM THE INTERFACE:
-  public slots:
-	void noteEdit(Note *note = 0L, bool justAdded = false, const QPoint &amp;clickedPoint = QPoint());
-	void showEditedNoteWhileFiltering();
-	void noteDelete();
-	void noteDeleteWithoutConfirmation(bool deleteFilesToo = true);
-	void noteCopy();
-	void noteCut();
-	void noteOpen(Note *note = 0L);
-	void noteOpenWith(Note *note = 0L);
-	void noteSaveAs();
-	void noteGroup();
-	void noteUngroup();
-	void noteMoveOnTop();
-	void noteMoveOnBottom();
-	void noteMoveNoteUp();
-	void noteMoveNoteDown();
-	void moveSelectionTo(Note *here, bool below);
-  public:
-	enum CopyMode { CopyToClipboard, CopyToSelection, CutToClipboard };
-	void doCopy(CopyMode copyMode);
-	bool selectionIsOneGroup();
-	Note* selectedGroup();
-	Note* firstSelected();
-	Note* lastSelected();
+public slots:
+    void noteEdit(Note *note = 0L, bool justAdded = false, const QPoint &amp;clickedPoint = QPoint());
+    void showEditedNoteWhileFiltering();
+    void noteDelete();
+    void noteDeleteWithoutConfirmation(bool deleteFilesToo = true);
+    void noteCopy();
+    void noteCut();
+    void noteOpen(Note *note = 0L);
+    void noteOpenWith(Note *note = 0L);
+    void noteSaveAs();
+    void noteGroup();
+    void noteUngroup();
+    void noteMoveOnTop();
+    void noteMoveOnBottom();
+    void noteMoveNoteUp();
+    void noteMoveNoteDown();
+    void moveSelectionTo(Note *here, bool below);
+public:
+    enum CopyMode { CopyToClipboard, CopyToSelection, CutToClipboard };
+    void doCopy(CopyMode copyMode);
+    bool selectionIsOneGroup();
+    Note* selectedGroup();
+    Note* firstSelected();
+    Note* lastSelected();
 
 /// NOTES EDITION:
-  private:
-	NoteEditor *m_editor;
-	//QWidget    *m_rightEditorBorder;
-	TransparentWidget *m_leftEditorBorder;
-	TransparentWidget *m_rightEditorBorder;
-	bool        m_redirectEditActions;
-	int         m_editorWidth;
-	int         m_editorHeight;
-	QTimer      m_inactivityAutoSaveTimer;
-	bool        m_doNotCloseEditor;
+private:
+    NoteEditor *m_editor;
+    //QWidget    *m_rightEditorBorder;
+    TransparentWidget *m_leftEditorBorder;
+    TransparentWidget *m_rightEditorBorder;
+    bool        m_redirectEditActions;
+    int         m_editorWidth;
+    int         m_editorHeight;
+    QTimer      m_inactivityAutoSaveTimer;
+    bool        m_doNotCloseEditor;
     QTextCursor m_textCursor;
-  public:
-	bool isDuringEdit()        { return m_editor;              }
-	bool redirectEditActions() { return m_redirectEditActions; }
-	bool hasTextInEditor();
-	bool hasSelectedTextInEditor();
-	bool selectedAllTextInEditor();
-	Note* editedNote();
-  protected slots:
-	void selectionChangedInEditor();
-	void contentChangedInEditor();
-	void inactivityAutoSaveTimeout();
-  public slots:
-	void editorCursorPositionChanged();
-  private:
-	int m_editorX;
-	int m_editorY;
-  public slots:
-	void placeEditor(bool andEnsureVisible = false);
-	void placeEditorAndEnsureVisible();
-	bool closeEditor();
-	void closeEditorDelayed();
-	void updateEditorAppearance();
-	void editorPropertiesChanged();
-	void openBasket();
-	void closeBasket();
+public:
+    bool isDuringEdit()        {
+        return m_editor;
+    }
+    bool redirectEditActions() {
+        return m_redirectEditActions;
+    }
+    bool hasTextInEditor();
+    bool hasSelectedTextInEditor();
+    bool selectedAllTextInEditor();
+    Note* editedNote();
+protected slots:
+    void selectionChangedInEditor();
+    void contentChangedInEditor();
+    void inactivityAutoSaveTimeout();
+public slots:
+    void editorCursorPositionChanged();
+private:
+    int m_editorX;
+    int m_editorY;
+public slots:
+    void placeEditor(bool andEnsureVisible = false);
+    void placeEditorAndEnsureVisible();
+    bool closeEditor();
+    void closeEditorDelayed();
+    void updateEditorAppearance();
+    void editorPropertiesChanged();
+    void openBasket();
+    void closeBasket();
 
 /// FILTERING:
-  public slots:
-	void newFilter(const FilterData &amp;data, bool andEnsureVisible = true);
-	void filterAgain(bool andEnsureVisible = true);
-	void filterAgainDelayed();
-	bool isFiltering();
+public slots:
+    void newFilter(const FilterData &amp;data, bool andEnsureVisible = true);
+    void filterAgain(bool andEnsureVisible = true);
+    void filterAgainDelayed();
+    bool isFiltering();
 
 /// DRAG AND DROP:
-  private:
-	bool m_isDuringDrag;
-	QList&lt;Note*&gt; m_draggedNotes;
-  public:
-	static void acceptDropEvent(QDropEvent *event, bool preCond = true);
-	void contentsDropEvent(QDropEvent *event);
-	void blindDrop(QDropEvent* event);
-	bool isDuringDrag() { return m_isDuringDrag; }
-	QList&lt;Note*&gt; draggedNotes() { return m_draggedNotes; }
-  protected:
-	void contentsDragEnterEvent(QDragEnterEvent*);
-	void contentsDragMoveEvent(QDragMoveEvent *event);
-	void contentsDragLeaveEvent(QDragLeaveEvent*);
-  public slots:
-	void slotCopyingDone2(KIO::Job *job, const KUrl &amp;from, const KUrl &amp;to);
-  public:
-	Note* noteForFullPath(const QString &amp;path);
+private:
+    bool m_isDuringDrag;
+    QList&lt;Note*&gt; m_draggedNotes;
+public:
+    static void acceptDropEvent(QDropEvent *event, bool preCond = true);
+    void contentsDropEvent(QDropEvent *event);
+    void blindDrop(QDropEvent* event);
+    bool isDuringDrag() {
+        return m_isDuringDrag;
+    }
+    QList&lt;Note*&gt; draggedNotes() {
+        return m_draggedNotes;
+    }
+protected:
+    void contentsDragEnterEvent(QDragEnterEvent*);
+    void contentsDragMoveEvent(QDragMoveEvent *event);
+    void contentsDragLeaveEvent(QDragLeaveEvent*);
+public slots:
+    void slotCopyingDone2(KIO::Job *job, const KUrl &amp;from, const KUrl &amp;to);
+public:
+    Note* noteForFullPath(const QString &amp;path);
 
 /// EXPORTATION:
-  public:
-	QList&lt;State*&gt; usedStates();
-	static QString saveGradientBackground(const QColor &amp;color, const QFont &amp;font, const QString &amp;folder);
+public:
+    QList&lt;State*&gt; usedStates();
+    static QString saveGradientBackground(const QColor &amp;color, const QFont &amp;font, const QString &amp;folder);
 
-  public:
-	void listUsedTags(QList&lt;Tag*&gt; &amp;list);
+public:
+    void listUsedTags(QList&lt;Tag*&gt; &amp;list);
 
 /// MANAGE FOCUS:
-  private:
-	Note *m_focusedNote;
-  public:
-	void setFocusedNote(Note *note);
-	void focusANote();
-	void focusANonSelectedNoteAbove(bool inSameColumn);
-	void focusANonSelectedNoteBelow(bool inSameColumn);
-	void focusANonSelectedNoteBelowOrThenAbove();
-	void focusANonSelectedNoteAboveOrThenBelow();
-	Note* focusedNote() { return m_focusedNote; }
-	Note* firstNoteInStack();
-	Note* lastNoteInStack();
-	Note* firstNoteShownInStack();
-	Note* lastNoteShownInStack();
-	void selectRange(Note *start, Note *end, bool unselectOthers = true); /// FIXME: Not really a focus related method!
-	void ensureNoteVisible(Note *note);
-	virtual void keyPressEvent(QKeyEvent *event);
-	virtual void focusInEvent(QFocusEvent*);
-	virtual void focusOutEvent(QFocusEvent*);
-	QRect noteVisibleRect(Note *note); // clipped global (desktop as origin) rectangle
-	Note* firstNoteInGroup();
-	Note *noteOnHome();
-	Note *noteOnEnd();
-
-	enum NoteOn { LEFT_SIDE = 1, RIGHT_SIDE, TOP_SIDE, BOTTOM_SIDE };
-	Note* noteOn(NoteOn side);
+private:
+    Note *m_focusedNote;
+public:
+    void setFocusedNote(Note *note);
+    void focusANote();
+    void focusANonSelectedNoteAbove(bool inSameColumn);
+    void focusANonSelectedNoteBelow(bool inSameColumn);
+    void focusANonSelectedNoteBelowOrThenAbove();
+    void focusANonSelectedNoteAboveOrThenBelow();
+    Note* focusedNote() {
+        return m_focusedNote;
+    }
+    Note* firstNoteInStack();
+    Note* lastNoteInStack();
+    Note* firstNoteShownInStack();
+    Note* lastNoteShownInStack();
+    void selectRange(Note *start, Note *end, bool unselectOthers = true); /// FIXME: Not really a focus related method!
+    void ensureNoteVisible(Note *note);
+    virtual void keyPressEvent(QKeyEvent *event);
+    virtual void focusInEvent(QFocusEvent*);
+    virtual void focusOutEvent(QFocusEvent*);
+    QRect noteVisibleRect(Note *note); // clipped global (desktop as origin) rectangle
+    Note* firstNoteInGroup();
+    Note *noteOnHome();
+    Note *noteOnEnd();
+
+    enum NoteOn { LEFT_SIDE = 1, RIGHT_SIDE, TOP_SIDE, BOTTOM_SIDE };
+    Note* noteOn(NoteOn side);
 
 /// REIMPLEMENTED:
-  public:
-	void deleteFiles();
-	bool convertTexts();
+public:
+    void deleteFiles();
+    bool convertTexts();
 
 
-  public:
-	void wheelEvent(QWheelEvent *event);
+public:
+    void wheelEvent(QWheelEvent *event);
 
 
 
-  public:
-	Note *m_startOfShiftSelectionNote;
+public:
+    Note *m_startOfShiftSelectionNote;
 
 
 /// THE NEW FILE WATCHER:
-  private:
-	KDirWatch           *m_watcher;
-	QTimer               m_watcherTimer;
-	QList&lt;QString&gt;  m_modifiedFiles;
-  public:
-	void addWatchedFile(const QString &amp;fullPath);
-	void removeWatchedFile(const QString &amp;fullPath);
-  private slots:
-	void watchedFileModified(const QString &amp;fullPath);
-	void watchedFileDeleted(const QString &amp;fullPath);
-	void updateModifiedNotes();
+private:
+    KDirWatch           *m_watcher;
+    QTimer               m_watcherTimer;
+    QList&lt;QString&gt;  m_modifiedFiles;
+public:
+    void addWatchedFile(const QString &amp;fullPath);
+    void removeWatchedFile(const QString &amp;fullPath);
+private slots:
+    void watchedFileModified(const QString &amp;fullPath);
+    void watchedFileDeleted(const QString &amp;fullPath);
+    void updateModifiedNotes();
 
 
 /// FROM OLD ARCHITECTURE **********************
 
 public slots:
 
-	void showFrameInsertTo() {}
-	void resetInsertTo() {}
+    void showFrameInsertTo() {}
+    void resetInsertTo() {}
 
-	void  computeInsertPlace(const QPoint &amp;/*cursorPosition*/)    { }
-  public:
+    void  computeInsertPlace(const QPoint &amp;/*cursorPosition*/)    { }
+public:
 
-	friend class SystemTray;
+    friend class SystemTray;
 
 /// SPEED OPTIMIZATION
-  private:
-	bool m_finishLoadOnFirstShow;
-	bool m_relayoutOnNextShow;
-  public:
-	void aboutToBeActivated();
+private:
+    bool m_finishLoadOnFirstShow;
+    bool m_relayoutOnNextShow;
+public:
+    void aboutToBeActivated();
 };
 
 #endif // BASKET_H</diff>
      <filename>src/basket.h</filename>
    </modified>
    <modified>
      <diff>@@ -24,10 +24,10 @@
 
 #ifndef BASKET_EXPORT
 # if defined(MAKE_BASKETCOMMON_LIB)
-   /* We are building this library */
+/* We are building this library */
 #  define BASKET_EXPORT KDE_EXPORT
 # else
-   /* We are using this library */
+/* We are using this library */
 #  define BASKET_EXPORT KDE_IMPORT
 # endif
 #endif</diff>
      <filename>src/basket_export.h</filename>
    </modified>
    <modified>
      <diff>@@ -31,15 +31,15 @@ void setupCmdLineOptions(KCmdLineOptions *opts)
     opts-&gt;add(&quot;f&quot;);
     opts-&gt;add(&quot;data-folder \\&lt;folder&gt;&quot;,
               ki18n(&quot;Custom folder to load and save baskets and other &quot;
-                   &quot;application data.&quot;));
+                    &quot;application data.&quot;));
     opts-&gt;add(&quot;h&quot;);
     opts-&gt;add(&quot;start-hidden&quot;,
               ki18n(&quot;Automatically hide the main window in the system tray on &quot;
-                   &quot;startup.&quot;));
+                    &quot;startup.&quot;));
     opts-&gt;add(&quot;k&quot;);
     opts-&gt;add(&quot;use-drkonqi&quot;,
               ki18n(&quot;On crash, use the standard KDE crash handler rather than &quot;
-                   &quot;send an email.&quot;));
+                    &quot;send an email.&quot;));
     opts-&gt;add(&quot;+[file]&quot;, ki18n(&quot;Open a basket archive or template.&quot;));
 }
 </diff>
      <filename>src/basket_options.h</filename>
    </modified>
    <modified>
      <diff>@@ -36,35 +36,35 @@
 //typedef KParts::GenericFactory&lt; BasketPart &gt; BasketFactory;
 
 //K_EXPORT_COMPONENT_FACTORY( libbasketpart, BasketFactory );
-K_PLUGIN_FACTORY( BasketFactory, registerPlugin&lt;BasketPart&gt;();)
-K_EXPORT_PLUGIN( BasketFactory(&quot;basket&quot;, &quot;basket&quot;) )
+K_PLUGIN_FACTORY(BasketFactory, registerPlugin&lt;BasketPart&gt;();)
+K_EXPORT_PLUGIN(BasketFactory(&quot;basket&quot;, &quot;basket&quot;))
 
-BasketPart::BasketPart( QWidget *parentWidget, QObject *parent, const QList&lt;QVariant&gt; &amp; )
-	: KParts::ReadWritePart(parent)
+BasketPart::BasketPart(QWidget *parentWidget, QObject *parent, const QList&lt;QVariant&gt; &amp;)
+        : KParts::ReadWritePart(parent)
 {
-  // we need an instance
-	//setInstance( BasketFactory::instance() );
+    // we need an instance
+    //setInstance( BasketFactory::instance() );
 
-	BasketStatusBar* bar = new BasketStatusBar(new KParts::StatusBarExtension(this));
-  // this should be your custom internal widget
-	m_view = new BNPView(parentWidget, &quot;BNPViewPart&quot;, this, actionCollection(), bar);
-	connect(m_view, SIGNAL(setWindowCaption(const QString &amp;)), this, SLOT(setCaption(const QString &amp;)));
-	connect(m_view, SIGNAL(showPart()), this, SIGNAL(showPart()));
-	m_view-&gt;setFocusPolicy(Qt::ClickFocus);
+    BasketStatusBar* bar = new BasketStatusBar(new KParts::StatusBarExtension(this));
+    // this should be your custom internal widget
+    m_view = new BNPView(parentWidget, &quot;BNPViewPart&quot;, this, actionCollection(), bar);
+    connect(m_view, SIGNAL(setWindowCaption(const QString &amp;)), this, SLOT(setCaption(const QString &amp;)));
+    connect(m_view, SIGNAL(showPart()), this, SIGNAL(showPart()));
+    m_view-&gt;setFocusPolicy(Qt::ClickFocus);
 
-  // notify the part that this is our internal widget
-	setWidget(m_view);
+    // notify the part that this is our internal widget
+    setWidget(m_view);
 
-	setComponentData( BasketFactory::componentData() );
+    setComponentData(BasketFactory::componentData());
 
-  // set our XML-UI resource file
-	setXMLFile(&quot;basket_part.rc&quot;, true);
+    // set our XML-UI resource file
+    setXMLFile(&quot;basket_part.rc&quot;, true);
 
-  // we are read-write by default
-	setReadWrite(true);
+    // we are read-write by default
+    setReadWrite(true);
 
-  // we are not modified since we haven't done anything yet
-	setModified(false);
+    // we are not modified since we haven't done anything yet
+    setModified(false);
 }
 
 BasketPart::~BasketPart()
@@ -72,35 +72,35 @@ BasketPart::~BasketPart()
 
 void BasketPart::setReadWrite(bool rw)
 {
-  // TODO: notify your internal widget of the read-write state
-	ReadWritePart::setReadWrite(rw);
+    // TODO: notify your internal widget of the read-write state
+    ReadWritePart::setReadWrite(rw);
 }
 
 void BasketPart::setModified(bool modified)
 {
-  // in any event, we want our parent to do it's thing
-	ReadWritePart::setModified(modified);
+    // in any event, we want our parent to do it's thing
+    ReadWritePart::setModified(modified);
 }
 
 bool BasketPart::openFile()
 {
-  // TODO
-	return false;
+    // TODO
+    return false;
 }
 
 bool BasketPart::saveFile()
 {
-  //TODO
-	return false;
+    //TODO
+    return false;
 }
 
 KAboutData *BasketPart::createAboutData()
 {
-	return new AboutData();
+    return new AboutData();
 }
 
 void BasketPart::setCaption(const QString &amp;caption)
 {
-	emit setWindowCaption(caption);
+    emit setWindowCaption(caption);
 }
 </diff>
      <filename>src/basket_part.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -63,26 +63,26 @@ public:
      */
     virtual void setModified(bool modified);
 
-	static KAboutData *createAboutData();
+    static KAboutData *createAboutData();
 
-  signals:
-	void showPart();
+signals:
+    void showPart();
 
-  protected:
+protected:
     /**
-	 * This must be implemented by each part
-	 */
-	virtual bool openFile();
+     * This must be implemented by each part
+     */
+    virtual bool openFile();
 
     /**
-		 * This must be implemented by each read-write part
-	 */
-	virtual bool saveFile();
+         * This must be implemented by each read-write part
+     */
+    virtual bool saveFile();
 
-  protected slots:
-	  void setCaption(const QString &amp;caption);
+protected slots:
+    void setCaption(const QString &amp;caption);
 
-  private:
+private:
     BNPView *m_view;
 };
 </diff>
      <filename>src/basket_part.h</filename>
    </modified>
    <modified>
      <diff>@@ -11,13 +11,13 @@
 #include &lt;kicon.h&gt;
 #include &lt;kparts/componentfactory.h&gt;
 
-EXPORT_KONTACT_PLUGIN( BasketPlugin, basket )
+EXPORT_KONTACT_PLUGIN(BasketPlugin, basket)
 
-BasketPlugin::BasketPlugin( Kontact::Core *core, const QVariantList &amp; )
-  : Kontact::Plugin( core, core, &quot;Basket&quot; )
+BasketPlugin::BasketPlugin(Kontact::Core *core, const QVariantList &amp;)
+        : Kontact::Plugin(core, core, &quot;Basket&quot;)
 {
-  setComponentData( KontactPluginFactory::componentData() );
-  Global::basketConfig = KSharedConfig::openConfig(&quot;basketrc&quot;);
+    setComponentData(KontactPluginFactory::componentData());
+    Global::basketConfig = KSharedConfig::openConfig(&quot;basketrc&quot;);
 }
 
 BasketPlugin::~BasketPlugin()
@@ -26,32 +26,30 @@ BasketPlugin::~BasketPlugin()
 
 KParts::ReadOnlyPart *BasketPlugin::createPart()
 {
-  KParts::ReadOnlyPart *part = loadPart();
+    KParts::ReadOnlyPart *part = loadPart();
 
-  connect( part, SIGNAL(showPart()), this, SLOT(showPart()) );
+    connect(part, SIGNAL(showPart()), this, SLOT(showPart()));
 
-  return part;
+    return part;
 }
 
-void BasketPlugin::readProperties( const KConfigGroup &amp;config )
+void BasketPlugin::readProperties(const KConfigGroup &amp;config)
 {
-  if ( part() )
-  {
-    BasketPart *myPart = static_cast&lt;BasketPart*&gt;( part() );
-  }
+    if (part()) {
+        BasketPart *myPart = static_cast&lt;BasketPart*&gt;(part());
+    }
 }
 
-void BasketPlugin::saveProperties( KConfigGroup &amp;config )
+void BasketPlugin::saveProperties(KConfigGroup &amp;config)
 {
-  if ( part() )
-  {
-    BasketPart *myPart = static_cast&lt;BasketPart*&gt;( part() );
-  }
+    if (part()) {
+        BasketPart *myPart = static_cast&lt;BasketPart*&gt;(part());
+    }
 }
 
 void BasketPlugin::showPart()
 {
-  core()-&gt;selectPlugin( this );
+    core()-&gt;selectPlugin(this);
 }
 
 #include &quot;basket_plugin.moc&quot;</diff>
      <filename>src/basket_plugin.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-#ifndef BASKET_PLUGIN_H 
+#ifndef BASKET_PLUGIN_H
 #define BASKET_PLUGIN_H
 
 #include &lt;kontactinterfaces/plugin.h&gt;
@@ -6,19 +6,19 @@
 
 class BasketPlugin : public Kontact::Plugin
 {
-  Q_OBJECT
+    Q_OBJECT
 
-  public:
-    BasketPlugin( Kontact::Core *core, const QVariantList &amp; );
+public:
+    BasketPlugin(Kontact::Core *core, const QVariantList &amp;);
     ~BasketPlugin();
 
-    virtual void readProperties( const KConfigGroup &amp;config );
-    virtual void saveProperties( KConfigGroup &amp;config );
+    virtual void readProperties(const KConfigGroup &amp;config);
+    virtual void saveProperties(KConfigGroup &amp;config);
 
-  private slots:
+private slots:
     void showPart();
 
-  protected:
+protected:
     KParts::ReadOnlyPart *createPart();
 };
 </diff>
      <filename>src/basket_plugin.h</filename>
    </modified>
    <modified>
      <diff>@@ -38,61 +38,61 @@
 
 QString BasketFactory::newFolderName()
 {
-	QString folderName;
-	QString fullPath;
-	QDir    dir;
-
-	for (int i = 1; ; ++i) {
-		folderName = &quot;basket&quot; + QString::number(i) + &quot;/&quot;;
-		fullPath   = Global::basketsFolder() + folderName;
-		dir        = QDir(fullPath);
-		if ( ! dir.exists() ) // OK : The folder do not yet exists :
-			break;            //  We've found one !
-	}
-
-	return folderName;
+    QString folderName;
+    QString fullPath;
+    QDir    dir;
+
+    for (int i = 1; ; ++i) {
+        folderName = &quot;basket&quot; + QString::number(i) + &quot;/&quot;;
+        fullPath   = Global::basketsFolder() + folderName;
+        dir        = QDir(fullPath);
+        if (! dir.exists())   // OK : The folder do not yet exists :
+            break;            //  We've found one !
+    }
+
+    return folderName;
 }
 
 QString BasketFactory::unpackTemplate(const QString &amp;templateName)
 {
-	// Find a name for a new folder and create it:
-	QString folderName = newFolderName();
-	QString fullPath   = Global::basketsFolder() + folderName;
-	QDir dir;
-	if (!dir.mkdir(fullPath)) {
-		KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the folder creation for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
-		return &quot;&quot;;
-	}
-
-	// Unpack the template file to that folder:
-	// TODO: REALLY unpack (this hand-creation is temporary, or it could be used in case the template can't be found)
-	QFile file(fullPath + &quot;/.basket&quot;);
-	if (file.open(QIODevice::WriteOnly)) {
-		QTextStream stream(&amp;file);
-		stream.setCodec(&quot;UTF-8&quot;);
-		int nbColumns = (templateName == &quot;mindmap&quot; || templateName == &quot;free&quot; ? 0 : templateName.left(1).toInt());
-		Basket *currentBasket = Global::bnpView-&gt;currentBasket();
-		int columnWidth = (currentBasket &amp;&amp; nbColumns &gt; 0 ? (currentBasket-&gt;visibleWidth() - (nbColumns-1)*Note::RESIZER_WIDTH) / nbColumns : 0);
-		stream &lt;&lt; QString( &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;
-		                   &quot;&lt;!DOCTYPE basket&gt;\n&quot;
-		                   &quot;&lt;basket&gt;\n&quot;
-		                   &quot; &lt;properties&gt;\n&quot;
-		                   &quot;  &lt;disposition mindMap=\&quot;%1\&quot; columnCount=\&quot;%2\&quot; free=\&quot;%3\&quot; /&gt;\n&quot;
-		                   &quot; &lt;/properties&gt;\n&quot;
-		                   &quot; &lt;notes&gt;\n&quot; ).arg( (templateName == &quot;mindmap&quot; ? &quot;true&quot; : &quot;false&quot;),
-		                                       QString::number(nbColumns),
-		                                       (templateName == &quot;free&quot; || templateName == &quot;mindmap&quot; ? &quot;true&quot; : &quot;false&quot;) );
-		if (nbColumns &gt; 0)
-			for (int i = 0; i &lt; nbColumns; ++i)
-				stream &lt;&lt; QString(&quot;  &lt;group width=\&quot;%1\&quot;&gt;&lt;/group&gt;\n&quot;).arg(columnWidth);
-		stream &lt;&lt; &quot; &lt;/notes&gt;\n&quot;
-		          &quot;&lt;/basket&gt;\n&quot;;
-		file.close();
-		return folderName;
-	} else {
-		KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the template copying for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
-		return &quot;&quot;;
-	}
+    // Find a name for a new folder and create it:
+    QString folderName = newFolderName();
+    QString fullPath   = Global::basketsFolder() + folderName;
+    QDir dir;
+    if (!dir.mkdir(fullPath)) {
+        KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the folder creation for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
+        return &quot;&quot;;
+    }
+
+    // Unpack the template file to that folder:
+    // TODO: REALLY unpack (this hand-creation is temporary, or it could be used in case the template can't be found)
+    QFile file(fullPath + &quot;/.basket&quot;);
+    if (file.open(QIODevice::WriteOnly)) {
+        QTextStream stream(&amp;file);
+        stream.setCodec(&quot;UTF-8&quot;);
+        int nbColumns = (templateName == &quot;mindmap&quot; || templateName == &quot;free&quot; ? 0 : templateName.left(1).toInt());
+        Basket *currentBasket = Global::bnpView-&gt;currentBasket();
+        int columnWidth = (currentBasket &amp;&amp; nbColumns &gt; 0 ? (currentBasket-&gt;visibleWidth() - (nbColumns - 1) * Note::RESIZER_WIDTH) / nbColumns : 0);
+        stream &lt;&lt; QString(&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;
+                          &quot;&lt;!DOCTYPE basket&gt;\n&quot;
+                          &quot;&lt;basket&gt;\n&quot;
+                          &quot; &lt;properties&gt;\n&quot;
+                          &quot;  &lt;disposition mindMap=\&quot;%1\&quot; columnCount=\&quot;%2\&quot; free=\&quot;%3\&quot; /&gt;\n&quot;
+                          &quot; &lt;/properties&gt;\n&quot;
+                          &quot; &lt;notes&gt;\n&quot;).arg((templateName == &quot;mindmap&quot; ? &quot;true&quot; : &quot;false&quot;),
+                                            QString::number(nbColumns),
+                                            (templateName == &quot;free&quot; || templateName == &quot;mindmap&quot; ? &quot;true&quot; : &quot;false&quot;));
+        if (nbColumns &gt; 0)
+            for (int i = 0; i &lt; nbColumns; ++i)
+                stream &lt;&lt; QString(&quot;  &lt;group width=\&quot;%1\&quot;&gt;&lt;/group&gt;\n&quot;).arg(columnWidth);
+        stream &lt;&lt; &quot; &lt;/notes&gt;\n&quot;
+        &quot;&lt;/basket&gt;\n&quot;;
+        file.close();
+        return folderName;
+    } else {
+        KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the template copying for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
+        return &quot;&quot;;
+    }
 }
 
 void BasketFactory::newBasket(const QString &amp;icon,
@@ -103,60 +103,60 @@ void BasketFactory::newBasket(const QString &amp;icon,
                               const QString &amp;templateName,
                               Basket *parent)
 {
-	// Unpack the templateName file to a new basket folder:
-	QString folderName = unpackTemplate(templateName);
-	if (folderName.isEmpty())
-		return;
-
-	// Read the properties, change those that should be customized and save the result:
-	QDomDocument *document  = XMLWork::openFile(&quot;basket&quot;, Global::basketsFolder() + folderName + &quot;/.basket&quot;);
-	if (!document) {
-		KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the template customization for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
-		return;
-	}
-	QDomElement properties  = XMLWork::getElement(document-&gt;documentElement(), &quot;properties&quot;);
-
-	if (!icon.isEmpty()) {
-		QDomElement iconElement = XMLWork::getElement(properties, &quot;icon&quot;);
-		if (!iconElement.tagName().isEmpty()) // If there is already an icon, remove it since we will add our own value below
-			iconElement.removeChild(iconElement.firstChild());
-		XMLWork::addElement(*document, properties, &quot;icon&quot;, icon);
-	}
-
-	if (!name.isEmpty()) {
-		QDomElement nameElement = XMLWork::getElement(properties, &quot;name&quot;);
-		if (!nameElement.tagName().isEmpty()) // If there is already a name, remove it since we will add our own value below
-			nameElement.removeChild(nameElement.firstChild());
-		XMLWork::addElement(*document, properties, &quot;name&quot;, name);
-	}
-
-	if (backgroundColor.isValid()) {
-		QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
-		if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
-			appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
-			properties.appendChild(appearanceElement);
-		}
-		appearanceElement.setAttribute(&quot;backgroundColor&quot;, backgroundColor.name());
-	}
-
-	if (!backgroundImage.isEmpty()) {
-		QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
-		if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
-			appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
-			properties.appendChild(appearanceElement);
-		}
-		appearanceElement.setAttribute(&quot;backgroundImage&quot;, backgroundImage);
-	}
-
-	if (textColor.isValid()) {
-		QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
-		if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
-			appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
-			properties.appendChild(appearanceElement);
-		}
-		appearanceElement.setAttribute(&quot;textColor&quot;, textColor.name());
-	}
-
-	// Load it in the parent basket (it will save the tree and switch to this new basket):
-	Global::bnpView-&gt;loadNewBasket(folderName, properties, parent);
+    // Unpack the templateName file to a new basket folder:
+    QString folderName = unpackTemplate(templateName);
+    if (folderName.isEmpty())
+        return;
+
+    // Read the properties, change those that should be customized and save the result:
+    QDomDocument *document  = XMLWork::openFile(&quot;basket&quot;, Global::basketsFolder() + folderName + &quot;/.basket&quot;);
+    if (!document) {
+        KMessageBox::error(/*parent=*/0, i18n(&quot;Sorry, but the template customization for this new basket has failed.&quot;), i18n(&quot;Basket Creation Failed&quot;));
+        return;
+    }
+    QDomElement properties  = XMLWork::getElement(document-&gt;documentElement(), &quot;properties&quot;);
+
+    if (!icon.isEmpty()) {
+        QDomElement iconElement = XMLWork::getElement(properties, &quot;icon&quot;);
+        if (!iconElement.tagName().isEmpty()) // If there is already an icon, remove it since we will add our own value below
+            iconElement.removeChild(iconElement.firstChild());
+        XMLWork::addElement(*document, properties, &quot;icon&quot;, icon);
+    }
+
+    if (!name.isEmpty()) {
+        QDomElement nameElement = XMLWork::getElement(properties, &quot;name&quot;);
+        if (!nameElement.tagName().isEmpty()) // If there is already a name, remove it since we will add our own value below
+            nameElement.removeChild(nameElement.firstChild());
+        XMLWork::addElement(*document, properties, &quot;name&quot;, name);
+    }
+
+    if (backgroundColor.isValid()) {
+        QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
+        if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
+            appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
+            properties.appendChild(appearanceElement);
+        }
+        appearanceElement.setAttribute(&quot;backgroundColor&quot;, backgroundColor.name());
+    }
+
+    if (!backgroundImage.isEmpty()) {
+        QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
+        if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
+            appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
+            properties.appendChild(appearanceElement);
+        }
+        appearanceElement.setAttribute(&quot;backgroundImage&quot;, backgroundImage);
+    }
+
+    if (textColor.isValid()) {
+        QDomElement appearanceElement = XMLWork::getElement(properties, &quot;appearance&quot;);
+        if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
+            appearanceElement = document-&gt;createElement(&quot;appearance&quot;);
+            properties.appendChild(appearanceElement);
+        }
+        appearanceElement.setAttribute(&quot;textColor&quot;, textColor.name());
+    }
+
+    // Load it in the parent basket (it will save the tree and switch to this new basket):
+    Global::bnpView-&gt;loadNewBasket(folderName, properties, parent);
 }</diff>
      <filename>src/basketfactory.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -30,17 +30,17 @@ class Basket;
   */
 namespace BasketFactory
 {
-	/** You should use this method to create a new basket: */
-	void newBasket(const QString &amp;icon,
-	               const QString &amp;name,
-	               const QString &amp;backgroundImage,
-	               const QColor  &amp;backgroundColor,
-	               const QColor  &amp;textColor,
-	               const QString &amp;templateName,
-	               Basket *parent);
-	/** Internal tool methods to process the method above: */
-	QString newFolderName();
-	QString unpackTemplate(const QString &amp;templateName);
+/** You should use this method to create a new basket: */
+void newBasket(const QString &amp;icon,
+               const QString &amp;name,
+               const QString &amp;backgroundImage,
+               const QColor  &amp;backgroundColor,
+               const QColor  &amp;textColor,
+               const QString &amp;templateName,
+               Basket *parent);
+/** Internal tool methods to process the method above: */
+QString newFolderName();
+QString unpackTemplate(const QString &amp;templateName);
 }
 
 #endif // BASKETFACTORY_H</diff>
      <filename>src/basketfactory.h</filename>
    </modified>
    <modified>
      <diff>@@ -47,30 +47,30 @@
 /** class BasketListViewItem: */
 
 BasketListViewItem::BasketListViewItem(QTreeWidget *parent, Basket *basket)
-	: QTreeWidgetItem(parent), m_basket(basket)
-	, m_isUnderDrag(false)
-	, m_isAbbreviated(false)
+        : QTreeWidgetItem(parent), m_basket(basket)
+        , m_isUnderDrag(false)
+        , m_isAbbreviated(false)
 {
 }
 
 BasketListViewItem::BasketListViewItem(QTreeWidgetItem *parent, Basket *basket)
-	: QTreeWidgetItem(parent), m_basket(basket)
-	, m_isUnderDrag(false)
-	, m_isAbbreviated(false)
+        : QTreeWidgetItem(parent), m_basket(basket)
+        , m_isUnderDrag(false)
+        , m_isAbbreviated(false)
 {
 }
 
 BasketListViewItem::BasketListViewItem(QTreeWidget *parent, QTreeWidgetItem *after, Basket *basket)
-	: QTreeWidgetItem(parent, after), m_basket(basket)
-	, m_isUnderDrag(false)
-	, m_isAbbreviated(false)
+        : QTreeWidgetItem(parent, after), m_basket(basket)
+        , m_isUnderDrag(false)
+        , m_isAbbreviated(false)
 {
 }
 
 BasketListViewItem::BasketListViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *after, Basket *basket)
-	: QTreeWidgetItem(parent, after), m_basket(basket)
-	, m_isUnderDrag(false)
-	, m_isAbbreviated(false)
+        : QTreeWidgetItem(parent, after), m_basket(basket)
+        , m_isUnderDrag(false)
+        , m_isAbbreviated(false)
 {
 }
 
@@ -99,412 +99,412 @@ QString BasketListViewItem::escapedName(const QString &amp;string)
 
 void BasketListViewItem::setup()
 {
-	setText(/*column=*/0, escapedName(m_basket-&gt;basketName()));
+    setText(/*column=*/0, escapedName(m_basket-&gt;basketName()));
 
-        QPixmap icon = KIconLoader::global()-&gt;loadIcon(
-        m_basket-&gt;icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
-        QStringList(), 0L, /*canReturnNull=*/false
-        );
+    QPixmap icon = KIconLoader::global()-&gt;loadIcon(
+                       m_basket-&gt;icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
+                       QStringList(), 0L, /*canReturnNull=*/false
+                   );
 
-	setIcon(/*column=*/0, icon);
-/*
-	QBrush brush;
+    setIcon(/*column=*/0, icon);
+    /*
+        QBrush brush;
 
-	bool withIcon = m_stateCopy || (m_tagCopy &amp;&amp; !m_tagCopy-&gt;isMultiState());
-	State* state = (m_tagCopy ? m_tagCopy-&gt;stateCopies[0]-&gt;newState : m_stateCopy-&gt;newState);
-	brush.setColor(isSelected() ? kapp-&gt;palette().color(QPalette::Highlight)  : (withIcon &amp;&amp; state-&gt;backgroundColor().isValid() ? state-&gt;backgroundColor() : viewport-&gt;palette().color(viewwport-&gt;backgroundRole())));
-	setBackground(brush);
-	*/
+        bool withIcon = m_stateCopy || (m_tagCopy &amp;&amp; !m_tagCopy-&gt;isMultiState());
+        State* state = (m_tagCopy ? m_tagCopy-&gt;stateCopies[0]-&gt;newState : m_stateCopy-&gt;newState);
+        brush.setColor(isSelected() ? kapp-&gt;palette().color(QPalette::Highlight)  : (withIcon &amp;&amp; state-&gt;backgroundColor().isValid() ? state-&gt;backgroundColor() : viewport-&gt;palette().color(viewwport-&gt;backgroundRole())));
+        setBackground(brush);
+        */
 }
 
 BasketListViewItem* BasketListViewItem::lastChild()
 {
-	int count = childCount();
-	if (count &lt;= 0)
-		return 0;
-	return (BasketListViewItem*)(child(count-1));
+    int count = childCount();
+    if (count &lt;= 0)
+        return 0;
+    return (BasketListViewItem*)(child(count - 1));
 }
 
 QStringList BasketListViewItem::childNamesTree(int deep)
 {
-	QStringList result;
+    QStringList result;
 
-	// Compute indentation spaces:
-	QString spaces;
-	for (int j = 0; j &lt; deep; ++j)
-		spaces += &quot;  &quot;;
+    // Compute indentation spaces:
+    QString spaces;
+    for (int j = 0; j &lt; deep; ++j)
+        spaces += &quot;  &quot;;
 
-	// Append the name:
-	result.append(spaces + basket()-&gt;basketName());
+    // Append the name:
+    result.append(spaces + basket()-&gt;basketName());
 
-	// Append the children:
-	for (int i=0;i&lt;childCount();i++){
-		QStringList children = ((BasketListViewItem *)child(i))-&gt;childNamesTree(deep + 1);
-		for (QStringList::iterator it = children.begin(); it != children.end(); ++it)
-			result.append(*it);
-	}
-	return result;
+    // Append the children:
+    for (int i = 0; i &lt; childCount(); i++) {
+        QStringList children = ((BasketListViewItem *)child(i))-&gt;childNamesTree(deep + 1);
+        for (QStringList::iterator it = children.begin(); it != children.end(); ++it)
+            result.append(*it);
+    }
+    return result;
 }
 
 void BasketListViewItem::moveChildsBaskets()
 {
-	int insertAfterThis = 0;
-	if (!parent())
-		insertAfterThis = treeWidget()-&gt;indexOfTopLevelItem(this);
-	for (int i=0;i&lt;childCount();i++){
-		// Re-insert the item with the good parent:
-		if (parent())
-			parent()-&gt;insertChild(insertAfterThis, child(i));
-		else
-			treeWidget()-&gt;insertTopLevelItem(insertAfterThis, child(i));
-		// And move it at the good place:
-		insertAfterThis++;
-	}
+    int insertAfterThis = 0;
+    if (!parent())
+        insertAfterThis = treeWidget()-&gt;indexOfTopLevelItem(this);
+    for (int i = 0; i &lt; childCount(); i++) {
+        // Re-insert the item with the good parent:
+        if (parent())
+            parent()-&gt;insertChild(insertAfterThis, child(i));
+        else
+            treeWidget()-&gt;insertTopLevelItem(insertAfterThis, child(i));
+        // And move it at the good place:
+        insertAfterThis++;
+    }
 }
 
 void BasketListViewItem::ensureVisible()
 {
-	BasketListViewItem *item = this;
-	while (item-&gt;parent()) {
-		item = (BasketListViewItem*)(item-&gt;parent());
-		item-&gt;setExpanded(true);
-	}
+    BasketListViewItem *item = this;
+    while (item-&gt;parent()) {
+        item = (BasketListViewItem*)(item-&gt;parent());
+        item-&gt;setExpanded(true);
+    }
 }
 
 bool BasketListViewItem::isShown()
 {
-	QTreeWidgetItem *item = parent();
-	while (item) {
-		if (!item-&gt;isExpanded())
-			return false;
-		item = item-&gt;parent();
-	}
-	return true;
+    QTreeWidgetItem *item = parent();
+    while (item) {
+        if (!item-&gt;isExpanded())
+            return false;
+        item = item-&gt;parent();
+    }
+    return true;
 }
 
 bool BasketListViewItem::isCurrentBasket()
 {
-	return basket() == Global::bnpView-&gt;currentBasket();
+    return basket() == Global::bnpView-&gt;currentBasket();
 }
 
-bool BasketListViewItem::isUnderDrag(){
-	return m_isUnderDrag;
+bool BasketListViewItem::isUnderDrag()
+{
+    return m_isUnderDrag;
 }
 
 // TODO: Move this function from item.cpp to class Tools:
-extern void drawGradient( QPainter *p, const QColor &amp;colorTop, const QColor &amp; colorBottom,
-						  int x, int y, int w, int h,
-						  bool sunken, bool horz, bool flat  ); /*const*/
+extern void drawGradient(QPainter *p, const QColor &amp;colorTop, const QColor &amp; colorBottom,
+                         int x, int y, int w, int h,
+                         bool sunken, bool horz, bool flat);   /*const*/
 
 QPixmap BasketListViewItem::circledTextPixmap(const QString &amp;text, int height, const QFont &amp;font, const QColor &amp;color)
 {
-	QString key = QString(&quot;BLI-%1.%2.%3.%4&quot;)
-		.arg(text).arg(height).arg(font.toString()).arg(color.rgb());
-	if (QPixmap* cached=QPixmapCache::find(key)) {
-		return *cached;
-	}
+    QString key = QString(&quot;BLI-%1.%2.%3.%4&quot;)
+                  .arg(text).arg(height).arg(font.toString()).arg(color.rgb());
+    if (QPixmap* cached = QPixmapCache::find(key)) {
+        return *cached;
+    }
 
-	// Compute the sizes of the image components:
-	QRect textRect = QFontMetrics(font).boundingRect(0, 0, /*width=*/1, height, Qt::AlignLeft | Qt::AlignTop, text);
-	int xMargin = height / 6;
-	int width   = xMargin + textRect.width() + xMargin;
+    // Compute the sizes of the image components:
+    QRect textRect = QFontMetrics(font).boundingRect(0, 0, /*width=*/1, height, Qt::AlignLeft | Qt::AlignTop, text);
+    int xMargin = height / 6;
+    int width   = xMargin + textRect.width() + xMargin;
 
-	// Create the gradient image:
-	QPixmap gradient(3 * width, 3 * height); // We double the size to be able to smooth scale down it (== antialiased curves)
-	QPainter gradientPainter(&amp;gradient);
+    // Create the gradient image:
+    QPixmap gradient(3 * width, 3 * height); // We double the size to be able to smooth scale down it (== antialiased curves)
+    QPainter gradientPainter(&amp;gradient);
 #if 1 // Enable the new look of the gradient:
-	QColor topColor       = treeWidget()-&gt;palette().color(QPalette::Highlight).lighter(130); //120
-	QColor topMidColor    = treeWidget()-&gt;palette().color(QPalette::Highlight).lighter(105); //105
-	QColor bottomMidColor = treeWidget()-&gt;palette().color(QPalette::Highlight).darker(130);  //120
-	QColor bottomColor    = treeWidget()-&gt;palette().color(QPalette::Highlight);
-	drawGradient(&amp;gradientPainter, topColor, topMidColor,
-				  0, 0, gradient.width(), gradient.height() / 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
-	drawGradient(&amp;gradientPainter, bottomMidColor, bottomColor,
-				  0, gradient.height() / 2, gradient.width(), gradient.height() - gradient.height() / 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
-	gradientPainter.fillRect(0, 0, gradient.width(), 3, treeWidget()-&gt;palette().color(QPalette::Highlight));
+    QColor topColor       = treeWidget()-&gt;palette().color(QPalette::Highlight).lighter(130); //120
+    QColor topMidColor    = treeWidget()-&gt;palette().color(QPalette::Highlight).lighter(105); //105
+    QColor bottomMidColor = treeWidget()-&gt;palette().color(QPalette::Highlight).darker(130);  //120
+    QColor bottomColor    = treeWidget()-&gt;palette().color(QPalette::Highlight);
+    drawGradient(&amp;gradientPainter, topColor, topMidColor,
+                 0, 0, gradient.width(), gradient.height() / 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
+    drawGradient(&amp;gradientPainter, bottomMidColor, bottomColor,
+                 0, gradient.height() / 2, gradient.width(), gradient.height() - gradient.height() / 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
+    gradientPainter.fillRect(0, 0, gradient.width(), 3, treeWidget()-&gt;palette().color(QPalette::Highlight));
 #else
-	drawGradient(&amp;gradientPainter, palette().color(QPalette::Highlight), palette().color(QPalette::Highlight).darker(),
-				  0, 0, gradient.width(), gradient.height(), /*sunken=*/false, /*horz=*/true, /*flat=*/false);
+    drawGradient(&amp;gradientPainter, palette().color(QPalette::Highlight), palette().color(QPalette::Highlight).darker(),
+                 0, 0, gradient.width(), gradient.height(), /*sunken=*/false, /*horz=*/true, /*flat=*/false);
 #endif
-	gradientPainter.end();
+    gradientPainter.end();
 
-	// Draw the curved rectangle:
-	QBitmap curvedRectangle(3 * width, 3 * height);
-	curvedRectangle.fill(Qt::color0);
-	QPainter curvePainter(&amp;curvedRectangle);
-	curvePainter.setPen(Qt::color1);
-	curvePainter.setBrush(Qt::color1);
-	curvePainter.setClipRect(0, 0, 3*(height / 5), 3*(height)); // If the width is small, don't fill the right part of the pixmap
-	curvePainter.drawEllipse(0, 3*(-height / 4), 3*(height), 3*(height * 3 / 2)); // Don't forget we double the sizes
-	curvePainter.setClipRect(3*(width - height / 5), 0, 3*(height / 5), 3*(height));
-	curvePainter.drawEllipse(3*(width - height), 3*(-height / 4), 3*(height), 3*(height * 3 / 2));
-	curvePainter.setClipping(false);
-	curvePainter.fillRect(3*(height / 6), 0, 3*(width - 2 * height / 6), 3*(height), curvePainter.brush());
-	curvePainter.end();
+    // Draw the curved rectangle:
+    QBitmap curvedRectangle(3 * width, 3 * height);
+    curvedRectangle.fill(Qt::color0);
+    QPainter curvePainter(&amp;curvedRectangle);
+    curvePainter.setPen(Qt::color1);
+    curvePainter.setBrush(Qt::color1);
+    curvePainter.setClipRect(0, 0, 3*(height / 5), 3*(height)); // If the width is small, don't fill the right part of the pixmap
+    curvePainter.drawEllipse(0, 3*(-height / 4), 3*(height), 3*(height * 3 / 2)); // Don't forget we double the sizes
+    curvePainter.setClipRect(3*(width - height / 5), 0, 3*(height / 5), 3*(height));
+    curvePainter.drawEllipse(3*(width - height), 3*(-height / 4), 3*(height), 3*(height * 3 / 2));
+    curvePainter.setClipping(false);
+    curvePainter.fillRect(3*(height / 6), 0, 3*(width - 2 * height / 6), 3*(height), curvePainter.brush());
+    curvePainter.end();
 
-	// Apply the curved rectangle as the mask of the gradient:
-	gradient.setMask(curvedRectangle);
-	QImage resultImage = gradient.toImage();
+    // Apply the curved rectangle as the mask of the gradient:
+    gradient.setMask(curvedRectangle);
+    QImage resultImage = gradient.toImage();
 
-	//resultImage.setAlphaBuffer(true);
-	resultImage.convertToFormat(QImage::Format_ARGB32);
+    //resultImage.setAlphaBuffer(true);
+    resultImage.convertToFormat(QImage::Format_ARGB32);
 
-	// Scale down the image smoothly to get anti-aliasing:
-	QPixmap pmScaled = QPixmap::fromImage(resultImage.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+    // Scale down the image smoothly to get anti-aliasing:
+    QPixmap pmScaled = QPixmap::fromImage(resultImage.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
 
-	// Draw the text, and return the result:
-	QPainter painter(&amp;pmScaled);
-	painter.setPen(color);
-	painter.setFont(font);
-	painter.drawText(0+1, 0, width, height, Qt::AlignHCenter | Qt::AlignVCenter, text);
-	painter.end();
+    // Draw the text, and return the result:
+    QPainter painter(&amp;pmScaled);
+    painter.setPen(color);
+    painter.setFont(font);
+    painter.drawText(0 + 1, 0, width, height, Qt::AlignHCenter | Qt::AlignVCenter, text);
+    painter.end();
 
-	QPixmapCache::insert(key, pmScaled);
+    QPixmapCache::insert(key, pmScaled);
 
-	return pmScaled;
+    return pmScaled;
 }
 
 QPixmap BasketListViewItem::foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &amp;font, int height)
 {
-	if (isLoading)
-		return QPixmap();
-
-	QFont boldFont(font);
-	boldFont.setBold(true);
-
-	QString text;
-	if (childsAreLoading) {
-		if (countChildsFound &gt; 0)
-			text = i18n(&quot;%1+%2+&quot;, QString::number(countFound), QString::number(countChildsFound));
-		else
-			text = i18n(&quot;%1+&quot;, QString::number(countFound));
-	} else {
-		if (countChildsFound &gt; 0)
-			text = i18n(&quot;%1+%2&quot;, QString::number(countFound), QString::number(countChildsFound));
-		else if (countFound &gt; 0)
-			text = QString::number(countFound);
-		else
-			return QPixmap();
-	}
+    if (isLoading)
+        return QPixmap();
+
+    QFont boldFont(font);
+    boldFont.setBold(true);
+
+    QString text;
+    if (childsAreLoading) {
+        if (countChildsFound &gt; 0)
+            text = i18n(&quot;%1+%2+&quot;, QString::number(countFound), QString::number(countChildsFound));
+        else
+            text = i18n(&quot;%1+&quot;, QString::number(countFound));
+    } else {
+        if (countChildsFound &gt; 0)
+            text = i18n(&quot;%1+%2&quot;, QString::number(countFound), QString::number(countChildsFound));
+        else if (countFound &gt; 0)
+            text = QString::number(countFound);
+        else
+            return QPixmap();
+    }
 
-	return circledTextPixmap(text, height, boldFont, treeWidget()-&gt;palette().color(QPalette::HighlightedText));
+    return circledTextPixmap(text, height, boldFont, treeWidget()-&gt;palette().color(QPalette::HighlightedText));
 }
 
 bool BasketListViewItem::haveChildsLoading()
 {
-	for (int i=0;i&lt;childCount();i++){
-		BasketListViewItem *childItem = (BasketListViewItem*)child(i);
-		if (!childItem-&gt;basket()-&gt;isLoaded() &amp;&amp; !childItem-&gt;basket()-&gt;isLocked())
-			return true;
-		if (childItem-&gt;haveChildsLoading())
-			return true;
-	}
-	return false;
+    for (int i = 0; i &lt; childCount(); i++) {
+        BasketListViewItem *childItem = (BasketListViewItem*)child(i);
+        if (!childItem-&gt;basket()-&gt;isLoaded() &amp;&amp; !childItem-&gt;basket()-&gt;isLocked())
+            return true;
+        if (childItem-&gt;haveChildsLoading())
+            return true;
+    }
+    return false;
 }
 
 bool BasketListViewItem::haveHiddenChildsLoading()
 {
-	if (isExpanded())
-		return false;
-	return haveChildsLoading();
+    if (isExpanded())
+        return false;
+    return haveChildsLoading();
 }
 
 bool BasketListViewItem::haveChildsLocked()
 {
-	for (int i=0; i&lt;childCount(); i++){
-		BasketListViewItem *childItem = (BasketListViewItem*)child(i);
-		if (/*!*/childItem-&gt;basket()-&gt;isLocked())
-			return true;
-		if (childItem-&gt;haveChildsLocked())
-			return true;
-	}
-	return false;
+    for (int i = 0; i &lt; childCount(); i++) {
+        BasketListViewItem *childItem = (BasketListViewItem*)child(i);
+        if (/*!*/childItem-&gt;basket()-&gt;isLocked())
+            return true;
+        if (childItem-&gt;haveChildsLocked())
+            return true;
+    }
+    return false;
 }
 
 bool BasketListViewItem::haveHiddenChildsLocked()
 {
-	if (isExpanded())
-		return false;
-	return haveChildsLocked();
+    if (isExpanded())
+        return false;
+    return haveChildsLocked();
 }
 
 int BasketListViewItem::countChildsFound()
 {
-	int count = 0;
-	for (int i=0;i&lt;childCount();i++){
-		BasketListViewItem *childItem = (BasketListViewItem*)child(i);
-		count += childItem-&gt;basket()-&gt;countFounds();
-		count += childItem-&gt;countChildsFound();
-	}
-	return count;
+    int count = 0;
+    for (int i = 0; i &lt; childCount(); i++) {
+        BasketListViewItem *childItem = (BasketListViewItem*)child(i);
+        count += childItem-&gt;basket()-&gt;countFounds();
+        count += childItem-&gt;countChildsFound();
+    }
+    return count;
 }
 
 int BasketListViewItem::countHiddenChildsFound()
 {
-	if (isExpanded())
-		return 0;
-	return countChildsFound();
+    if (isExpanded())
+        return 0;
+    return countChildsFound();
 }
 
 void BasketListViewItem::setUnderDrag(bool underDrag)
 {
-	m_isUnderDrag = underDrag;
+    m_isUnderDrag = underDrag;
 }
 
 bool BasketListViewItem::isAbbreviated()
 {
-	return m_isAbbreviated;
+    return m_isAbbreviated;
 }
 
-void BasketListViewItem::setAbbreviated(bool b){
-	m_isAbbreviated = b;
+void BasketListViewItem::setAbbreviated(bool b)
+{
+    m_isAbbreviated = b;
 }
 
 /** class BasketTreeListView: */
 
 BasketTreeListView::BasketTreeListView(QWidget *parent)
-	: QTreeWidget(parent), m_autoOpenItem(0)
-	, m_itemUnderDrag(0)
+        : QTreeWidget(parent), m_autoOpenItem(0)
+        , m_itemUnderDrag(0)
 {
-	connect( &amp;m_autoOpenTimer, SIGNAL(timeout()), this, SLOT(autoOpen()) );
+    connect(&amp;m_autoOpenTimer, SIGNAL(timeout()), this, SLOT(autoOpen()));
 }
 
-void BasketTreeListView::contextMenuEvent(QContextMenuEvent *e){
-	emit contextMenuRequested(e-&gt;pos());
+void BasketTreeListView::contextMenuEvent(QContextMenuEvent *e)
+{
+    emit contextMenuRequested(e-&gt;pos());
 }
 
 bool BasketTreeListView::event(QEvent *e)
 {
-	if (e-&gt;type() == QEvent::ToolTip) {
-		QHelpEvent *he = static_cast&lt;QHelpEvent *&gt;(e);
-		QTreeWidgetItem *item = itemAt(he-&gt;pos());
-		BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
-		if (bitem &amp;&amp; bitem-&gt;isAbbreviated()) {
-			QRect rect = visualItemRect(bitem);
-			QToolTip::showText(rect.topLeft(), bitem-&gt;basket()-&gt;basketName(),
-							   viewport(), rect);
-		}
-		return true;
-	}
-	return QTreeWidget::event(e);
+    if (e-&gt;type() == QEvent::ToolTip) {
+        QHelpEvent *he = static_cast&lt;QHelpEvent *&gt;(e);
+        QTreeWidgetItem *item = itemAt(he-&gt;pos());
+        BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
+        if (bitem &amp;&amp; bitem-&gt;isAbbreviated()) {
+            QRect rect = visualItemRect(bitem);
+            QToolTip::showText(rect.topLeft(), bitem-&gt;basket()-&gt;basketName(),
+                               viewport(), rect);
+        }
+        return true;
+    }
+    return QTreeWidget::event(e);
 }
 
 void BasketTreeListView::dragEnterEvent(QDragEnterEvent *event)
 {
-	if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;)){
-		QTreeWidgetItemIterator it(this); // TODO: Don't show expanders if it's not a basket drag...
-		while (*it) {
-			QTreeWidgetItem *item = *it;
-			if (item-&gt;childCount() &lt;= 0) {
-				item-&gt;setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
-				item-&gt;setExpanded(true);
-			}
-			++it;
-		}
-		update();
-	}
+    if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;)) {
+        QTreeWidgetItemIterator it(this); // TODO: Don't show expanders if it's not a basket drag...
+        while (*it) {
+            QTreeWidgetItem *item = *it;
+            if (item-&gt;childCount() &lt;= 0) {
+                item-&gt;setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
+                item-&gt;setExpanded(true);
+            }
+            ++it;
+        }
+        update();
+    }
 
-	QTreeWidget::dragEnterEvent(event);
+    QTreeWidget::dragEnterEvent(event);
 }
 
 void BasketTreeListView::removeExpands()
 {
-	QTreeWidgetItemIterator it(this);
-	while (*it) {
-		QTreeWidgetItem *item = *it;
-		if (item-&gt;childCount() &lt;= 0)
-			item-&gt;setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
-		++it;
-	}
+    QTreeWidgetItemIterator it(this);
+    while (*it) {
+        QTreeWidgetItem *item = *it;
+        if (item-&gt;childCount() &lt;= 0)
+            item-&gt;setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
+        ++it;
+    }
 }
 
 
 void BasketTreeListView::dragLeaveEvent(QDragLeaveEvent *event)
 {
-	kDebug() &lt;&lt; &quot;BasketTreeListView::dragLeaveEvent&quot;;
-	m_autoOpenItem = 0;
-	m_autoOpenTimer.stop();
-	setItemUnderDrag(0);
-	removeExpands();
-	QTreeWidget::dragLeaveEvent(event);
+    kDebug() &lt;&lt; &quot;BasketTreeListView::dragLeaveEvent&quot;;
+    m_autoOpenItem = 0;
+    m_autoOpenTimer.stop();
+    setItemUnderDrag(0);
+    removeExpands();
+    QTreeWidget::dragLeaveEvent(event);
 }
 
 void BasketTreeListView::dropEvent(QDropEvent *event)
 {
-	kDebug() &lt;&lt; &quot;BasketTreeListView::dropEvent()&quot;;
-	if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;))
-	{
-		QTreeWidget::dropEvent(event);
-	}
-	else {
-		kDebug() &lt;&lt; &quot;Forwarding dropped data to the basket&quot;;
-		QTreeWidgetItem *item = itemAt(event-&gt;pos());
-		BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
-		if (bitem) {
-			bitem-&gt;basket()-&gt;blindDrop(event);
-		}
-		else {
-			kDebug() &lt;&lt; &quot;Forwarding failed: no bitem found&quot;;
-		}
+    kDebug() &lt;&lt; &quot;BasketTreeListView::dropEvent()&quot;;
+    if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;)) {
+        QTreeWidget::dropEvent(event);
+    } else {
+        kDebug() &lt;&lt; &quot;Forwarding dropped data to the basket&quot;;
+        QTreeWidgetItem *item = itemAt(event-&gt;pos());
+        BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
+        if (bitem) {
+            bitem-&gt;basket()-&gt;blindDrop(event);
+        } else {
+            kDebug() &lt;&lt; &quot;Forwarding failed: no bitem found&quot;;
         }
+    }
 
-	m_autoOpenItem = 0;
-	m_autoOpenTimer.stop();
-	setItemUnderDrag(0);
-	removeExpands();
+    m_autoOpenItem = 0;
+    m_autoOpenTimer.stop();
+    setItemUnderDrag(0);
+    removeExpands();
 
-	Global::bnpView-&gt;save(); // TODO: Don't save if it was not a basket drop...
+    Global::bnpView-&gt;save(); // TODO: Don't save if it was not a basket drop...
 }
 
 void BasketTreeListView::dragMoveEvent(QDragMoveEvent *event)
 {
-	kDebug() &lt;&lt; &quot;BasketTreeListView::dragMoveEvent&quot;;
-	if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;))
-		QTreeWidget::dragMoveEvent(event);
-	else {
-		QTreeWidgetItem *item = itemAt(event-&gt;pos());
-		BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
-		if (m_autoOpenItem != item) {
-			m_autoOpenItem = item;
-			m_autoOpenTimer.setSingleShot(true);
-			m_autoOpenTimer.start(1700);
-		}
-		if (item) {
-			event-&gt;accept();
-		}
-		setItemUnderDrag(bitem);
-
-		QTreeWidget::dragMoveEvent(event); // FIXME: ADDED
-	}
+    kDebug() &lt;&lt; &quot;BasketTreeListView::dragMoveEvent&quot;;
+    if (event-&gt;provides(&quot;application/x-qabstractitemmodeldatalist&quot;))
+        QTreeWidget::dragMoveEvent(event);
+    else {
+        QTreeWidgetItem *item = itemAt(event-&gt;pos());
+        BasketListViewItem* bitem = dynamic_cast&lt;BasketListViewItem*&gt;(item);
+        if (m_autoOpenItem != item) {
+            m_autoOpenItem = item;
+            m_autoOpenTimer.setSingleShot(true);
+            m_autoOpenTimer.start(1700);
+        }
+        if (item) {
+            event-&gt;accept();
+        }
+        setItemUnderDrag(bitem);
+
+        QTreeWidget::dragMoveEvent(event); // FIXME: ADDED
+    }
 }
 
 void BasketTreeListView::setItemUnderDrag(BasketListViewItem* item)
 {
-	if (m_itemUnderDrag != item) {
-		if (m_itemUnderDrag) {
-			// Remove drag status from the old item
-			m_itemUnderDrag-&gt;setUnderDrag(false);
-		}
+    if (m_itemUnderDrag != item) {
+        if (m_itemUnderDrag) {
+            // Remove drag status from the old item
+            m_itemUnderDrag-&gt;setUnderDrag(false);
+        }
 
-		m_itemUnderDrag = item;
+        m_itemUnderDrag = item;
 
-		if (m_itemUnderDrag) {
-			// add drag status to the new item
-			m_itemUnderDrag-&gt;setUnderDrag(true);
-		}
-	}
+        if (m_itemUnderDrag) {
+            // add drag status to the new item
+            m_itemUnderDrag-&gt;setUnderDrag(true);
+        }
+    }
 }
 
 void BasketTreeListView::autoOpen()
 {
-	BasketListViewItem *item = (BasketListViewItem*)m_autoOpenItem;
-	if (item)
-		Global::bnpView-&gt;setCurrentBasket(item-&gt;basket());
+    BasketListViewItem *item = (BasketListViewItem*)m_autoOpenItem;
+    if (item)
+        Global::bnpView-&gt;setCurrentBasket(item-&gt;basket());
 }
 
 void BasketTreeListView::resizeEvent(QResizeEvent *event)
 {
-	QTreeWidget::resizeEvent(event);
+    QTreeWidget::resizeEvent(event);
 }
 
 /** We should NEVER get focus (because of QWidget::NoFocus focusPolicy())
@@ -513,12 +513,12 @@ void BasketTreeListView::resizeEvent(QResizeEvent *event)
  */
 void BasketTreeListView::focusInEvent(QFocusEvent*)
 {
-	Basket *basket = Global::bnpView-&gt;currentBasket();
-	if (basket)
-		basket-&gt;setFocus();
+    Basket *basket = Global::bnpView-&gt;currentBasket();
+    if (basket)
+        basket-&gt;setFocus();
 }
 
-Qt::DropActions BasketTreeListView::supportedDropActions () const
+Qt::DropActions BasketTreeListView::supportedDropActions() const
 {
-	return Qt::MoveAction | Qt::IgnoreAction;
+    return Qt::MoveAction | Qt::IgnoreAction;
 }</diff>
      <filename>src/basketlistview.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -38,75 +38,77 @@ class Basket;
 
 class BasketListViewItem : public QTreeWidgetItem
 {
-	public:
-	/// CONSTRUCTOR AND DESTRUCTOR:
-		BasketListViewItem(QTreeWidget *parent, Basket *basket);
-		BasketListViewItem(QTreeWidgetItem *parent, Basket *basket);
-		BasketListViewItem(QTreeWidget *parent, QTreeWidgetItem *after, Basket *basket);
-		BasketListViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *after, Basket *basket);
-		~BasketListViewItem();
+public:
+    /// CONSTRUCTOR AND DESTRUCTOR:
+    BasketListViewItem(QTreeWidget *parent, Basket *basket);
+    BasketListViewItem(QTreeWidgetItem *parent, Basket *basket);
+    BasketListViewItem(QTreeWidget *parent, QTreeWidgetItem *after, Basket *basket);
+    BasketListViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *after, Basket *basket);
+    ~BasketListViewItem();
 
-		Basket *basket() { return m_basket; }
-		void setup();
-		BasketListViewItem* lastChild();
-		QStringList childNamesTree(int deep = 0);
-		void moveChildsBaskets();
-		void ensureVisible();
-		bool isShown();
-		bool isCurrentBasket();
-		bool isUnderDrag();
-		QString escapedName(const QString &amp;string);
+    Basket *basket() {
+        return m_basket;
+    }
+    void setup();
+    BasketListViewItem* lastChild();
+    QStringList childNamesTree(int deep = 0);
+    void moveChildsBaskets();
+    void ensureVisible();
+    bool isShown();
+    bool isCurrentBasket();
+    bool isUnderDrag();
+    QString escapedName(const QString &amp;string);
 
-		QPixmap circledTextPixmap(const QString &amp;text, int height, const QFont &amp;font, const QColor &amp;color);
-		QPixmap foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &amp;font, int height);
-		bool haveChildsLoading();
-		bool haveHiddenChildsLoading();
-		bool haveChildsLocked();
-		bool haveHiddenChildsLocked();
-		int countChildsFound();
-		int countHiddenChildsFound();
+    QPixmap circledTextPixmap(const QString &amp;text, int height, const QFont &amp;font, const QColor &amp;color);
+    QPixmap foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &amp;font, int height);
+    bool haveChildsLoading();
+    bool haveHiddenChildsLoading();
+    bool haveChildsLocked();
+    bool haveHiddenChildsLocked();
+    int countChildsFound();
+    int countHiddenChildsFound();
 
-		void setUnderDrag(bool);
-		bool isAbbreviated();
-		void setAbbreviated(bool b);
+    void setUnderDrag(bool);
+    bool isAbbreviated();
+    void setAbbreviated(bool b);
 
-	private:
-		Basket *m_basket;
-		int     m_width;
-		bool m_isUnderDrag;
-		bool m_isAbbreviated;
+private:
+    Basket *m_basket;
+    int     m_width;
+    bool m_isUnderDrag;
+    bool m_isAbbreviated;
 };
 
 Q_DECLARE_METATYPE(BasketListViewItem *);
 
 class BasketTreeListView : public QTreeWidget
 {
-	Q_OBJECT
-	public:
-		BasketTreeListView(QWidget *parent = 0);
-		void dragEnterEvent(QDragEnterEvent *event);
-		void removeExpands();
-		void dragLeaveEvent(QDragLeaveEvent *event);
-		void dragMoveEvent(QDragMoveEvent *event);
-		void dropEvent(QDropEvent *event);
-		void resizeEvent(QResizeEvent *event);
-		void contextMenuEvent(QContextMenuEvent *event);
-		Qt::DropActions supportedDropActions() const;
-	protected:
-		bool event(QEvent *e);
-		void focusInEvent(QFocusEvent*);
-	private:
-		QTimer         m_autoOpenTimer;
-		QTreeWidgetItem *m_autoOpenItem;
-	signals:
-		void itemActivated(QTreeWidgetItem *, int column);
-		void itemPressed(QTreeWidgetItem *, int column);
-		void contextMenuRequested(const QPoint &amp;);
-	private slots:
-		void autoOpen();
-	private:
-		void setItemUnderDrag(BasketListViewItem* item);
-		BasketListViewItem* m_itemUnderDrag;
+    Q_OBJECT
+public:
+    BasketTreeListView(QWidget *parent = 0);
+    void dragEnterEvent(QDragEnterEvent *event);
+    void removeExpands();
+    void dragLeaveEvent(QDragLeaveEvent *event);
+    void dragMoveEvent(QDragMoveEvent *event);
+    void dropEvent(QDropEvent *event);
+    void resizeEvent(QResizeEvent *event);
+    void contextMenuEvent(QContextMenuEvent *event);
+    Qt::DropActions supportedDropActions() const;
+protected:
+    bool event(QEvent *e);
+    void focusInEvent(QFocusEvent*);
+private:
+    QTimer         m_autoOpenTimer;
+    QTreeWidgetItem *m_autoOpenItem;
+signals:
+    void itemActivated(QTreeWidgetItem *, int column);
+    void itemPressed(QTreeWidgetItem *, int column);
+    void contextMenuRequested(const QPoint &amp;);
+private slots:
+    void autoOpen();
+private:
+    void setItemUnderDrag(BasketListViewItem* item);
+    BasketListViewItem* m_itemUnderDrag;
 };
 
 #endif // BASKETLISTVIEW_H</diff>
      <filename>src/basketlistview.h</filename>
    </modified>
    <modified>
      <diff>@@ -47,178 +47,178 @@
 #include &quot;backgroundmanager.h&quot;
 
 BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
-     : KDialog(parent)
-     , m_basket(basket)
+        : KDialog(parent)
+        , m_basket(basket)
 {
-	// Set up dialog options
-	setCaption(i18n(&quot;Basket Properties&quot;));
-	setButtons(Ok | Apply | Cancel);
-	setDefaultButton(Ok);
-	setObjectName(&quot;BasketProperties&quot;);
-	setModal(true);
-	showButtonSeparator(false);
-
-	QWidget *page = new QWidget(this);
-	QVBoxLayout *topLayout = new QVBoxLayout(page);
-
-	// Icon and Name:
-	QHBoxLayout *nameLayout = new QHBoxLayout(0);
-	int margin = marginHint()*2/3;
-	nameLayout-&gt;setContentsMargins(margin, margin, margin, margin);
-	m_icon = new KIconButton(page);
-	m_icon-&gt;setIconType(KIconLoader::NoGroup, KIconLoader::Action);
-	m_icon-&gt;setIconSize(16);
-	m_icon-&gt;setIcon(m_basket-&gt;icon());
-	int size = qMax(m_icon-&gt;sizeHint().width(), m_icon-&gt;sizeHint().height());
-	m_icon-&gt;setFixedSize(size, size); // Make it square!
-	m_icon-&gt;setToolTip(i18n(&quot;Icon&quot;));
-	m_name = new QLineEdit(m_basket-&gt;basketName(), page);
-	m_name-&gt;setMinimumWidth(m_name-&gt;fontMetrics().maxWidth()*20);
-	m_name-&gt;setToolTip(i18n(&quot;Name&quot;));
-	nameLayout-&gt;addWidget(m_icon);
-	nameLayout-&gt;addWidget(m_name);
-	topLayout-&gt;addLayout(nameLayout);
-
-	// Appearance:
-	QGroupBox *appearance = new QGroupBox(i18n(&quot;Appearance&quot;), page);
-	QVBoxLayout* appearanceLayout = new QVBoxLayout;
-	appearance-&gt;setLayout(appearanceLayout);
-	QWidget *appearanceWidget = new QWidget;
-	appearanceLayout-&gt;addWidget(appearanceWidget);
-
-	//QGridLayout *grid = new QGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
-	QGridLayout *grid = new QGridLayout(appearanceWidget);
-
-	m_backgroundImage = new QComboBox(appearanceWidget);
-	m_backgroundColor = new KColorCombo2(m_basket-&gt;backgroundColorSetting(), palette().color(QPalette::Base), appearanceWidget);
-	m_textColor       = new KColorCombo2(m_basket-&gt;textColorSetting(),       palette().color(QPalette::Text), appearanceWidget);
-
-	QLabel *label1 = new QLabel(appearanceWidget);
-	label1-&gt;setBuddy(m_backgroundImage);
-	label1-&gt;setText(i18n(&quot;Background &amp;image:&quot;));
-
-	QLabel *label2 = new QLabel(appearanceWidget);
-	label2-&gt;setBuddy(m_backgroundColor);
-	label2-&gt;setText(i18n(&quot;&amp;Background color:&quot;));
-
-	QLabel *label3 = new QLabel(appearanceWidget);
-	label3-&gt;setBuddy(m_textColor);
-	label3-&gt;setText(i18n(&quot;&amp;Text color:&quot;));
-
-	grid-&gt;addWidget(label1,            0, 0, Qt::AlignVCenter);
-	grid-&gt;addWidget(label2,            1, 0, Qt::AlignVCenter);
-	grid-&gt;addWidget(label3,            2, 0, Qt::AlignVCenter);
-	grid-&gt;addWidget(m_backgroundImage, 0, 1, Qt::AlignVCenter);
-	grid-&gt;addWidget(m_backgroundColor, 1, 1, Qt::AlignVCenter);
-	grid-&gt;addWidget(m_textColor,       2, 1, Qt::AlignVCenter);
-	topLayout-&gt;addWidget(appearance);
-
-	m_backgroundImage-&gt;addItem(i18n(&quot;(None)&quot;));
-	m_backgroundImagesMap.insert(0, &quot;&quot;);
-	m_backgroundImage-&gt;setIconSize ( QSize(100,75));
-	QStringList backgrounds = Global::backgroundManager-&gt;imageNames();
-	int index = 1;
-	for (QStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
-		QPixmap *preview = Global::backgroundManager-&gt;preview(*it);
-		if (preview) {
-			m_backgroundImagesMap.insert(index, *it);
-			m_backgroundImage-&gt;insertItem(index, *it);
-			m_backgroundImage-&gt;setItemData(index,*preview,Qt::DecorationRole);
-			if (m_basket-&gt;backgroundImageName() == *it)
-				m_backgroundImage-&gt;setCurrentIndex(index);
-			index++;
-		}
-	}
-//	m_backgroundImage-&gt;insertItem(i18n(&quot;Other...&quot;), -1);
-	int BUTTON_MARGIN = kapp-&gt;style()-&gt;pixelMetric(QStyle::PM_ButtonMargin);
-	m_backgroundImage-&gt;setMaxVisibleItems(50/*75 * 6 / m_backgroundImage-&gt;sizeHint().height()*/);
-	m_backgroundImage-&gt;setMinimumHeight(75 + 2 * BUTTON_MARGIN);
-
-	// Disposition:
-	m_disposition = new QGroupBox(i18n(&quot;Disposition&quot;), page);
-	QButtonGroup* bg = new QButtonGroup(m_disposition);
-
-	QVBoxLayout* dispLayout = new QVBoxLayout;
-	m_disposition-&gt;setLayout(dispLayout);
-
-	columnForm = new QRadioButton(i18n(&quot;Col&amp;umns:&quot;), m_disposition);
-	dispLayout-&gt;addWidget(columnForm);
-	bg-&gt;addButton(columnForm);
-	
-	m_columnCount = new KIntNumInput(m_basket-&gt;columnsCount(), m_disposition);
-	m_columnCount-&gt;setRange(1, 20, /*step=*/1);
-	m_columnCount-&gt;setSliderEnabled(false);
-	m_columnCount-&gt;setValue(m_basket-&gt;columnsCount());
-	connect( m_columnCount, SIGNAL(valueChanged(int)), this, SLOT(selectColumnsLayout()) );
-	dispLayout-&gt;addWidget(m_columnCount);
-
-	freeForm = new QRadioButton(i18n(&quot;&amp;Free-form&quot;), m_disposition);
-	dispLayout-&gt;addWidget(freeForm);
-	bg-&gt;addButton(freeForm);
-
-	mindMap = new QRadioButton(i18n(&quot;&amp;Mind map&quot;), m_disposition); // TODO: &quot;Learn more...&quot;
-	dispLayout-&gt;addWidget(mindMap);
-	bg-&gt;addButton(mindMap);
-	
-	int height = qMax(mindMap-&gt;sizeHint().height(), m_columnCount-&gt;sizeHint().height()); // Make all radioButtons vertically equaly-spaced!
-	mindMap-&gt;setMinimumSize(mindMap-&gt;sizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
-	if (!m_basket-&gt;isFreeLayout())
-		columnForm-&gt;setChecked(true);
-	else if (m_basket-&gt;isMindMap())
-		mindMap-&gt;setChecked(true);
-	else
-		freeForm-&gt;setChecked(true);
-	topLayout-&gt;addWidget(m_disposition);
-
-	mindMap-&gt;hide();
-
-	// Keyboard Shortcut:
-	m_shortcutRole = new QGroupBox(i18n(&quot;&amp;Keyboard Shortcut&quot;), page);
-	m_shortcutRoleLayout = new QVBoxLayout;
-	m_shortcutRole-&gt;setLayout(m_shortcutRoleLayout);
-	QWidget *shortcutWidget = new QWidget;
-	m_shortcutRoleLayout-&gt;addWidget(shortcutWidget);
-	QHBoxLayout *shortcutLayout = new QHBoxLayout(shortcutWidget);
-	m_shortcut = new KShortcutWidget(shortcutWidget);
-	m_shortcut-&gt;setShortcut(m_basket-&gt;shortcut());
-	HelpLabel *helpLabel = new HelpLabel(i18n(&quot;Learn some tips...&quot;), i18n(
-		&quot;&lt;p&gt;&lt;strong&gt;Easily Remember your Shortcuts&lt;/strong&gt;:&lt;br&gt;&quot;
-		&quot;With the first option, giving the basket a shortcut of the form &lt;strong&gt;Alt+Letter&lt;/strong&gt; will underline that letter in the basket tree.&lt;br&gt;&quot;
-		&quot;For instance, if you are assigning the shortcut &lt;i&gt;Alt+T&lt;/i&gt; to a basket named &lt;i&gt;Tips&lt;/i&gt;, the basket will be displayed as &lt;i&gt;&lt;u&gt;T&lt;/u&gt;ips&lt;/i&gt; in the tree. &quot;
-		&quot;It helps you visualize the shortcuts to remember them more quickly.&lt;/p&gt;&quot;
-		&quot;&lt;p&gt;&lt;strong&gt;Local vs Global&lt;/strong&gt;:&lt;br&gt;&quot;
-		&quot;The first option allows to show the basket while the main window is active. &quot;
-		&quot;Global shortcuts are valid from anywhere, even if the window is hidden.&lt;/p&gt;&quot;
-		&quot;&lt;p&gt;&lt;strong&gt;Show vs Switch&lt;/strong&gt;:&lt;br&gt;&quot;
-		&quot;The last option makes this basket the current one without opening the main window. &quot;
-		&quot;It is useful in addition to the configurable global shortcuts, eg. to paste the clipboard or the selection into the current basket from anywhere.&lt;/p&gt;&quot;),
-		shortcutWidget);
-	shortcutLayout-&gt;addWidget(m_shortcut);
-	shortcutLayout-&gt;addStretch();
-	shortcutLayout-&gt;addWidget(helpLabel);
-	connect( m_shortcut, SIGNAL(shortcutChanged(const KShortcut&amp;)), this, SLOT(capturedShortcut(const KShortcut&amp;)) );
-	m_showButton = new QRadioButton(i18n(&quot;S&amp;how this basket&quot;));
-	m_globalButton = new QRadioButton(i18n(&quot;Show this basket (&amp;global shortcut)&quot;));
-	m_switchButton = new QRadioButton(i18n(&quot;S&amp;witch to this basket (global shortcut)&quot;));
-	m_shortcutRoleLayout-&gt;addWidget(m_showButton);
-	m_shortcutRoleLayout-&gt;addWidget(m_globalButton);
-	m_shortcutRoleLayout-&gt;addWidget(m_switchButton);
-	switch (m_basket-&gt;shortcutAction()){
-		default:
-		case 0: m_showButton-&gt;setChecked(true); break;
-		case 1: m_globalButton-&gt;setChecked(true); break;
-		case 2: m_switchButton-&gt;setChecked(true); break;
-	}
-	topLayout-&gt;addWidget(m_shortcutRole);
-
-	topLayout-&gt;addSpacing(marginHint());
-	topLayout-&gt;addStretch(10);
-
-	// Connect the Ok and Apply buttons to actually apply the changes
-	connect(this, SIGNAL(okClicked()), this, SLOT(applyChanges()));
-	connect(this, SIGNAL(applyClicked()), this, SLOT(applyChanges()));
-
-	setMainWidget(page);
+    // Set up dialog options
+    setCaption(i18n(&quot;Basket Properties&quot;));
+    setButtons(Ok | Apply | Cancel);
+    setDefaultButton(Ok);
+    setObjectName(&quot;BasketProperties&quot;);
+    setModal(true);
+    showButtonSeparator(false);
+
+    QWidget *page = new QWidget(this);
+    QVBoxLayout *topLayout = new QVBoxLayout(page);
+
+    // Icon and Name:
+    QHBoxLayout *nameLayout = new QHBoxLayout(0);
+    int margin = marginHint() * 2 / 3;
+    nameLayout-&gt;setContentsMargins(margin, margin, margin, margin);
+    m_icon = new KIconButton(page);
+    m_icon-&gt;setIconType(KIconLoader::NoGroup, KIconLoader::Action);
+    m_icon-&gt;setIconSize(16);
+    m_icon-&gt;setIcon(m_basket-&gt;icon());
+    int size = qMax(m_icon-&gt;sizeHint().width(), m_icon-&gt;sizeHint().height());
+    m_icon-&gt;setFixedSize(size, size); // Make it square!
+    m_icon-&gt;setToolTip(i18n(&quot;Icon&quot;));
+    m_name = new QLineEdit(m_basket-&gt;basketName(), page);
+    m_name-&gt;setMinimumWidth(m_name-&gt;fontMetrics().maxWidth()*20);
+    m_name-&gt;setToolTip(i18n(&quot;Name&quot;));
+    nameLayout-&gt;addWidget(m_icon);
+    nameLayout-&gt;addWidget(m_name);
+    topLayout-&gt;addLayout(nameLayout);
+
+    // Appearance:
+    QGroupBox *appearance = new QGroupBox(i18n(&quot;Appearance&quot;), page);
+    QVBoxLayout* appearanceLayout = new QVBoxLayout;
+    appearance-&gt;setLayout(appearanceLayout);
+    QWidget *appearanceWidget = new QWidget;
+    appearanceLayout-&gt;addWidget(appearanceWidget);
+
+    //QGridLayout *grid = new QGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
+    QGridLayout *grid = new QGridLayout(appearanceWidget);
+
+    m_backgroundImage = new QComboBox(appearanceWidget);
+    m_backgroundColor = new KColorCombo2(m_basket-&gt;backgroundColorSetting(), palette().color(QPalette::Base), appearanceWidget);
+    m_textColor       = new KColorCombo2(m_basket-&gt;textColorSetting(),       palette().color(QPalette::Text), appearanceWidget);
+
+    QLabel *label1 = new QLabel(appearanceWidget);
+    label1-&gt;setBuddy(m_backgroundImage);
+    label1-&gt;setText(i18n(&quot;Background &amp;image:&quot;));
+
+    QLabel *label2 = new QLabel(appearanceWidget);
+    label2-&gt;setBuddy(m_backgroundColor);
+    label2-&gt;setText(i18n(&quot;&amp;Background color:&quot;));
+
+    QLabel *label3 = new QLabel(appearanceWidget);
+    label3-&gt;setBuddy(m_textColor);
+    label3-&gt;setText(i18n(&quot;&amp;Text color:&quot;));
+
+    grid-&gt;addWidget(label1,            0, 0, Qt::AlignVCenter);
+    grid-&gt;addWidget(label2,            1, 0, Qt::AlignVCenter);
+    grid-&gt;addWidget(label3,            2, 0, Qt::AlignVCenter);
+    grid-&gt;addWidget(m_backgroundImage, 0, 1, Qt::AlignVCenter);
+    grid-&gt;addWidget(m_backgroundColor, 1, 1, Qt::AlignVCenter);
+    grid-&gt;addWidget(m_textColor,       2, 1, Qt::AlignVCenter);
+    topLayout-&gt;addWidget(appearance);
+
+    m_backgroundImage-&gt;addItem(i18n(&quot;(None)&quot;));
+    m_backgroundImagesMap.insert(0, &quot;&quot;);
+    m_backgroundImage-&gt;setIconSize(QSize(100, 75));
+    QStringList backgrounds = Global::backgroundManager-&gt;imageNames();
+    int index = 1;
+    for (QStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
+        QPixmap *preview = Global::backgroundManager-&gt;preview(*it);
+        if (preview) {
+            m_backgroundImagesMap.insert(index, *it);
+            m_backgroundImage-&gt;insertItem(index, *it);
+            m_backgroundImage-&gt;setItemData(index, *preview, Qt::DecorationRole);
+            if (m_basket-&gt;backgroundImageName() == *it)
+                m_backgroundImage-&gt;setCurrentIndex(index);
+            index++;
+        }
+    }
+//  m_backgroundImage-&gt;insertItem(i18n(&quot;Other...&quot;), -1);
+    int BUTTON_MARGIN = kapp-&gt;style()-&gt;pixelMetric(QStyle::PM_ButtonMargin);
+    m_backgroundImage-&gt;setMaxVisibleItems(50/*75 * 6 / m_backgroundImage-&gt;sizeHint().height()*/);
+    m_backgroundImage-&gt;setMinimumHeight(75 + 2 * BUTTON_MARGIN);
+
+    // Disposition:
+    m_disposition = new QGroupBox(i18n(&quot;Disposition&quot;), page);
+    QButtonGroup* bg = new QButtonGroup(m_disposition);
+
+    QVBoxLayout* dispLayout = new QVBoxLayout;
+    m_disposition-&gt;setLayout(dispLayout);
+
+    columnForm = new QRadioButton(i18n(&quot;Col&amp;umns:&quot;), m_disposition);
+    dispLayout-&gt;addWidget(columnForm);
+    bg-&gt;addButton(columnForm);
+
+    m_columnCount = new KIntNumInput(m_basket-&gt;columnsCount(), m_disposition);
+    m_columnCount-&gt;setRange(1, 20, /*step=*/1);
+    m_columnCount-&gt;setSliderEnabled(false);
+    m_columnCount-&gt;setValue(m_basket-&gt;columnsCount());
+    connect(m_columnCount, SIGNAL(valueChanged(int)), this, SLOT(selectColumnsLayout()));
+    dispLayout-&gt;addWidget(m_columnCount);
+
+    freeForm = new QRadioButton(i18n(&quot;&amp;Free-form&quot;), m_disposition);
+    dispLayout-&gt;addWidget(freeForm);
+    bg-&gt;addButton(freeForm);
+
+    mindMap = new QRadioButton(i18n(&quot;&amp;Mind map&quot;), m_disposition); // TODO: &quot;Learn more...&quot;
+    dispLayout-&gt;addWidget(mindMap);
+    bg-&gt;addButton(mindMap);
+
+    int height = qMax(mindMap-&gt;sizeHint().height(), m_columnCount-&gt;sizeHint().height()); // Make all radioButtons vertically equaly-spaced!
+    mindMap-&gt;setMinimumSize(mindMap-&gt;sizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
+    if (!m_basket-&gt;isFreeLayout())
+        columnForm-&gt;setChecked(true);
+    else if (m_basket-&gt;isMindMap())
+        mindMap-&gt;setChecked(true);
+    else
+        freeForm-&gt;setChecked(true);
+    topLayout-&gt;addWidget(m_disposition);
+
+    mindMap-&gt;hide();
+
+    // Keyboard Shortcut:
+    m_shortcutRole = new QGroupBox(i18n(&quot;&amp;Keyboard Shortcut&quot;), page);
+    m_shortcutRoleLayout = new QVBoxLayout;
+    m_shortcutRole-&gt;setLayout(m_shortcutRoleLayout);
+    QWidget *shortcutWidget = new QWidget;
+    m_shortcutRoleLayout-&gt;addWidget(shortcutWidget);
+    QHBoxLayout *shortcutLayout = new QHBoxLayout(shortcutWidget);
+    m_shortcut = new KShortcutWidget(shortcutWidget);
+    m_shortcut-&gt;setShortcut(m_basket-&gt;shortcut());
+    HelpLabel *helpLabel = new HelpLabel(i18n(&quot;Learn some tips...&quot;), i18n(
+                                             &quot;&lt;p&gt;&lt;strong&gt;Easily Remember your Shortcuts&lt;/strong&gt;:&lt;br&gt;&quot;
+                                             &quot;With the first option, giving the basket a shortcut of the form &lt;strong&gt;Alt+Letter&lt;/strong&gt; will underline that letter in the basket tree.&lt;br&gt;&quot;
+                                             &quot;For instance, if you are assigning the shortcut &lt;i&gt;Alt+T&lt;/i&gt; to a basket named &lt;i&gt;Tips&lt;/i&gt;, the basket will be displayed as &lt;i&gt;&lt;u&gt;T&lt;/u&gt;ips&lt;/i&gt; in the tree. &quot;
+                                             &quot;It helps you visualize the shortcuts to remember them more quickly.&lt;/p&gt;&quot;
+                                             &quot;&lt;p&gt;&lt;strong&gt;Local vs Global&lt;/strong&gt;:&lt;br&gt;&quot;
+                                             &quot;The first option allows to show the basket while the main window is active. &quot;
+                                             &quot;Global shortcuts are valid from anywhere, even if the window is hidden.&lt;/p&gt;&quot;
+                                             &quot;&lt;p&gt;&lt;strong&gt;Show vs Switch&lt;/strong&gt;:&lt;br&gt;&quot;
+                                             &quot;The last option makes this basket the current one without opening the main window. &quot;
+                                             &quot;It is useful in addition to the configurable global shortcuts, eg. to paste the clipboard or the selection into the current basket from anywhere.&lt;/p&gt;&quot;),
+                                         shortcutWidget);
+    shortcutLayout-&gt;addWidget(m_shortcut);
+    shortcutLayout-&gt;addStretch();
+    shortcutLayout-&gt;addWidget(helpLabel);
+    connect(m_shortcut, SIGNAL(shortcutChanged(const KShortcut&amp;)), this, SLOT(capturedShortcut(const KShortcut&amp;)));
+    m_showButton = new QRadioButton(i18n(&quot;S&amp;how this basket&quot;));
+    m_globalButton = new QRadioButton(i18n(&quot;Show this basket (&amp;global shortcut)&quot;));
+    m_switchButton = new QRadioButton(i18n(&quot;S&amp;witch to this basket (global shortcut)&quot;));
+    m_shortcutRoleLayout-&gt;addWidget(m_showButton);
+    m_shortcutRoleLayout-&gt;addWidget(m_globalButton);
+    m_shortcutRoleLayout-&gt;addWidget(m_switchButton);
+    switch (m_basket-&gt;shortcutAction()) {
+    default:
+    case 0: m_showButton-&gt;setChecked(true); break;
+    case 1: m_globalButton-&gt;setChecked(true); break;
+    case 2: m_switchButton-&gt;setChecked(true); break;
+    }
+    topLayout-&gt;addWidget(m_shortcutRole);
+
+    topLayout-&gt;addSpacing(marginHint());
+    topLayout-&gt;addStretch(10);
+
+    // Connect the Ok and Apply buttons to actually apply the changes
+    connect(this, SIGNAL(okClicked()), this, SLOT(applyChanges()));
+    connect(this, SIGNAL(applyClicked()), this, SLOT(applyChanges()));
+
+    setMainWidget(page);
 }
 
 BasketPropertiesDialog::~BasketPropertiesDialog()
@@ -227,45 +227,41 @@ BasketPropertiesDialog::~BasketPropertiesDialog()
 
 void BasketPropertiesDialog::ensurePolished()
 {
-	ensurePolished();
-	m_name-&gt;setFocus();
+    ensurePolished();
+    m_name-&gt;setFocus();
 }
 
 void BasketPropertiesDialog::applyChanges()
 {
-	if (columnForm-&gt;isChecked()){
-		m_basket-&gt;setDisposition(0, m_columnCount-&gt;value());
-	}
-	else if(freeForm-&gt;isChecked()){
-		m_basket-&gt;setDisposition(1, m_columnCount-&gt;value());
-	}
-	else{
-		m_basket-&gt;setDisposition(2, m_columnCount-&gt;value());
-	}
-
-	if (m_showButton-&gt;isChecked()){
-		m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 0);
-	}
-	else if (m_globalButton-&gt;isChecked()){
-		m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 1);
-	}
-	else if (m_switchButton-&gt;isChecked()){
-		m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 2);
-	}
-
-	// Should be called LAST, because it will emit the propertiesChanged() signal and the tree will be able to show the newly set Alt+Letter shortcut:
-	m_basket-&gt;setAppearance(m_icon-&gt;icon(), m_name-&gt;text(), m_backgroundImagesMap[m_backgroundImage-&gt;currentIndex()], m_backgroundColor-&gt;color(), m_textColor-&gt;color());
-	m_basket-&gt;save();
+    if (columnForm-&gt;isChecked()) {
+        m_basket-&gt;setDisposition(0, m_columnCount-&gt;value());
+    } else if (freeForm-&gt;isChecked()) {
+        m_basket-&gt;setDisposition(1, m_columnCount-&gt;value());
+    } else {
+        m_basket-&gt;setDisposition(2, m_columnCount-&gt;value());
+    }
+
+    if (m_showButton-&gt;isChecked()) {
+        m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 0);
+    } else if (m_globalButton-&gt;isChecked()) {
+        m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 1);
+    } else if (m_switchButton-&gt;isChecked()) {
+        m_basket-&gt;setShortcut(m_shortcut-&gt;shortcut(), 2);
+    }
+
+    // Should be called LAST, because it will emit the propertiesChanged() signal and the tree will be able to show the newly set Alt+Letter shortcut:
+    m_basket-&gt;setAppearance(m_icon-&gt;icon(), m_name-&gt;text(), m_backgroundImagesMap[m_backgroundImage-&gt;currentIndex()], m_backgroundColor-&gt;color(), m_textColor-&gt;color());
+    m_basket-&gt;save();
 }
 
 void BasketPropertiesDialog::capturedShortcut(const KShortcut &amp;shortcut)
 {
-	// TODO: Validate it!
-	m_shortcut-&gt;setShortcut(shortcut);
+    // TODO: Validate it!
+    m_shortcut-&gt;setShortcut(shortcut);
 }
 
 void BasketPropertiesDialog::selectColumnsLayout()
 {
-	columnForm-&gt;setChecked(true);
+    columnForm-&gt;setChecked(true);
 }
 </diff>
      <filename>src/basketproperties.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -43,37 +43,37 @@ class KColorCombo2;
   */
 class BasketPropertiesDialog : public KDialog
 {
-  Q_OBJECT
-  public:
-	BasketPropertiesDialog(Basket *basket, QWidget *parent = 0);
-	~BasketPropertiesDialog();
-	void ensurePolished();
+    Q_OBJECT
+public:
+    BasketPropertiesDialog(Basket *basket, QWidget *parent = 0);
+    ~BasketPropertiesDialog();
+    void ensurePolished();
 
-  public slots:
-	void applyChanges();
+public slots:
+    void applyChanges();
 
-  protected slots:
-	void capturedShortcut(const KShortcut &amp;shortcut);
-	void selectColumnsLayout();
-  private:
-	Basket        *m_basket;
-	KIconButton   *m_icon;
-	QLineEdit     *m_name;
-	QComboBox     *m_backgroundImage;
-	KColorCombo2  *m_backgroundColor;
-	KColorCombo2  *m_textColor;
-	QGroupBox     *m_disposition;
-	QRadioButton  *columnForm;
-	QRadioButton  *mindMap;
-	QRadioButton  *freeForm;
-	KIntNumInput  *m_columnCount;
-	KShortcutWidget *m_shortcut;
-	QGroupBox *m_shortcutRole;
-	QVBoxLayout *m_shortcutRoleLayout;
-	QRadioButton * m_showButton;
-	QRadioButton * m_globalButton;
-	QRadioButton * m_switchButton;
-	QMap&lt;int, QString&gt; m_backgroundImagesMap;
+protected slots:
+    void capturedShortcut(const KShortcut &amp;shortcut);
+    void selectColumnsLayout();
+private:
+    Basket        *m_basket;
+    KIconButton   *m_icon;
+    QLineEdit     *m_name;
+    QComboBox     *m_backgroundImage;
+    KColorCombo2  *m_backgroundColor;
+    KColorCombo2  *m_textColor;
+    QGroupBox     *m_disposition;
+    QRadioButton  *columnForm;
+    QRadioButton  *mindMap;
+    QRadioButton  *freeForm;
+    KIntNumInput  *m_columnCount;
+    KShortcutWidget *m_shortcut;
+    QGroupBox *m_shortcutRole;
+    QVBoxLayout *m_shortcutRoleLayout;
+    QRadioButton * m_showButton;
+    QRadioButton * m_globalButton;
+    QRadioButton * m_switchButton;
+    QMap&lt;int, QString&gt; m_backgroundImagesMap;
 };
 
 #endif // BASKETPROPERTIES_H</diff>
      <filename>src/basketproperties.h</filename>
    </modified>
    <modified>
      <diff>@@ -33,157 +33,156 @@
 #include &lt;qtooltip.h&gt;
 
 BasketStatusBar::BasketStatusBar(KStatusBar *bar)
-	: m_bar(bar), m_extension(0), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
+        : m_bar(bar), m_extension(0), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
 {
 }
 
 BasketStatusBar::BasketStatusBar(KParts::StatusBarExtension *extension)
-	: m_bar(0), m_extension(extension), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
+        : m_bar(0), m_extension(extension), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
 {
 }
 
 BasketStatusBar::~BasketStatusBar()
 {
-	//delete m_extension;
+    //delete m_extension;
 }
 
-KStatusBar *BasketStatusBar::statusBar () const
+KStatusBar *BasketStatusBar::statusBar() const
 {
-	if(m_extension)
-		return m_extension-&gt;statusBar();
-	else
-		return m_bar;
+    if (m_extension)
+        return m_extension-&gt;statusBar();
+    else
+        return m_bar;
 }
 
 void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent)
 {
-	if(m_extension)
-		m_extension-&gt;addStatusBarItem(widget, stretch, permanent);
-	else if (permanent)
-		m_bar-&gt;addPermanentWidget(widget, stretch);
-	else
-		m_bar-&gt;addWidget(widget, stretch);
+    if (m_extension)
+        m_extension-&gt;addStatusBarItem(widget, stretch, permanent);
+    else if (permanent)
+        m_bar-&gt;addPermanentWidget(widget, stretch);
+    else
+        m_bar-&gt;addWidget(widget, stretch);
 }
 
 void BasketStatusBar::setupStatusBar()
 {
-	QWidget* parent = statusBar();
-	QObjectList lst = parent-&gt;findChildren&lt;QObject*&gt;(&quot;KRSqueezedTextLabel&quot;);
-
-	//Tools::printChildren(parent);
-	if(lst.count() == 0)
-	{
-		m_basketStatus = new QLabel(parent);
-		QSizePolicy policy(QSizePolicy::Ignored, QSizePolicy::Ignored);
-		policy.setHorizontalStretch(0);
-		policy.setVerticalStretch(0);
-		policy.setHeightForWidth(false);
-		m_basketStatus-&gt;setSizePolicy(policy);
-		addWidget( m_basketStatus, 1, false); // Fit all extra space and is hiddable
-	}
-	else
+    QWidget* parent = statusBar();
+    QObjectList lst = parent-&gt;findChildren&lt;QObject*&gt;(&quot;KRSqueezedTextLabel&quot;);
+
+    //Tools::printChildren(parent);
+    if (lst.count() == 0) {
+        m_basketStatus = new QLabel(parent);
+        QSizePolicy policy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+        policy.setHorizontalStretch(0);
+        policy.setVerticalStretch(0);
+        policy.setHeightForWidth(false);
+        m_basketStatus-&gt;setSizePolicy(policy);
+        addWidget(m_basketStatus, 1, false);  // Fit all extra space and is hiddable
+    } else
         m_basketStatus = static_cast&lt;QLabel*&gt;(lst.at(0));
     lst.clear();
 
-	m_selectionStatus = new QLabel(i18n(&quot;Loading...&quot;), parent);
-	addWidget( m_selectionStatus, 0, true );
+    m_selectionStatus = new QLabel(i18n(&quot;Loading...&quot;), parent);
+    addWidget(m_selectionStatus, 0, true);
 
-	m_lockStatus = new QLabel(0/*this*/);
-	m_lockStatus-&gt;setMinimumSize(18, 18);
-	m_lockStatus-&gt;setAlignment(Qt::AlignCenter);
-//	addWidget( m_lockStatus, 0, true );
+    m_lockStatus = new QLabel(0/*this*/);
+    m_lockStatus-&gt;setMinimumSize(18, 18);
+    m_lockStatus-&gt;setAlignment(Qt::AlignCenter);
+//  addWidget( m_lockStatus, 0, true );
     m_lockStatus-&gt;installEventFilter(this);
 
-	m_savedStatusPixmap = SmallIcon(&quot;document-save&quot;);
-	m_savedStatus = new QLabel(parent);
-	m_savedStatus-&gt;setPixmap(m_savedStatusPixmap);
-	m_savedStatus-&gt;setFixedSize(m_savedStatus-&gt;sizeHint());
-	m_savedStatus-&gt;clear();
-	//m_savedStatus-&gt;setPixmap(m_savedStatusIconSet.pixmap(QIconSet::Small, QIconSet::Disabled));
-	//m_savedStatus-&gt;setEnabled(false);
-	addWidget( m_savedStatus, 0, true);
-	m_savedStatus-&gt;setToolTip(&quot;&lt;p&gt;&quot; + i18n(&quot;Shows if there are changes that have not yet been saved.&quot;));
+    m_savedStatusPixmap = SmallIcon(&quot;document-save&quot;);
+    m_savedStatus = new QLabel(parent);
+    m_savedStatus-&gt;setPixmap(m_savedStatusPixmap);
+    m_savedStatus-&gt;setFixedSize(m_savedStatus-&gt;sizeHint());
+    m_savedStatus-&gt;clear();
+    //m_savedStatus-&gt;setPixmap(m_savedStatusIconSet.pixmap(QIconSet::Small, QIconSet::Disabled));
+    //m_savedStatus-&gt;setEnabled(false);
+    addWidget(m_savedStatus, 0, true);
+    m_savedStatus-&gt;setToolTip(&quot;&lt;p&gt;&quot; + i18n(&quot;Shows if there are changes that have not yet been saved.&quot;));
 
 
 }
 
 void BasketStatusBar::postStatusbarMessage(const QString&amp; text)
 {
-	if(statusBar())
-		statusBar()-&gt;showMessage(text, 2000);
+    if (statusBar())
+        statusBar()-&gt;showMessage(text, 2000);
 }
 
 void BasketStatusBar::setStatusText(const QString &amp;txt)
 {
-	if(m_basketStatus &amp;&amp; m_basketStatus-&gt;text() != txt)
-		m_basketStatus-&gt;setText(txt);
+    if (m_basketStatus &amp;&amp; m_basketStatus-&gt;text() != txt)
+        m_basketStatus-&gt;setText(txt);
 }
 
 void BasketStatusBar::setStatusBarHint(const QString &amp;hint)
 {
-	if (hint.isEmpty())
-		updateStatusBarHint();
-	else
-		setStatusText(hint);
+    if (hint.isEmpty())
+        updateStatusBarHint();
+    else
+        setStatusText(hint);
 }
 
 void BasketStatusBar::updateStatusBarHint()
 {
-	QString message = &quot;&quot;;
+    QString message = &quot;&quot;;
 
-	if (Global::bnpView-&gt;currentBasket()-&gt;isDuringDrag())
-		message = i18n(&quot;Ctrl+drop: copy, Shift+drop: move, Shift+Ctrl+drop: link.&quot;);
+    if (Global::bnpView-&gt;currentBasket()-&gt;isDuringDrag())
+        message = i18n(&quot;Ctrl+drop: copy, Shift+drop: move, Shift+Ctrl+drop: link.&quot;);
 // Too much noise information:
-//	else if (currentBasket()-&gt;inserterShown() &amp;&amp; currentBasket()-&gt;inserterSplit() &amp;&amp; !currentBasket()-&gt;inserterGroup())
-//		message = i18n(&quot;Click to insert a note, right click for more options. Click on the right of the line to group instead of insert.&quot;);
-//	else if (currentBasket()-&gt;inserterShown() &amp;&amp; currentBasket()-&gt;inserterSplit() &amp;&amp; currentBasket()-&gt;inserterGroup())
-//		message = i18n(&quot;Click to group a note, right click for more options. Click on the left of the line to group instead of insert.&quot;);
-	else if (Global::debugWindow)
-		message = &quot;DEBUG: &quot; + Global::bnpView-&gt;currentBasket()-&gt;folderName();
-
-	setStatusText(message);
+//  else if (currentBasket()-&gt;inserterShown() &amp;&amp; currentBasket()-&gt;inserterSplit() &amp;&amp; !currentBasket()-&gt;inserterGroup())
+//      message = i18n(&quot;Click to insert a note, right click for more options. Click on the right of the line to group instead of insert.&quot;);
+//  else if (currentBasket()-&gt;inserterShown() &amp;&amp; currentBasket()-&gt;inserterSplit() &amp;&amp; currentBasket()-&gt;inserterGroup())
+//      message = i18n(&quot;Click to group a note, right click for more options. Click on the left of the line to group instead of insert.&quot;);
+    else if (Global::debugWindow)
+        message = &quot;DEBUG: &quot; + Global::bnpView-&gt;currentBasket()-&gt;folderName();
+
+    setStatusText(message);
 }
 
 void BasketStatusBar::setLockStatus(bool isLocked)
 {
-	if(!m_lockStatus)
-		return;
-
-	if (isLocked) {
-		m_lockStatus-&gt;setPixmap(SmallIcon(&quot;encrypted.png&quot;));
-		m_lockStatus-&gt;setToolTip(i18n(
-				&quot;&lt;p&gt;This basket is &lt;b&gt;locked&lt;/b&gt;.&lt;br&gt;Click to unlock it.&lt;/p&gt;&quot;).replace(&quot; &quot;, &quot;&amp;nbsp;&quot;) );
-//		QToolTip::add(m_lockStatus, i18n(&quot;This basket is locked.\nClick to unlock it.&quot;));
-	} else {
-		m_lockStatus-&gt;clear();
-		m_lockStatus-&gt;setToolTip(i18n(
-				&quot;&lt;p&gt;This basket is &lt;b&gt;unlocked&lt;/b&gt;.&lt;br&gt;Click to lock it.&lt;/p&gt;&quot;).replace(&quot; &quot;, &quot;&amp;nbsp;&quot;) );
-//		QToolTip::add(m_lockStatus, i18n(&quot;This basket is unlocked.\nClick to lock it.&quot;));
-	}
+    if (!m_lockStatus)
+        return;
+
+    if (isLocked) {
+        m_lockStatus-&gt;setPixmap(SmallIcon(&quot;encrypted.png&quot;));
+        m_lockStatus-&gt;setToolTip(i18n(
+                                     &quot;&lt;p&gt;This basket is &lt;b&gt;locked&lt;/b&gt;.&lt;br&gt;Click to unlock it.&lt;/p&gt;&quot;).replace(&quot; &quot;, &quot;&amp;nbsp;&quot;));
+//      QToolTip::add(m_lockStatus, i18n(&quot;This basket is locked.\nClick to unlock it.&quot;));
+    } else {
+        m_lockStatus-&gt;clear();
+        m_lockStatus-&gt;setToolTip(i18n(
+                                     &quot;&lt;p&gt;This basket is &lt;b&gt;unlocked&lt;/b&gt;.&lt;br&gt;Click to lock it.&lt;/p&gt;&quot;).replace(&quot; &quot;, &quot;&amp;nbsp;&quot;));
+//      QToolTip::add(m_lockStatus, i18n(&quot;This basket is unlocked.\nClick to lock it.&quot;));
+    }
 }
 
 void BasketStatusBar::setSelectionStatus(const QString &amp;s)
 {
-	if (m_selectionStatus)
-		m_selectionStatus-&gt;setText(s);
+    if (m_selectionStatus)
+        m_selectionStatus-&gt;setText(s);
 }
 
 void BasketStatusBar::setUnsavedStatus(bool isUnsaved)
 {
-	if (!m_savedStatus)
-		return;
-
-	if (isUnsaved) {
-		if (m_savedStatus-&gt;pixmap() == 0)
-			m_savedStatus-&gt;setPixmap(m_savedStatusPixmap);
-	} else
-		m_savedStatus-&gt;clear();
+    if (!m_savedStatus)
+        return;
+
+    if (isUnsaved) {
+        if (m_savedStatus-&gt;pixmap() == 0)
+            m_savedStatus-&gt;setPixmap(m_savedStatusPixmap);
+    } else
+        m_savedStatus-&gt;clear();
 }
 
-bool BasketStatusBar::eventFilter(QObject * obj, QEvent * event) {
+bool BasketStatusBar::eventFilter(QObject * obj, QEvent * event)
+{
     if (obj == m_lockStatus &amp;&amp; event-&gt;type() == QEvent::MouseButtonPress) {
         QMouseEvent * mevent = dynamic_cast&lt;QMouseEvent *&gt;(event);
-        if(mevent-&gt;button() &amp; Qt::LeftButton) {
+        if (mevent-&gt;button() &amp; Qt::LeftButton) {
             Global::bnpView-&gt;lockBasket();
             return true;
         } else {</diff>
      <filename>src/basketstatusbar.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -28,44 +28,47 @@
 #include &quot;basket_export.h&quot;
 
 class KStatusBar;
-namespace KParts { class StatusBarExtension; }
+namespace KParts
+{
+class StatusBarExtension;
+}
 class QWidget;
 class QLabel;
 
 /**
-	@author S&#233;bastien Lao&#251;t &lt;slaout@linux62.org&gt;
+    @author S&#233;bastien Lao&#251;t &lt;slaout@linux62.org&gt;
 */
 class BASKET_EXPORT BasketStatusBar : public QObject
 {
-  Q_OBJECT
-  public:
+    Q_OBJECT
+public:
     BasketStatusBar(KStatusBar *bar);
-	BasketStatusBar(KParts::StatusBarExtension *extension);
-	~BasketStatusBar();
+    BasketStatusBar(KParts::StatusBarExtension *extension);
+    ~BasketStatusBar();
 
-  public slots:
-	/** GUI Main Window actions **/
-	void setStatusBarHint(const QString &amp;hint); /// &lt;&lt; Set a specific message or update if hint is empty
-	void updateStatusBarHint();                 /// &lt;&lt; Display the current state message (dragging, editing) or reset the startsbar message
-	void postStatusbarMessage(const QString &amp;text);
-	void setSelectionStatus(const QString &amp;s);
-	void setLockStatus(bool isLocked);
-	void setupStatusBar();
-	void setUnsavedStatus(bool isUnsaved);
+public slots:
+    /** GUI Main Window actions **/
+    void setStatusBarHint(const QString &amp;hint); /// &lt;&lt; Set a specific message or update if hint is empty
+    void updateStatusBarHint();                 /// &lt;&lt; Display the current state message (dragging, editing) or reset the startsbar message
+    void postStatusbarMessage(const QString &amp;text);
+    void setSelectionStatus(const QString &amp;s);
+    void setLockStatus(bool isLocked);
+    void setupStatusBar();
+    void setUnsavedStatus(bool isUnsaved);
 
-  protected:
-    KStatusBar *statusBar () const;
+protected:
+    KStatusBar *statusBar() const;
     void addWidget(QWidget * widget, int stretch = 0, bool permanent = false);
     void setStatusText(const QString &amp;txt);
     bool eventFilter(QObject * obj, QEvent * event);
-  private:
-	KStatusBar                 *m_bar;
-	KParts::StatusBarExtension *m_extension;
-	QLabel                     *m_selectionStatus;
-	QLabel                     *m_lockStatus;
-	QLabel                     *m_basketStatus;
-	QLabel                     *m_savedStatus;
-	QPixmap                     m_savedStatusPixmap;
+private:
+    KStatusBar                 *m_bar;
+    KParts::StatusBarExtension *m_extension;
+    QLabel                     *m_selectionStatus;
+    QLabel                     *m_lockStatus;
+    QLabel                     *m_basketStatus;
+    QLabel                     *m_savedStatus;
+    QPixmap                     m_savedStatusPixmap;
 };
 
 #endif</diff>
      <filename>src/basketstatusbar.h</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
- /// NEW:
+/// NEW:
 
 #include &lt;QStackedWidget&gt;
 #include &lt;qregexp.h&gt;
@@ -95,40 +95,40 @@
 const int BNPView::c_delayTooltipTime = 275;
 
 BNPView::BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
-		 KActionCollection *actionCollection, BasketStatusBar *bar)
-	: QSplitter(Qt::Horizontal, parent)
-	, m_actLockBasket(0)
-	, m_actPassBasket(0)
-	, m_loading(true)
-	, m_newBasketPopup(false)
-	, m_firstShow(true)
-	, m_regionGrabber(0)
-	, m_passiveDroppedSelection(0)
-	, m_passivePopup(0)
-	, m_actionCollection(actionCollection)
-	, m_guiClient(aGUIClient)
-	, m_statusbar(bar)
-	, m_tryHideTimer(0)
-	, m_hideTimer(0)
+                 KActionCollection *actionCollection, BasketStatusBar *bar)
+        : QSplitter(Qt::Horizontal, parent)
+        , m_actLockBasket(0)
+        , m_actPassBasket(0)
+        , m_loading(true)
+        , m_newBasketPopup(false)
+        , m_firstShow(true)
+        , m_regionGrabber(0)
+        , m_passiveDroppedSelection(0)
+        , m_passivePopup(0)
+        , m_actionCollection(actionCollection)
+        , m_guiClient(aGUIClient)
+        , m_statusbar(bar)
+        , m_tryHideTimer(0)
+        , m_hideTimer(0)
 {
 
-	new BNPViewAdaptor(this);
-	QDBusConnection dbus = QDBusConnection::sessionBus();
-	dbus.registerObject(&quot;/BNPView&quot;,this);
+    new BNPViewAdaptor(this);
+    QDBusConnection dbus = QDBusConnection::sessionBus();
+    dbus.registerObject(&quot;/BNPView&quot;, this);
 
-	setObjectName(name);
+    setObjectName(name);
 
-	/* Settings */
-	Settings::loadConfig();
+    /* Settings */
+    Settings::loadConfig();
 
-	Global::bnpView = this;
+    Global::bnpView = this;
 
-	// Needed when loading the baskets:
-	Global::backgroundManager = new BackgroundManager();
+    // Needed when loading the baskets:
+    Global::backgroundManager = new BackgroundManager();
 
-	setupGlobalShortcuts();
-	initialize();
-	QTimer::singleShot(0, this, SLOT(lateInit()));
+    setupGlobalShortcuts();
+    initialize();
+    QTimer::singleShot(0, this, SLOT(lateInit()));
 }
 
 BNPView::~BNPView()
@@ -138,155 +138,153 @@ BNPView::~BNPView()
     Settings::setBasketTreeWidth(treeWidth);
 
     if (currentBasket() &amp;&amp; currentBasket()-&gt;isDuringEdit())
-		currentBasket()-&gt;closeEditor();
+        currentBasket()-&gt;closeEditor();
 
-	Settings::saveConfig();
+    Settings::saveConfig();
 
-	Global::bnpView = 0;
+    Global::bnpView = 0;
 
-	delete Global::systemTray;
-	Global::systemTray = 0;
-	delete m_colorPicker;
-	delete m_statusbar;
+    delete Global::systemTray;
+    Global::systemTray = 0;
+    delete m_colorPicker;
+    delete m_statusbar;
 
-	NoteDrag::createAndEmptyCuttingTmpFolder(); // Clean the temporary folder we used
+    NoteDrag::createAndEmptyCuttingTmpFolder(); // Clean the temporary folder we used
 }
 
 void BNPView::lateInit()
 {
-/*
-	InlineEditors* instance = InlineEditors::instance();
-
-	if(instance)
-	{
-		KToolBar* toolbar = instance-&gt;richTextToolBar();
-
-		if(toolbar)
-			toolbar-&gt;hide();
-	}
-*/
-	if(!isPart())
-	{
-		if (Settings::useSystray() &amp;&amp; KCmdLineArgs::parsedArgs() &amp;&amp; KCmdLineArgs::parsedArgs()-&gt;isSet(&quot;start-hidden&quot;)){
-			if(Global::mainWindow()) Global::mainWindow()-&gt;hide();
-		}
-		else if (Settings::useSystray() &amp;&amp; kapp-&gt;isSessionRestored()){
-			if(Global::mainWindow()) Global::mainWindow()-&gt;setShown(!Settings::startDocked());
-		}
-	}
-
-	// If the main window is hidden when session is saved, Container::queryClose()
-	//  isn't called and the last value would be kept
-	Settings::setStartDocked(true);
-	Settings::saveConfig();
-
-	/* System tray icon */
-	Global::systemTray = new SystemTray(Global::mainWindow());
-	connect( Global::systemTray, SIGNAL(showPart()), this, SIGNAL(showPart()) );
-	if (Settings::useSystray())
-		Global::systemTray-&gt;show();
-
-	// Load baskets
-	DEBUG_WIN &lt;&lt; &quot;Baskets are loaded from &quot; + Global::basketsFolder();
-
-	NoteDrag::createAndEmptyCuttingTmpFolder(); // If last exec hasn't done it: clean the temporary folder we will use
-	Tag::loadTags(); // Tags should be ready before loading baskets, but tags need the mainContainer to be ready to create KActions!
-	load();
-
-	// If no basket has been found, try to import from an older version,
-	if (topLevelItemCount() &lt;= 0 ) {
-		QDir dir;
-		dir.mkdir(Global::basketsFolder());
-		if (FormatImporter::shouldImportBaskets()) {
-			FormatImporter::importBaskets();
-			load();
-		}
-		if (topLevelItemCount() &lt;= 0 ) {
-		// Create first basket:
-			BasketFactory::newBasket(/*icon=*/&quot;&quot;, /*name=*/i18n(&quot;General&quot;), /*backgroundImage=*/&quot;&quot;, /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/&quot;1column&quot;, /*createIn=*/0);
-		}
-	}
-
-	// Load the Welcome Baskets if it is the First Time:
-	if (!Settings::welcomeBasketsAdded()) {
-		addWelcomeBaskets();
-		Settings::setWelcomeBasketsAdded(true);
-		Settings::saveConfig();
-	}
-
-	m_tryHideTimer = new QTimer(this);
-	m_hideTimer    = new QTimer(this);
-	connect( m_tryHideTimer, SIGNAL(timeout()), this, SLOT(timeoutTryHide()) );
-	connect( m_hideTimer,    SIGNAL(timeout()), this, SLOT(timeoutHide())    );
-
-	// Preload every baskets for instant filtering:
-/*StopWatch::start(100);
-	QListViewItemIterator it(m_tree);
-	while (it.current()) {
-		BasketListViewItem *item = ((BasketListViewItem*)it.current());
-		item-&gt;basket()-&gt;load();
-		kapp-&gt;processEvents();
-		++it;
-	}
-StopWatch::check(100);*/
+    /*
+        InlineEditors* instance = InlineEditors::instance();
+
+        if(instance)
+        {
+            KToolBar* toolbar = instance-&gt;richTextToolBar();
+
+            if(toolbar)
+                toolbar-&gt;hide();
+        }
+    */
+    if (!isPart()) {
+        if (Settings::useSystray() &amp;&amp; KCmdLineArgs::parsedArgs() &amp;&amp; KCmdLineArgs::parsedArgs()-&gt;isSet(&quot;start-hidden&quot;)) {
+            if (Global::mainWindow()) Global::mainWindow()-&gt;hide();
+        } else if (Settings::useSystray() &amp;&amp; kapp-&gt;isSessionRestored()) {
+            if (Global::mainWindow()) Global::mainWindow()-&gt;setShown(!Settings::startDocked());
+        }
+    }
+
+    // If the main window is hidden when session is saved, Container::queryClose()
+    //  isn't called and the last value would be kept
+    Settings::setStartDocked(true);
+    Settings::saveConfig();
+
+    /* System tray icon */
+    Global::systemTray = new SystemTray(Global::mainWindow());
+    connect(Global::systemTray, SIGNAL(showPart()), this, SIGNAL(showPart()));
+    if (Settings::useSystray())
+        Global::systemTray-&gt;show();
+
+    // Load baskets
+    DEBUG_WIN &lt;&lt; &quot;Baskets are loaded from &quot; + Global::basketsFolder();
+
+    NoteDrag::createAndEmptyCuttingTmpFolder(); // If last exec hasn't done it: clean the temporary folder we will use
+    Tag::loadTags(); // Tags should be ready before loading baskets, but tags need the mainContainer to be ready to create KActions!
+    load();
+
+    // If no basket has been found, try to import from an older version,
+    if (topLevelItemCount() &lt;= 0) {
+        QDir dir;
+        dir.mkdir(Global::basketsFolder());
+        if (FormatImporter::shouldImportBaskets()) {
+            FormatImporter::importBaskets();
+            load();
+        }
+        if (topLevelItemCount() &lt;= 0) {
+            // Create first basket:
+            BasketFactory::newBasket(/*icon=*/&quot;&quot;, /*name=*/i18n(&quot;General&quot;), /*backgroundImage=*/&quot;&quot;, /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/&quot;1column&quot;, /*createIn=*/0);
+        }
+    }
+
+    // Load the Welcome Baskets if it is the First Time:
+    if (!Settings::welcomeBasketsAdded()) {
+        addWelcomeBaskets();
+        Settings::setWelcomeBasketsAdded(true);
+        Settings::saveConfig();
+    }
+
+    m_tryHideTimer = new QTimer(this);
+    m_hideTimer    = new QTimer(this);
+    connect(m_tryHideTimer, SIGNAL(timeout()), this, SLOT(timeoutTryHide()));
+    connect(m_hideTimer,    SIGNAL(timeout()), this, SLOT(timeoutHide()));
+
+    // Preload every baskets for instant filtering:
+    /*StopWatch::start(100);
+        QListViewItemIterator it(m_tree);
+        while (it.current()) {
+            BasketListViewItem *item = ((BasketListViewItem*)it.current());
+            item-&gt;basket()-&gt;load();
+            kapp-&gt;processEvents();
+            ++it;
+        }
+    StopWatch::check(100);*/
 }
 
 void BNPView::addWelcomeBaskets()
 {
-	// Possible paths where to find the welcome basket archive, trying the translated one, and falling back to the English one:
-	QStringList possiblePaths;
-	if (QString(KGlobal::locale()-&gt;encoding()) == QString(&quot;UTF-8&quot;)) { // Welcome baskets are encoded in UTF-8. If the system is not, then use the English version:
-		possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_&quot; + KGlobal::locale()-&gt;language() + &quot;.baskets&quot;));
-		possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_&quot; + KGlobal::locale()-&gt;language().split(&quot;_&quot;)[0] + &quot;.baskets&quot;));
-	}
-	possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_en_US.baskets&quot;));
-
-	// Take the first EXISTING basket archive found:
-	QDir dir;
-	QString path;
-	for (QStringList::Iterator it = possiblePaths.begin(); it != possiblePaths.end(); ++it) {
-		if (dir.exists(*it)) {
-			path = *it;
-			break;
-		}
-	}
-
-	// Extract:
-	if (!path.isEmpty())
-		Archive::open(path);
+    // Possible paths where to find the welcome basket archive, trying the translated one, and falling back to the English one:
+    QStringList possiblePaths;
+    if (QString(KGlobal::locale()-&gt;encoding()) == QString(&quot;UTF-8&quot;)) { // Welcome baskets are encoded in UTF-8. If the system is not, then use the English version:
+        possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_&quot; + KGlobal::locale()-&gt;language() + &quot;.baskets&quot;));
+        possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_&quot; + KGlobal::locale()-&gt;language().split(&quot;_&quot;)[0] + &quot;.baskets&quot;));
+    }
+    possiblePaths.append(KGlobal::dirs()-&gt;findResource(&quot;data&quot;, &quot;basket/welcome/Welcome_en_US.baskets&quot;));
+
+    // Take the first EXISTING basket archive found:
+    QDir dir;
+    QString path;
+    for (QStringList::Iterator it = possiblePaths.begin(); it != possiblePaths.end(); ++it) {
+        if (dir.exists(*it)) {
+            path = *it;
+            break;
+        }
+    }
+
+    // Extract:
+    if (!path.isEmpty())
+        Archive::open(path);
 }
 
 void BNPView::onFirstShow()
 {
-	// Don't enable LikeBack until bnpview is shown. This way it works better with kontact.
-	/* LikeBack */
-/*	Global::likeBack = new LikeBack(LikeBack::AllButtons, / *showBarByDefault=* /true, Global::config(), Global::about());
-	Global::likeBack-&gt;setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
-	Global:likeBack-&gt;setAcceptedLanguages(QStringList::split(&quot;;&quot;, &quot;en;fr&quot;), i18n(&quot;Only english and french languages are accepted.&quot;));
-	if (isPart())
-		Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
-*/
+    // Don't enable LikeBack until bnpview is shown. This way it works better with kontact.
+    /* LikeBack */
+    /*  Global::likeBack = new LikeBack(LikeBack::AllButtons, / *showBarByDefault=* /true, Global::config(), Global::about());
+        Global::likeBack-&gt;setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
+        Global:likeBack-&gt;setAcceptedLanguages(QStringList::split(&quot;;&quot;, &quot;en;fr&quot;), i18n(&quot;Only english and french languages are accepted.&quot;));
+        if (isPart())
+            Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
+    */
 
-	if (isPart())
-		Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
+    if (isPart())
+        Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
 
-/*
-	LikeBack::init(Global::config(), Global::about(), LikeBack::AllButtons);
-	LikeBack::setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
-//	LikeBack::setServer(&quot;localhost&quot;, &quot;/~seb/basket/likeback/send.php&quot;);
-	LikeBack::setCustomLanguageMessage(i18n(&quot;Only english and french languages are accepted.&quot;));
-//	LikeBack::setWindowNamesListing(LikeBack:: / *NoListing* / / *WarnUnnamedWindows* / AllWindows);
-*/
+    /*
+        LikeBack::init(Global::config(), Global::about(), LikeBack::AllButtons);
+        LikeBack::setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
+    //  LikeBack::setServer(&quot;localhost&quot;, &quot;/~seb/basket/likeback/send.php&quot;);
+        LikeBack::setCustomLanguageMessage(i18n(&quot;Only english and french languages are accepted.&quot;));
+    //  LikeBack::setWindowNamesListing(LikeBack:: / *NoListing* / / *WarnUnnamedWindows* / AllWindows);
+    */
 
-	// In late init, because we need kapp-&gt;mainWidget() to be set!
-	if (!isPart())
-		connectTagsMenu();
+    // In late init, because we need kapp-&gt;mainWidget() to be set!
+    if (!isPart())
+        connectTagsMenu();
 
-	m_statusbar-&gt;setupStatusBar();
+    m_statusbar-&gt;setupStatusBar();
 
     int treeWidth = Settings::basketTreeWidth();
     if (treeWidth &lt; 0)
-      treeWidth = m_tree-&gt;fontMetrics().maxWidth() * 11;
+        treeWidth = m_tree-&gt;fontMetrics().maxWidth() * 11;
     QList&lt;int&gt; splitterSizes;
     splitterSizes.append(treeWidth);
     setSizes(splitterSizes);
@@ -299,186 +297,186 @@ void BNPView::setupGlobalShortcuts()
 
     // Ctrl+Shift+W only works when started standalone:
     QWidget *basketMainWindow =
-	    qobject_cast&lt;KMainWindow *&gt;(Global::bnpView-&gt;parent());
+        qobject_cast&lt;KMainWindow *&gt;(Global::bnpView-&gt;parent());
 
     int modifier = Qt::CTRL + Qt::ALT + Qt::SHIFT;
 
     if (basketMainWindow) {
-	a = ac-&gt;addAction(&quot;global_show_hide_main_window&quot;, Global::systemTray,
-			  SLOT(toggleActive()));
-	a-&gt;setText(i18n(&quot;Show/hide main window&quot;));
-	a-&gt;setStatusTip(
-	    i18n(&quot;Allows you to show main Window if it is hidden, and to hide &quot;
-		 &quot;it if it is shown.&quot;) );
-	a-&gt;setGlobalShortcut(KShortcut(modifier + Qt::Key_W));
+        a = ac-&gt;addAction(&quot;global_show_hide_main_window&quot;, Global::systemTray,
+                          SLOT(toggleActive()));
+        a-&gt;setText(i18n(&quot;Show/hide main window&quot;));
+        a-&gt;setStatusTip(
+            i18n(&quot;Allows you to show main Window if it is hidden, and to hide &quot;
+                 &quot;it if it is shown.&quot;));
+        a-&gt;setGlobalShortcut(KShortcut(modifier + Qt::Key_W));
     }
 
     a = ac-&gt;addAction(&quot;global_paste&quot;, Global::bnpView,
-		      SLOT(globalPasteInCurrentBasket()));
+                      SLOT(globalPasteInCurrentBasket()));
     a-&gt;setText(i18n(&quot;Paste clipboard contents in current basket&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Allows you to paste clipboard contents in the current basket &quot;
-	     &quot;without having to open the main window.&quot;) );
+        i18n(&quot;Allows you to paste clipboard contents in the current basket &quot;
+             &quot;without having to open the main window.&quot;));
     a-&gt;setGlobalShortcut(KShortcut(modifier + Qt::Key_V));
 
 
 
     a = ac-&gt;addAction(&quot;global_show_current_basket&quot;, Global::bnpView,
-		      SLOT(showPassiveContentForced()));
+                      SLOT(showPassiveContentForced()));
     a-&gt;setText(i18n(&quot;Show current basket name&quot;));
     a-&gt;setStatusTip(i18n(&quot;Allows you to know basket is current without opening &quot;
-			 &quot;the main window.&quot;));
+                         &quot;the main window.&quot;));
 
 
     a = ac-&gt;addAction(&quot;global_paste_selection&quot;, Global::bnpView,
-		      SLOT(pasteSelInCurrentBasket()));
+                      SLOT(pasteSelInCurrentBasket()));
     a-&gt;setText(i18n(&quot;Paste selection in current basket&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Allows you to paste clipboard selection in the current basket &quot;
-	     &quot;without having to open the main window.&quot;) );
+        i18n(&quot;Allows you to paste clipboard selection in the current basket &quot;
+             &quot;without having to open the main window.&quot;));
     a-&gt;setGlobalShortcut(KShortcut(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
 
     a = ac-&gt;addAction(&quot;global_new_basket&quot;, Global::bnpView,
-		      SLOT(askNewBasket()));
+                      SLOT(askNewBasket()));
     a-&gt;setText(i18n(&quot;Create a new basket&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Allows you to create a new basket without having to open the &quot;
-	     &quot;main window (you then can use the other global shortcuts to add &quot;
-	     &quot;a note, paste clipboard or paste selection in this new basket).&quot;)
-	);
+        i18n(&quot;Allows you to create a new basket without having to open the &quot;
+             &quot;main window (you then can use the other global shortcuts to add &quot;
+             &quot;a note, paste clipboard or paste selection in this new basket).&quot;)
+    );
 
     a = ac-&gt;addAction(&quot;global_previous_basket&quot;, Global::bnpView,
-		      SLOT(goToPreviousBasket()));
+                      SLOT(goToPreviousBasket()));
     a-&gt;setText(i18n(&quot;Go to previous basket&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Allows you to change current basket to the previous one without &quot;
-	     &quot;having to open the main window.&quot;) );
+        i18n(&quot;Allows you to change current basket to the previous one without &quot;
+             &quot;having to open the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_next_basket&quot;, Global::bnpView,
-		      SLOT(goToNextBasket()));
+                      SLOT(goToNextBasket()));
     a-&gt;setText(i18n(&quot;Go to next basket&quot;));
     a-&gt;setStatusTip(i18n(&quot;Allows you to change current basket to the next one &quot;
-			 &quot;without having to open the main window.&quot;));
+                         &quot;without having to open the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_note_add_html&quot;, Global::bnpView,
-		      SLOT(addNoteHtml()));
+                      SLOT(addNoteHtml()));
     a-&gt;setText(i18n(&quot;Insert text note&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Add a text note to the current basket without having to open &quot;
-	     &quot;the main window.&quot;) );
+        i18n(&quot;Add a text note to the current basket without having to open &quot;
+             &quot;the main window.&quot;));
     a-&gt;setGlobalShortcut(KShortcut(modifier + Qt::Key_T));
 
     a = ac-&gt;addAction(&quot;global_note_add_image&quot;, Global::bnpView,
-		      SLOT(addNoteImage()));
+                      SLOT(addNoteImage()));
     a-&gt;setText(i18n(&quot;Insert image note&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Add an image note to the current basket without having to open &quot;
-	     &quot;the main window.&quot;) );
+        i18n(&quot;Add an image note to the current basket without having to open &quot;
+             &quot;the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_note_add_link&quot;, Global::bnpView,
-		      SLOT(addNoteLink()));
+                      SLOT(addNoteLink()));
     a-&gt;setText(i18n(&quot;Insert link note&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Add a link note to the current basket without having &quot;
-	     &quot;to open the main window.&quot;));
+        i18n(&quot;Add a link note to the current basket without having &quot;
+             &quot;to open the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_note_add_color&quot;, Global::bnpView,
-		      SLOT(addNoteColor()));
+                      SLOT(addNoteColor()));
     a-&gt;setText(i18n(&quot;Insert color note&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Add a color note to the current basket without having to open &quot;
-	     &quot;the main window.&quot;));
+        i18n(&quot;Add a color note to the current basket without having to open &quot;
+             &quot;the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_note_pick_color&quot;, Global::bnpView,
-		      SLOT(slotColorFromScreenGlobal()));
+                      SLOT(slotColorFromScreenGlobal()));
     a-&gt;setText(i18n(&quot;Pick color from screen&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Add a color note picked from one pixel on screen to the current &quot;
-	     &quot;basket without &quot; &quot;having to open the main window.&quot;) );
+        i18n(&quot;Add a color note picked from one pixel on screen to the current &quot;
+             &quot;basket without &quot; &quot;having to open the main window.&quot;));
 
     a = ac-&gt;addAction(&quot;global_note_grab_screenshot&quot;, Global::bnpView,
-		      SLOT(grabScreenshotGlobal()));
+                      SLOT(grabScreenshotGlobal()));
     a-&gt;setText(i18n(&quot;Grab screen zone&quot;));
     a-&gt;setStatusTip(
-	i18n(&quot;Grab a screen zone as an image in the current basket without &quot;
-	     &quot;having to open the main window.&quot;));
+        i18n(&quot;Grab a screen zone as an image in the current basket without &quot;
+             &quot;having to open the main window.&quot;));
 
 #if 0
     a = ac-&gt;addAction(&quot;global_note_add_text&quot;, Global::bnpView,
-		      SLOT(addNoteText()));
+                      SLOT(addNoteText()));
     a-&gt;setText(i18n(&quot;Insert plain text note&quot;));
     a-&gt;setStatusTip(
-	    i18n(&quot;Add a plain text note to the current basket without having to &quot;
-		 &quot;open the main window.&quot;));
+        i18n(&quot;Add a plain text note to the current basket without having to &quot;
+             &quot;open the main window.&quot;));
 #endif
 }
 
 void BNPView::initialize()
 {
-	/// Configure the List View Columns:
-	m_tree  = new BasketTreeListView(this);
-	m_tree-&gt;setHeaderLabel(i18n(&quot;Baskets&quot;));
-	m_tree-&gt;setSortingEnabled(false/*Disabled*/);
-	m_tree-&gt;setRootIsDecorated(true);
-	m_tree-&gt;setLineWidth(1);
-	m_tree-&gt;setMidLineWidth(0);
-	m_tree-&gt;setFocusPolicy(Qt::NoFocus);
+    /// Configure the List View Columns:
+    m_tree  = new BasketTreeListView(this);
+    m_tree-&gt;setHeaderLabel(i18n(&quot;Baskets&quot;));
+    m_tree-&gt;setSortingEnabled(false/*Disabled*/);
+    m_tree-&gt;setRootIsDecorated(true);
+    m_tree-&gt;setLineWidth(1);
+    m_tree-&gt;setMidLineWidth(0);
+    m_tree-&gt;setFocusPolicy(Qt::NoFocus);
 
-	/// Configure the List View Drag and Drop:
-	m_tree-&gt;setDragEnabled(true);
-	m_tree-&gt;setAcceptDrops(true);
+    /// Configure the List View Drag and Drop:
+    m_tree-&gt;setDragEnabled(true);
+    m_tree-&gt;setAcceptDrops(true);
 
-	/// Configure the Splitter:
-	m_stack = new QStackedWidget(this);
+    /// Configure the Splitter:
+    m_stack = new QStackedWidget(this);
 
-	setOpaqueResize(true);
+    setOpaqueResize(true);
 
-	setCollapsible(indexOf(m_tree),  true);
-	setCollapsible(indexOf(m_stack), false);
-	setStretchFactor(indexOf(m_tree), 0);
-	setStretchFactor(indexOf(m_stack), 1);
+    setCollapsible(indexOf(m_tree),  true);
+    setCollapsible(indexOf(m_stack), false);
+    setStretchFactor(indexOf(m_tree), 0);
+    setStretchFactor(indexOf(m_stack), 1);
 
-	/// Configure the List View Signals:
-	connect( m_tree, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)) );
-	connect( m_tree, SIGNAL(itemPressed(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)) );
-	connect( m_tree, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)) );
+    /// Configure the List View Signals:
+    connect(m_tree, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)));
+    connect(m_tree, SIGNAL(itemPressed(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)));
+    connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(slotPressed(QTreeWidgetItem*, int)));
 
-	connect( m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)),         this, SLOT(needSave(QTreeWidgetItem*))    );
-	connect( m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)),        this, SLOT(needSave(QTreeWidgetItem*))    );
-	connect( m_tree, SIGNAL(contextMenuRequested(const QPoint&amp;)),      this, SLOT(slotContextMenu(const QPoint &amp;))      );
-	connect( m_tree, SIGNAL(mouseButtonPressed(int, QTreeWidgetItem*, const QPoint&amp;, int)), this,
-			SLOT(slotMouseButtonPressed(int, QTreeWidgetItem*, const QPoint&amp;, int)) );
-	connect( m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(slotShowProperties(QTreeWidgetItem*)) );
+    connect(m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)),         this, SLOT(needSave(QTreeWidgetItem*)));
+    connect(m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)),        this, SLOT(needSave(QTreeWidgetItem*)));
+    connect(m_tree, SIGNAL(contextMenuRequested(const QPoint&amp;)),      this, SLOT(slotContextMenu(const QPoint &amp;)));
+    connect(m_tree, SIGNAL(mouseButtonPressed(int, QTreeWidgetItem*, const QPoint&amp;, int)), this,
+            SLOT(slotMouseButtonPressed(int, QTreeWidgetItem*, const QPoint&amp;, int)));
+    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(slotShowProperties(QTreeWidgetItem*)));
 
-	connect( m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)),  this, SIGNAL(basketChanged()) );
-	connect( m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SIGNAL(basketChanged()) );
-	connect( this,   SIGNAL(basketNumberChanged(int)),  this, SIGNAL(basketChanged()) );
+    connect(m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)),  this, SIGNAL(basketChanged()));
+    connect(m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SIGNAL(basketChanged()));
+    connect(this,   SIGNAL(basketNumberChanged(int)),  this, SIGNAL(basketChanged()));
 
-	connect( this, SIGNAL(basketNumberChanged(int)), this, SLOT(slotBasketNumberChanged(int)) );
-	connect( this, SIGNAL(basketChanged()),          this, SLOT(slotBasketChanged())          );
+    connect(this, SIGNAL(basketNumberChanged(int)), this, SLOT(slotBasketNumberChanged(int)));
+    connect(this, SIGNAL(basketChanged()),          this, SLOT(slotBasketChanged()));
 
-	/* LikeBack */
-	Global::likeBack = new LikeBack(LikeBack::AllButtons, /*showBarByDefault=*/false, Global::config(), Global::about());
-	Global::likeBack-&gt;setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
+    /* LikeBack */
+    Global::likeBack = new LikeBack(LikeBack::AllButtons, /*showBarByDefault=*/false, Global::config(), Global::about());
+    Global::likeBack-&gt;setServer(&quot;basket.linux62.org&quot;, &quot;/likeback/send.php&quot;);
 
 // There are too much comments, and people reading comments are more and more international, so we accept only English:
-//	Global::likeBack-&gt;setAcceptedLanguages(QStringList::split(&quot;;&quot;, &quot;en;fr&quot;), i18n(&quot;Please write in English or French.&quot;));
+//  Global::likeBack-&gt;setAcceptedLanguages(QStringList::split(&quot;;&quot;, &quot;en;fr&quot;), i18n(&quot;Please write in English or French.&quot;));
 
-//	if (isPart())
-//		Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
+//  if (isPart())
+//      Global::likeBack-&gt;disableBar(); // See BNPView::shown() and BNPView::hide().
 
-	Global::likeBack-&gt;sendACommentAction(actionCollection()); // Just create it!
-	setupActions();
+    Global::likeBack-&gt;sendACommentAction(actionCollection()); // Just create it!
+    setupActions();
 
-	/// What's This Help for the tree:
-	m_tree-&gt;setWhatsThis(i18n(
-			&quot;&lt;h2&gt;Basket Tree&lt;/h2&gt;&quot;
-					&quot;Here is the list of your baskets. &quot;
-					&quot;You can organize your data by putting them in different baskets. &quot;
-					&quot;You can group baskets by subject by creating new baskets inside others. &quot;
-					&quot;You can browse between them by clicking a basket to open it, or reorganize them using drag and drop.&quot;));
+    /// What's This Help for the tree:
+    m_tree-&gt;setWhatsThis(i18n(
+                             &quot;&lt;h2&gt;Basket Tree&lt;/h2&gt;&quot;
+                             &quot;Here is the list of your baskets. &quot;
+                             &quot;You can organize your data by putting them in different baskets. &quot;
+                             &quot;You can group baskets by subject by creating new baskets inside others. &quot;
+                             &quot;You can browse between them by clicking a basket to open it, or reorganize them using drag and drop.&quot;));
 
-	setTreePlacement(Settings::treeOnLeft());
+    setTreePlacement(Settings::treeOnLeft());
 }
 
 void BNPView::setupActions()
@@ -487,14 +485,14 @@ void BNPView::setupActions()
     KActionCollection *ac = actionCollection();
 
     a = ac-&gt;addAction(&quot;basket_export_basket_archive&quot;, this,
-		      SLOT(saveAsArchive()));
+                      SLOT(saveAsArchive()));
     a-&gt;setText(i18n(&quot;&amp;Basket Archive...&quot;));
     a-&gt;setIcon(KIcon(&quot;baskets&quot;));
     a-&gt;setShortcut(0);
     m_actSaveAsArchive = a;
 
     a = ac-&gt;addAction(&quot;basket_import_basket_archive&quot;, this,
-		      SLOT(openArchive()));
+                      SLOT(openArchive()));
     a-&gt;setText(i18n(&quot;&amp;Basket Archive...&quot;));
     a-&gt;setIcon(KIcon(&quot;baskets&quot;));
     a-&gt;setShortcut(0);
@@ -534,7 +532,7 @@ void BNPView::setupActions()
     a-&gt;setShortcut(0);
 
     a = ac-&gt;addAction(&quot;basket_import_sticky_notes&quot;, this,
-		      SLOT(importStickyNotes()));
+                      SLOT(importStickyNotes()));
     a-&gt;setText(i18n(&quot;&amp;Sticky Notes&quot;));
     a-&gt;setIcon(KIcon(&quot;gnome&quot;));
     a-&gt;setShortcut(0);
@@ -565,23 +563,23 @@ void BNPView::setupActions()
     m_actCopyNote = ac-&gt;addAction(KStandardAction::Copy, this, SLOT(copyNote()));
 
     m_actSelectAll = ac-&gt;addAction(KStandardAction::SelectAll, this,
-				   SLOT(slotSelectAll()));
-    m_actSelectAll-&gt;setStatusTip( i18n( &quot;Selects all notes&quot; ) );
+                                   SLOT(slotSelectAll()));
+    m_actSelectAll-&gt;setStatusTip(i18n(&quot;Selects all notes&quot;));
 
-    a = ac-&gt;addAction(&quot;edit_unselect_all&quot;, this, SLOT( slotUnselectAll() ));
-    a-&gt;setText(i18n( &quot;U&amp;nselect All&quot; ));
+    a = ac-&gt;addAction(&quot;edit_unselect_all&quot;, this, SLOT(slotUnselectAll()));
+    a-&gt;setText(i18n(&quot;U&amp;nselect All&quot;));
     m_actUnselectAll = a;
-    m_actUnselectAll-&gt;setStatusTip( i18n( &quot;Unselects all selected notes&quot; ) );
+    m_actUnselectAll-&gt;setStatusTip(i18n(&quot;Unselects all selected notes&quot;));
 
     a = ac-&gt;addAction(&quot;edit_invert_selection&quot;, this,
-		      SLOT( slotInvertSelection() ));
-    a-&gt;setText(i18n( &quot;&amp;Invert Selection&quot; ));
-    a-&gt;setShortcut(Qt::CTRL+Qt::Key_Asterisk);
+                      SLOT(slotInvertSelection()));
+    a-&gt;setText(i18n(&quot;&amp;Invert Selection&quot;));
+    a-&gt;setShortcut(Qt::CTRL + Qt::Key_Asterisk);
     m_actInvertSelection = a;
 
     m_actInvertSelection-&gt;setStatusTip(
-	    i18n( &quot;Inverts the current selection of notes&quot; )
-	    );
+        i18n(&quot;Inverts the current selection of notes&quot;)
+    );
 
     a = ac-&gt;addAction(&quot;note_edit&quot;, this, SLOT(editNote()));
     a-&gt;setText(i18nc(&quot;Verb; not Menu&quot;, &quot;&amp;Edit...&quot;));
@@ -590,7 +588,7 @@ void BNPView::setupActions()
     m_actEditNote = a;
 
     m_actOpenNote = ac-&gt;addAction(KStandardAction::Open, &quot;note_open&quot;,
-				  this, SLOT(openNote()));
+                                  this, SLOT(openNote()));
     m_actOpenNote-&gt;setIcon(KIcon(&quot;window-new&quot;));
     m_actOpenNote-&gt;setText(i18n(&quot;&amp;Open&quot;));
     m_actOpenNote-&gt;setShortcut(KShortcut(&quot;F9&quot;));
@@ -601,8 +599,8 @@ void BNPView::setupActions()
     m_actOpenNoteWith = a;
 
     m_actSaveNoteAs = ac-&gt;addAction(KStandardAction::SaveAs,
-				    &quot;note_save_to_file&quot;,
-				    this, SLOT(saveNoteAs()));
+                                    &quot;note_save_to_file&quot;,
+                                    this, SLOT(saveNoteAs()));
     m_actSaveNoteAs-&gt;setText(i18n(&quot;&amp;Save to File...&quot;));
     m_actSaveNoteAs-&gt;setShortcut(KShortcut(&quot;F10&quot;));
 
@@ -642,14 +640,14 @@ void BNPView::setupActions()
     m_actMoveOnBottom = a;
 
     m_actPaste = ac-&gt;addAction(KStandardAction::Paste, this,
-			       SLOT(pasteInCurrentBasket()));
+                               SLOT(pasteInCurrentBasket()));
 
     /** Insert : **************************************************************/
 
     QSignalMapper *insertEmptyMapper  = new QSignalMapper(this);
     QSignalMapper *insertWizardMapper = new QSignalMapper(this);
-    connect( insertEmptyMapper,  SIGNAL(mapped(int)), this, SLOT(insertEmpty(int))  );
-    connect( insertWizardMapper, SIGNAL(mapped(int)), this, SLOT(insertWizard(int)) );
+    connect(insertEmptyMapper,  SIGNAL(mapped(int)), this, SLOT(insertEmpty(int)));
+    connect(insertWizardMapper, SIGNAL(mapped(int)), this, SLOT(insertWizard(int)));
 
 #if 0
     a = ac-&gt;addAction(&quot;insert_text&quot;);
@@ -701,25 +699,25 @@ void BNPView::setupActions()
     a-&gt;setIcon(KIcon(&quot;document-import&quot;));
     m_actLoadFile = a;
 
-//	connect( m_actInsertText,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-    connect( m_actInsertHtml,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-    connect( m_actInsertImage,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-    connect( m_actInsertLink,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-    connect( m_actInsertColor,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-    connect( m_actInsertLauncher, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
-//	insertEmptyMapper-&gt;setMapping(m_actInsertText,     NoteType::Text    );
-    insertEmptyMapper-&gt;setMapping(m_actInsertHtml,     NoteType::Html    );
-    insertEmptyMapper-&gt;setMapping(m_actInsertImage,    NoteType::Image   );
-    insertEmptyMapper-&gt;setMapping(m_actInsertLink,     NoteType::Link    );
-    insertEmptyMapper-&gt;setMapping(m_actInsertColor,    NoteType::Color   );
+//  connect( m_actInsertText,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
+    connect(m_actInsertHtml,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()));
+    connect(m_actInsertImage,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()));
+    connect(m_actInsertLink,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()));
+    connect(m_actInsertColor,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()));
+    connect(m_actInsertLauncher, SIGNAL(activated()), insertEmptyMapper, SLOT(map()));
+//  insertEmptyMapper-&gt;setMapping(m_actInsertText,     NoteType::Text    );
+    insertEmptyMapper-&gt;setMapping(m_actInsertHtml,     NoteType::Html);
+    insertEmptyMapper-&gt;setMapping(m_actInsertImage,    NoteType::Image);
+    insertEmptyMapper-&gt;setMapping(m_actInsertLink,     NoteType::Link);
+    insertEmptyMapper-&gt;setMapping(m_actInsertColor,    NoteType::Color);
     insertEmptyMapper-&gt;setMapping(m_actInsertLauncher, NoteType::Launcher);
 
-    connect( m_actImportKMenu, SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
-    connect( m_actImportIcon,  SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
-    connect( m_actLoadFile,    SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
-    insertWizardMapper-&gt;setMapping(m_actImportKMenu,  1 );
-    insertWizardMapper-&gt;setMapping(m_actImportIcon,   2 );
-    insertWizardMapper-&gt;setMapping(m_actLoadFile,     3 );
+    connect(m_actImportKMenu, SIGNAL(activated()), insertWizardMapper, SLOT(map()));
+    connect(m_actImportIcon,  SIGNAL(activated()), insertWizardMapper, SLOT(map()));
+    connect(m_actLoadFile,    SIGNAL(activated()), insertWizardMapper, SLOT(map()));
+    insertWizardMapper-&gt;setMapping(m_actImportKMenu,  1);
+    insertWizardMapper-&gt;setMapping(m_actImportIcon,   2);
+    insertWizardMapper-&gt;setMapping(m_actLoadFile,     3);
 
     m_colorPicker = new DesktopColorPicker();
 
@@ -729,9 +727,9 @@ void BNPView::setupActions()
     m_actColorPicker = a;
 
     connect(m_colorPicker, SIGNAL(pickedColor(const QColor&amp;)),
-	    this, SLOT(colorPicked(const QColor&amp;)));
+            this, SLOT(colorPicked(const QColor&amp;)));
     connect(m_colorPicker, SIGNAL(canceledPick()),
-	    this, SLOT(colorPickingCanceled()));
+            this, SLOT(colorPickingCanceled()));
 
     a = ac-&gt;addAction(&quot;insert_screen_capture&quot;, this, SLOT(grabScreenshot()));
     a-&gt;setText(i18n(&quot;Grab Screen &amp;Zone&quot;));
@@ -741,17 +739,17 @@ void BNPView::setupActions()
     //connect( m_actGrabScreenshot, SIGNAL(regionGrabbed(const QPixmap&amp;)), this, SLOT(screenshotGrabbed(const QPixmap&amp;)) );
     //connect( m_colorPicker, SIGNAL(canceledPick()),             this, SLOT(colorPickingCanceled())     );
 
-//	m_insertActions.append( m_actInsertText     );
-    m_insertActions.append( m_actInsertHtml     );
-    m_insertActions.append( m_actInsertLink     );
-    m_insertActions.append( m_actInsertImage    );
-    m_insertActions.append( m_actInsertColor    );
-    m_insertActions.append( m_actImportKMenu    );
-    m_insertActions.append( m_actInsertLauncher );
-    m_insertActions.append( m_actImportIcon     );
-    m_insertActions.append( m_actLoadFile       );
-    m_insertActions.append( m_actColorPicker    );
-    m_insertActions.append( m_actGrabScreenshot );
+//  m_insertActions.append( m_actInsertText     );
+    m_insertActions.append(m_actInsertHtml);
+    m_insertActions.append(m_actInsertLink);
+    m_insertActions.append(m_actInsertImage);
+    m_insertActions.append(m_actInsertColor);
+    m_insertActions.append(m_actImportKMenu);
+    m_insertActions.append(m_actInsertLauncher);
+    m_insertActions.append(m_actImportIcon);
+    m_insertActions.append(m_actLoadFile);
+    m_insertActions.append(m_actColorPicker);
+    m_insertActions.append(m_actGrabScreenshot);
 
     /** Basket : **************************************************************/
 
@@ -760,9 +758,9 @@ void BNPView::setupActions()
     bool runInsideKontact = true;
     QWidget *parentWidget = (QWidget*) parent();
     while (parentWidget) {
-	    if (parentWidget-&gt;inherits(&quot;MainWindow&quot;))
-		    runInsideKontact = false;
-	    parentWidget = (QWidget*) parentWidget-&gt;parent();
+        if (parentWidget-&gt;inherits(&quot;MainWindow&quot;))
+            runInsideKontact = false;
+        parentWidget = (QWidget*) parentWidget-&gt;parent();
     }
 
     // Use the &quot;basket&quot; incon in Kontact so it is consistent with the Kontact &quot;New...&quot; icon
@@ -789,7 +787,7 @@ void BNPView::setupActions()
     newBasketMenu-&gt;addAction(actNewBasket);
     newBasketMenu-&gt;addAction(actNewSubBasket);
     newBasketMenu-&gt;addAction(actNewSiblingBasket);
-    connect( newBasketMenu, SIGNAL(activated()), this, SLOT(askNewBasket()) );
+    connect(newBasketMenu, SIGNAL(activated()), this, SLOT(askNewBasket()));
 
     a = ac-&gt;addAction(&quot;basket_properties&quot;, this, SLOT(propBasket()));
     a-&gt;setText(i18n(&quot;&amp;Properties...&quot;));
@@ -829,7 +827,7 @@ void BNPView::setupActions()
     m_actShowFilter = toggleAct;
 
     connect(m_actShowFilter, SIGNAL(toggled(bool)),
-	    this, SLOT(showHideFilterBar(bool)) );
+            this, SLOT(showHideFilterBar(bool)));
 
     toggleAct = new KToggleAction(ac);
     ac-&gt;addAction(&quot;edit_filter_all_baskets&quot;, toggleAct);
@@ -839,10 +837,10 @@ void BNPView::setupActions()
     m_actFilterAllBaskets = toggleAct;
 
     connect(m_actFilterAllBaskets, SIGNAL(toggled(bool)),
-	    this, SLOT(toggleFilterAllBaskets(bool)));
+            this, SLOT(toggleFilterAllBaskets(bool)));
 
-    a = ac-&gt;addAction(&quot;edit_filter_reset&quot;, this, SLOT( slotResetFilter() ));
-    a-&gt;setText(i18n( &quot;&amp;Reset Filter&quot; ));
+    a = ac-&gt;addAction(&quot;edit_filter_reset&quot;, this, SLOT(slotResetFilter()));
+    a-&gt;setText(i18n(&quot;&amp;Reset Filter&quot;));
     a-&gt;setIcon(KIcon(&quot;edit-clear-locationbar-rtl&quot;));
     a-&gt;setShortcut(KShortcut(&quot;Ctrl+R&quot;));
     m_actResetFilter = a;
@@ -850,31 +848,31 @@ void BNPView::setupActions()
     /** Go : ******************************************************************/
 
     a = ac-&gt;addAction(&quot;go_basket_previous&quot;, this, SLOT(goToPreviousBasket()));
-    a-&gt;setText(i18n( &quot;&amp;Previous Basket&quot; ));
+    a-&gt;setText(i18n(&quot;&amp;Previous Basket&quot;));
     a-&gt;setIcon(KIcon(&quot;go-up&quot;));
     a-&gt;setShortcut(KShortcut(&quot;Alt+Up&quot;));
     m_actPreviousBasket = a;
 
     a = ac-&gt;addAction(&quot;go_basket_next&quot;, this, SLOT(goToNextBasket()));
-    a-&gt;setText(i18n( &quot;&amp;Next Basket&quot; ));
+    a-&gt;setText(i18n(&quot;&amp;Next Basket&quot;));
     a-&gt;setIcon(KIcon(&quot;go-down&quot;));
     a-&gt;setShortcut(KShortcut(&quot;Alt+Down&quot;));
     m_actNextBasket = a;
 
     a = ac-&gt;addAction(&quot;go_basket_fold&quot;, this, SLOT(foldBasket()));
-    a-&gt;setText(i18n( &quot;&amp;Fold Basket&quot; ));
+    a-&gt;setText(i18n(&quot;&amp;Fold Basket&quot;));
     a-&gt;setIcon(KIcon(&quot;go-previous&quot;));
     a-&gt;setShortcut(KShortcut(&quot;Alt+Left&quot;));
     m_actFoldBasket = a;
 
     a = ac-&gt;addAction(&quot;go_basket_expand&quot;, this, SLOT(expandBasket()));
-    a-&gt;setText(i18n( &quot;&amp;Expand Basket&quot; ));
+    a-&gt;setText(i18n(&quot;&amp;Expand Basket&quot;));
     a-&gt;setIcon(KIcon(&quot;go-next&quot;));
     a-&gt;setShortcut(KShortcut(&quot;Alt+Right&quot;));
     m_actExpandBasket = a;
 
 #if 0
-   // FOR_BETA_PURPOSE:
+    // FOR_BETA_PURPOSE:
     a = ac-&gt;addAction(&quot;beta_convert_texts&quot;, this, SLOT(convertTexts()));
     a-&gt;setText(i18n(&quot;Convert text notes to rich text notes&quot;));
     a-&gt;setIcon(KIcon(&quot;run-build-file&quot;));
@@ -890,405 +888,404 @@ void BNPView::setupActions()
 
 BasketListViewItem* BNPView::topLevelItem(int i)
 {
-	return (BasketListViewItem *)m_tree-&gt;topLevelItem(i);
+    return (BasketListViewItem *)m_tree-&gt;topLevelItem(i);
 }
 
 void BNPView::slotShowProperties(QTreeWidgetItem *item)
 {
-	if (item)
-		propBasket();
+    if (item)
+        propBasket();
 }
 
 void BNPView::slotMouseButtonPressed(int button, QTreeWidgetItem *item, const QPoint &amp;/*pos*/, int /*column*/)
 {
-	if (item &amp;&amp; (button &amp; Qt::MidButton)) {
-		// TODO: Paste into ((BasketListViewItem*)listViewItem)-&gt;basket()
-	}
+    if (item &amp;&amp; (button &amp; Qt::MidButton)) {
+        // TODO: Paste into ((BasketListViewItem*)listViewItem)-&gt;basket()
+    }
 }
 
 void BNPView::slotContextMenu(const QPoint &amp;pos)
 {
-	QTreeWidgetItem *item;
-	item = m_tree-&gt;itemAt(pos);
-	QString menuName;
-	if (item) {
-		Basket* basket = ((BasketListViewItem*)item)-&gt;basket();
-
-		setCurrentBasket(basket);
-		menuName = &quot;basket_popup&quot;;
-	} else {
-		menuName = &quot;tab_bar_popup&quot;;
-		/*
-		* &quot;File -&gt; New&quot; create a new basket with the same parent basket as the the current one.
-		* But when invoked when right-clicking the empty area at the bottom of the basket tree,
-		* it is obvious the user want to create a new basket at the bottom of the tree (with no parent).
-		* So we set a temporary variable during the time the popup menu is shown,
-		 * so the slot askNewBasket() will do the right thing:
-		*/
-		setNewBasketPopup();
-	}
-
-	KMenu *menu = popupMenu(menuName);
-	connect( menu, SIGNAL(aboutToHide()),  this, SLOT(aboutToHideNewBasketPopup()) );
-	menu-&gt;exec(m_tree-&gt;mapToGlobal(pos));
+    QTreeWidgetItem *item;
+    item = m_tree-&gt;itemAt(pos);
+    QString menuName;
+    if (item) {
+        Basket* basket = ((BasketListViewItem*)item)-&gt;basket();
+
+        setCurrentBasket(basket);
+        menuName = &quot;basket_popup&quot;;
+    } else {
+        menuName = &quot;tab_bar_popup&quot;;
+        /*
+        * &quot;File -&gt; New&quot; create a new basket with the same parent basket as the the current one.
+        * But when invoked when right-clicking the empty area at the bottom of the basket tree,
+        * it is obvious the user want to create a new basket at the bottom of the tree (with no parent).
+        * So we set a temporary variable during the time the popup menu is shown,
+         * so the slot askNewBasket() will do the right thing:
+        */
+        setNewBasketPopup();
+    }
+
+    KMenu *menu = popupMenu(menuName);
+    connect(menu, SIGNAL(aboutToHide()),  this, SLOT(aboutToHideNewBasketPopup()));
+    menu-&gt;exec(m_tree-&gt;mapToGlobal(pos));
 }
 
 void BNPView::save()
 {
-	DEBUG_WIN &lt;&lt; &quot;Basket Tree: Saving...&quot;;
+    DEBUG_WIN &lt;&lt; &quot;Basket Tree: Saving...&quot;;
 
-	// Create Document:
-	QDomDocument document(&quot;basketTree&quot;);
-	QDomElement root = document.createElement(&quot;basketTree&quot;);
-	document.appendChild(root);
+    // Create Document:
+    QDomDocument document(&quot;basketTree&quot;);
+    QDomElement root = document.createElement(&quot;basketTree&quot;);
+    document.appendChild(root);
 
-	// Save Basket Tree:
-	save(m_tree, 0, document, root);
+    // Save Basket Tree:
+    save(m_tree, 0, document, root);
 
-	// Write to Disk:
-	Basket::safelySaveToFile(Global::basketsFolder() + &quot;baskets.xml&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString());
-// 	QFile file(Global::basketsFolder() + &quot;baskets.xml&quot;);
-// 	if (file.open(QIODevice::WriteOnly)) {
-// 		QTextStream stream(&amp;file);
-// 		stream.setEncoding(QTextStream::UnicodeUTF8);
-// 		QString xml = document.toString();
-// 		stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
-// 		stream &lt;&lt; xml;
-// 		file.close();
-// 	}
+    // Write to Disk:
+    Basket::safelySaveToFile(Global::basketsFolder() + &quot;baskets.xml&quot;, &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot; + document.toString());
+//  QFile file(Global::basketsFolder() + &quot;baskets.xml&quot;);
+//  if (file.open(QIODevice::WriteOnly)) {
+//      QTextStream stream(&amp;file);
+//      stream.setEncoding(QTextStream::UnicodeUTF8);
+//      QString xml = document.toString();
+//      stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
+//      stream &lt;&lt; xml;
+//      file.close();
+//  }
 }
 
 void BNPView::save(QTreeWidget *listView, QTreeWidgetItem* item, QDomDocument &amp;document, QDomElement &amp;parentElement)
 {
 
-	if (item == 0){
-		// For each basket:
-		for (int i=0; i&lt; listView-&gt;topLevelItemCount(); i++){
-			item = listView-&gt;topLevelItem(i);
-			Basket* basket = ((BasketListViewItem *)item)-&gt;basket();
-
-			QDomElement basketElement = document.createElement(&quot;basket&quot;);
-			parentElement.appendChild(basketElement);
-
-			// Save Attributes:
-			basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
-			if (item-&gt;childCount() &gt;=0 ) // If it can be expanded/folded:
-				basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
-
-			if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
-				basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
-
-			// Save Properties:
-			QDomElement properties = document.createElement(&quot;properties&quot;);
-			basketElement.appendChild(properties);
-			basket-&gt;saveProperties(document, properties);
-
-			// Save Child Basket:
-			if (item-&gt;childCount() &gt;=0){
-				for (int i=0; i &lt; item-&gt;childCount(); i++)
-					save(0, item-&gt;child(i), document, basketElement);
-			}
-		}
-	}
-	else{
-		Basket* basket = ((BasketListViewItem *)item)-&gt;basket();
-
-		QDomElement basketElement = document.createElement(&quot;basket&quot;);
-		parentElement.appendChild(basketElement);
-
-		// Save Attributes:
-		basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
-		if (item-&gt;childCount() &gt;=0 ) // If it can be expanded/folded:
-			basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
-
-		if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
-			basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
-
-		// Save Properties:
-		QDomElement properties = document.createElement(&quot;properties&quot;);
-		basketElement.appendChild(properties);
-		basket-&gt;saveProperties(document, properties);
-
-		// Save Child Basket:
-		if (item-&gt;childCount() &gt;=0){
-			for (int i=0; i &lt; item-&gt;childCount(); i++)
-				save(0, item-&gt;child(i), document, basketElement);
-		}
-	}
+    if (item == 0) {
+        // For each basket:
+        for (int i = 0; i &lt; listView-&gt;topLevelItemCount(); i++) {
+            item = listView-&gt;topLevelItem(i);
+            Basket* basket = ((BasketListViewItem *)item)-&gt;basket();
+
+            QDomElement basketElement = document.createElement(&quot;basket&quot;);
+            parentElement.appendChild(basketElement);
+
+            // Save Attributes:
+            basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
+            if (item-&gt;childCount() &gt;= 0) // If it can be expanded/folded:
+                basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
+
+            if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
+                basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
+
+            // Save Properties:
+            QDomElement properties = document.createElement(&quot;properties&quot;);
+            basketElement.appendChild(properties);
+            basket-&gt;saveProperties(document, properties);
+
+            // Save Child Basket:
+            if (item-&gt;childCount() &gt;= 0) {
+                for (int i = 0; i &lt; item-&gt;childCount(); i++)
+                    save(0, item-&gt;child(i), document, basketElement);
+            }
+        }
+    } else {
+        Basket* basket = ((BasketListViewItem *)item)-&gt;basket();
+
+        QDomElement basketElement = document.createElement(&quot;basket&quot;);
+        parentElement.appendChild(basketElement);
+
+        // Save Attributes:
+        basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
+        if (item-&gt;childCount() &gt;= 0) // If it can be expanded/folded:
+            basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
+
+        if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
+            basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
+
+        // Save Properties:
+        QDomElement properties = document.createElement(&quot;properties&quot;);
+        basketElement.appendChild(properties);
+        basket-&gt;saveProperties(document, properties);
+
+        // Save Child Basket:
+        if (item-&gt;childCount() &gt;= 0) {
+            for (int i = 0; i &lt; item-&gt;childCount(); i++)
+                save(0, item-&gt;child(i), document, basketElement);
+        }
+    }
 }
 
 QDomElement BNPView::basketElement(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement)
 {
-	Basket *basket = ((BasketListViewItem*)item)-&gt;basket();
-	QDomElement basketElement = document.createElement(&quot;basket&quot;);
-	parentElement.appendChild(basketElement);
-	// Save Attributes:
-	basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
-	if (item-&gt;child(0)) // If it can be expanded/folded:
-		basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
-	if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
-		basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
-	// Save Properties:
-	QDomElement properties = document.createElement(&quot;properties&quot;);
-	basketElement.appendChild(properties);
-	basket-&gt;saveProperties(document, properties);
-	return basketElement;
+    Basket *basket = ((BasketListViewItem*)item)-&gt;basket();
+    QDomElement basketElement = document.createElement(&quot;basket&quot;);
+    parentElement.appendChild(basketElement);
+    // Save Attributes:
+    basketElement.setAttribute(&quot;folderName&quot;, basket-&gt;folderName());
+    if (item-&gt;child(0)) // If it can be expanded/folded:
+        basketElement.setAttribute(&quot;folded&quot;, XMLWork::trueOrFalse(!item-&gt;isExpanded()));
+    if (((BasketListViewItem*)item)-&gt;isCurrentBasket())
+        basketElement.setAttribute(&quot;lastOpened&quot;, &quot;true&quot;);
+    // Save Properties:
+    QDomElement properties = document.createElement(&quot;properties&quot;);
+    basketElement.appendChild(properties);
+    basket-&gt;saveProperties(document, properties);
+    return basketElement;
 }
 
 void BNPView::saveSubHierarchy(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement, bool recursive)
 {
-	QDomElement element = basketElement(item, document, parentElement);
-	if (recursive &amp;&amp; item-&gt;child(0))
-		save(0,item-&gt;child(0), document, element);
+    QDomElement element = basketElement(item, document, parentElement);
+    if (recursive &amp;&amp; item-&gt;child(0))
+        save(0, item-&gt;child(0), document, element);
 }
 
 void BNPView::load()
 {
-	QDomDocument *doc = XMLWork::openFile(&quot;basketTree&quot;, Global::basketsFolder() + &quot;baskets.xml&quot;);
-	//BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
-	if (!doc)
-		doc = XMLWork::openFile(&quot;basketsTree&quot;, Global::basketsFolder() + &quot;baskets.xml&quot;);
-	//END
-	if (doc != 0) {
-		QDomElement docElem = doc-&gt;documentElement();
-		load(m_tree, 0L, docElem);
-	}
-	m_loading = false;
+    QDomDocument *doc = XMLWork::openFile(&quot;basketTree&quot;, Global::basketsFolder() + &quot;baskets.xml&quot;);
+    //BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
+    if (!doc)
+        doc = XMLWork::openFile(&quot;basketsTree&quot;, Global::basketsFolder() + &quot;baskets.xml&quot;);
+    //END
+    if (doc != 0) {
+        QDomElement docElem = doc-&gt;documentElement();
+        load(m_tree, 0L, docElem);
+    }
+    m_loading = false;
 }
 
 void BNPView::load(QTreeWidget *listView, QTreeWidgetItem *item, const QDomElement &amp;baskets)
 {
-	QDomNode n = baskets.firstChild();
-	while ( ! n.isNull() ) {
-		QDomElement element = n.toElement();
-		if ( (!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot; ) {
-			QString folderName = element.attribute(&quot;folderName&quot;);
-			if (!folderName.isEmpty()) {
-				Basket *basket = loadBasket(folderName);
-				BasketListViewItem *basketItem = appendBasket(basket, item);
-				basketItem-&gt;setExpanded(!XMLWork::trueOrFalse(element.attribute(&quot;folded&quot;, &quot;false&quot;), false));
-				basket-&gt;loadProperties(XMLWork::getElement(element, &quot;properties&quot;));
-				if (XMLWork::trueOrFalse(element.attribute(&quot;lastOpened&quot;, element.attribute(&quot;lastOpened&quot;, &quot;false&quot;)), false)) // Compat with 0.6.0-Alphas
-					setCurrentBasket(basket);
-				// Load Sub-baskets:
-				load(/*(QListView*)*/0L, basketItem, element);
-			}
-		}
-		n = n.nextSibling();
-	}
+    QDomNode n = baskets.firstChild();
+    while (! n.isNull()) {
+        QDomElement element = n.toElement();
+        if ((!element.isNull()) &amp;&amp; element.tagName() == &quot;basket&quot;) {
+            QString folderName = element.attribute(&quot;folderName&quot;);
+            if (!folderName.isEmpty()) {
+                Basket *basket = loadBasket(folderName);
+                BasketListViewItem *basketItem = appendBasket(basket, item);
+                basketItem-&gt;setExpanded(!XMLWork::trueOrFalse(element.attribute(&quot;folded&quot;, &quot;false&quot;), false));
+                basket-&gt;loadProperties(XMLWork::getElement(element, &quot;properties&quot;));
+                if (XMLWork::trueOrFalse(element.attribute(&quot;lastOpened&quot;, element.attribute(&quot;lastOpened&quot;, &quot;false&quot;)), false)) // Compat with 0.6.0-Alphas
+                    setCurrentBasket(basket);
+                // Load Sub-baskets:
+                load(/*(QListView*)*/0L, basketItem, element);
+            }
+        }
+        n = n.nextSibling();
+    }
 }
 
 Basket* BNPView::loadBasket(const QString &amp;folderName)
 {
-	if (folderName.isEmpty())
-		return 0;
+    if (folderName.isEmpty())
+        return 0;
 
-	DecoratedBasket *decoBasket = new DecoratedBasket(m_stack, folderName);
-	Basket          *basket     = decoBasket-&gt;basket();
-	m_stack-&gt;addWidget(decoBasket);
-	connect( basket, SIGNAL(countsChanged(Basket*)), this, SLOT(countsChanged(Basket*)) );
-	// Important: Create listViewItem and connect signal BEFORE loadProperties(), so we get the listViewItem updated without extra work:
-	connect( basket, SIGNAL(propertiesChanged(Basket*)), this, SLOT(updateBasketListViewItem(Basket*)) );
+    DecoratedBasket *decoBasket = new DecoratedBasket(m_stack, folderName);
+    Basket          *basket     = decoBasket-&gt;basket();
+    m_stack-&gt;addWidget(decoBasket);
+    connect(basket, SIGNAL(countsChanged(Basket*)), this, SLOT(countsChanged(Basket*)));
+    // Important: Create listViewItem and connect signal BEFORE loadProperties(), so we get the listViewItem updated without extra work:
+    connect(basket, SIGNAL(propertiesChanged(Basket*)), this, SLOT(updateBasketListViewItem(Basket*)));
 
-	connect( basket-&gt;decoration()-&gt;filterBar(), SIGNAL(newFilter(const FilterData&amp;)), this, SLOT(newFilterFromFilterBar()) );
+    connect(basket-&gt;decoration()-&gt;filterBar(), SIGNAL(newFilter(const FilterData&amp;)), this, SLOT(newFilterFromFilterBar()));
 
-	return basket;
+    return basket;
 }
 
 int BNPView::basketCount(QTreeWidgetItem *parent)
 {
-	int count = 1;
-	if (parent == NULL)
-		return 0;
+    int count = 1;
+    if (parent == NULL)
+        return 0;
 
-	for (int i=0;i&lt;parent-&gt;childCount();i++){
-		count += basketCount(parent-&gt;child(i));
-	}
+    for (int i = 0; i &lt; parent-&gt;childCount(); i++) {
+        count += basketCount(parent-&gt;child(i));
+    }
 
-	return count;
+    return count;
 }
 
 bool BNPView::canFold()
 {
-	BasketListViewItem *item = listViewItemForBasket(currentBasket());
-	if (!item)
-		return false;
-	return item-&gt;parent() || (item-&gt;childCount()&gt;0 &amp;&amp; item-&gt;isExpanded());
+    BasketListViewItem *item = listViewItemForBasket(currentBasket());
+    if (!item)
+        return false;
+    return item-&gt;parent() || (item-&gt;childCount() &gt; 0 &amp;&amp; item-&gt;isExpanded());
 }
 
 bool BNPView::canExpand()
 {
-	BasketListViewItem *item = listViewItemForBasket(currentBasket());
-	if (!item)
-		return false;
-	return item-&gt;childCount() &gt; 0;
+    BasketListViewItem *item = listViewItemForBasket(currentBasket());
+    if (!item)
+        return false;
+    return item-&gt;childCount() &gt; 0;
 }
 
 BasketListViewItem* BNPView::appendBasket(Basket *basket, QTreeWidgetItem *parentItem)
 {
-	BasketListViewItem *newBasketItem;
-	if (parentItem)
-		newBasketItem = new BasketListViewItem(parentItem, parentItem-&gt;child(parentItem-&gt;childCount()-1), basket);
-	else {
-		newBasketItem = new BasketListViewItem(m_tree, m_tree-&gt;topLevelItem(m_tree-&gt;topLevelItemCount()-1), basket);
-	}
+    BasketListViewItem *newBasketItem;
+    if (parentItem)
+        newBasketItem = new BasketListViewItem(parentItem, parentItem-&gt;child(parentItem-&gt;childCount() - 1), basket);
+    else {
+        newBasketItem = new BasketListViewItem(m_tree, m_tree-&gt;topLevelItem(m_tree-&gt;topLevelItemCount() - 1), basket);
+    }
 
-	emit basketNumberChanged(basketCount());
+    emit basketNumberChanged(basketCount());
 
-	return newBasketItem;
+    return newBasketItem;
 }
 
 void BNPView::loadNewBasket(const QString &amp;folderName, const QDomElement &amp;properties, Basket *parent)
 {
-	Basket *basket = loadBasket(folderName);
-	appendBasket(basket, (basket ? listViewItemForBasket(parent) : 0));
-	basket-&gt;loadProperties(properties);
-	setCurrentBasket(basket);
-//	save();
+    Basket *basket = loadBasket(folderName);
+    appendBasket(basket, (basket ? listViewItemForBasket(parent) : 0));
+    basket-&gt;loadProperties(properties);
+    setCurrentBasket(basket);
+//  save();
 }
 
 int BNPView::topLevelItemCount()
 {
-	return m_tree-&gt;topLevelItemCount();
+    return m_tree-&gt;topLevelItemCount();
 }
 
 void BNPView::goToPreviousBasket()
 {
-	if (m_tree-&gt;topLevelItemCount()&lt;=0)
-		return;
+    if (m_tree-&gt;topLevelItemCount() &lt;= 0)
+        return;
 
-	BasketListViewItem *item     = listViewItemForBasket(currentBasket());
-	BasketListViewItem *toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(item);
+    BasketListViewItem *item     = listViewItemForBasket(currentBasket());
+    BasketListViewItem *toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(item);
 
-	while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()){
-		toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(toSwitch);
-	}
+    while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()) {
+        toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(toSwitch);
+    }
 
-	if (!toSwitch) {
-		toSwitch = (BasketListViewItem *)m_tree-&gt;topLevelItem(m_tree-&gt;topLevelItemCount()-1);
-		while (toSwitch-&gt;childCount() &gt;=0){
-			toSwitch = (BasketListViewItem *)toSwitch-&gt;child(toSwitch-&gt;childCount()-1);
-		}
-	}
+    if (!toSwitch) {
+        toSwitch = (BasketListViewItem *)m_tree-&gt;topLevelItem(m_tree-&gt;topLevelItemCount() - 1);
+        while (toSwitch-&gt;childCount() &gt;= 0) {
+            toSwitch = (BasketListViewItem *)toSwitch-&gt;child(toSwitch-&gt;childCount() - 1);
+        }
+    }
 
-	while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()){
-		toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(toSwitch);
-	}
+    while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()) {
+        toSwitch = (BasketListViewItem *)m_tree-&gt;itemAbove(toSwitch);
+    }
 
-	if (toSwitch)
-		setCurrentBasket(toSwitch-&gt;basket());
+    if (toSwitch)
+        setCurrentBasket(toSwitch-&gt;basket());
 
-	if (Settings::usePassivePopup())
-		showPassiveContent();
+    if (Settings::usePassivePopup())
+        showPassiveContent();
 }
 
 void BNPView::goToNextBasket()
 {
-	if (m_tree-&gt;topLevelItemCount()&lt;=0)
-		return;
+    if (m_tree-&gt;topLevelItemCount() &lt;= 0)
+        return;
 
-	BasketListViewItem *item     = listViewItemForBasket(currentBasket());
-	BasketListViewItem *toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(item);
+    BasketListViewItem *item     = listViewItemForBasket(currentBasket());
+    BasketListViewItem *toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(item);
 
-	while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()){
-		toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(toSwitch);
-	}
+    while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()) {
+        toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(toSwitch);
+    }
 
-	if (!toSwitch) {
-		//toSwitch = (BasketListViewItem*)m_tree-&gt;child(0);
-		toSwitch = (BasketListViewItem*)m_tree-&gt;itemAt(0, 0);
-	}
+    if (!toSwitch) {
+        //toSwitch = (BasketListViewItem*)m_tree-&gt;child(0);
+        toSwitch = (BasketListViewItem*)m_tree-&gt;itemAt(0, 0);
+    }
 
-	while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()){
-		toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(toSwitch);
-	}
+    while (toSwitch &amp;&amp; !toSwitch-&gt;isShown()) {
+        toSwitch = (BasketListViewItem *)m_tree-&gt;itemBelow(toSwitch);
+    }
 
-	if (toSwitch)
-		setCurrentBasket(toSwitch-&gt;basket());
+    if (toSwitch)
+        setCurrentBasket(toSwitch-&gt;basket());
 
-	if (Settings::usePassivePopup())
-		showPassiveContent();
+    if (Settings::usePassivePopup())
+        showPassiveContent();
 }
 
 void BNPView::foldBasket()
 {
-	BasketListViewItem *item = listViewItemForBasket(currentBasket());
-	if (item &amp;&amp; item-&gt;childCount()&lt;=0)
-		item-&gt;setExpanded(false); // If Alt+Left is hitted and there is nothing to close, make sure the focus will go to the parent basket
+    BasketListViewItem *item = listViewItemForBasket(currentBasket());
+    if (item &amp;&amp; item-&gt;childCount() &lt;= 0)
+        item-&gt;setExpanded(false); // If Alt+Left is hitted and there is nothing to close, make sure the focus will go to the parent basket
 
-	QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Left, 0, 0);
-	QApplication::postEvent(m_tree, keyEvent);
+    QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Left, 0, 0);
+    QApplication::postEvent(m_tree, keyEvent);
 }
 
 void BNPView::expandBasket()
 {
-	QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Right, 0, 0);
-	QApplication::postEvent(m_tree, keyEvent);
+    QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Right, 0, 0);
+    QApplication::postEvent(m_tree, keyEvent);
 }
 
 void BNPView::closeAllEditors()
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = (BasketListViewItem*)(*it);
-		item-&gt;basket()-&gt;closeEditor();
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = (BasketListViewItem*)(*it);
+        item-&gt;basket()-&gt;closeEditor();
+        ++it;
+    }
 }
 
 bool BNPView::convertTexts()
 {
-	bool convertedNotes = false;
-	KProgressDialog dialog(
-			/*parent=*/0,
-			/*caption=*/i18n(&quot;Plain Text Notes Conversion&quot;),
-			/*text=*/i18n(&quot;Converting plain text notes to rich text ones...&quot;)
-		);
-	dialog.setModal(true);
-	dialog.progressBar()-&gt;setRange(0, basketCount());
-	dialog.show(); //setMinimumDuration(50/*ms*/);
-
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = (BasketListViewItem*)(*it);
-		if (item-&gt;basket()-&gt;convertTexts())
-			convertedNotes = true;
-
-		QProgressBar *pb = dialog.progressBar();
-		pb-&gt;setValue(pb-&gt;value() + 1);
-
-		if (dialog.wasCancelled())
-			break;
-		++it;
-	}
+    bool convertedNotes = false;
+    KProgressDialog dialog(
+        /*parent=*/0,
+        /*caption=*/i18n(&quot;Plain Text Notes Conversion&quot;),
+        /*text=*/i18n(&quot;Converting plain text notes to rich text ones...&quot;)
+    );
+    dialog.setModal(true);
+    dialog.progressBar()-&gt;setRange(0, basketCount());
+    dialog.show(); //setMinimumDuration(50/*ms*/);
+
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = (BasketListViewItem*)(*it);
+        if (item-&gt;basket()-&gt;convertTexts())
+            convertedNotes = true;
+
+        QProgressBar *pb = dialog.progressBar();
+        pb-&gt;setValue(pb-&gt;value() + 1);
+
+        if (dialog.wasCancelled())
+            break;
+        ++it;
+    }
 
-	return convertedNotes;
+    return convertedNotes;
 }
 
 void BNPView::toggleFilterAllBaskets(bool doFilter)
 {
-	// Set the state:
-	m_actFilterAllBaskets-&gt;setChecked(doFilter);
+    // Set the state:
+    m_actFilterAllBaskets-&gt;setChecked(doFilter);
 
-	// If the filter isn't already showing, we make sure it does.
-	if (doFilter)
-		m_actShowFilter-&gt;setChecked(true);
+    // If the filter isn't already showing, we make sure it does.
+    if (doFilter)
+        m_actShowFilter-&gt;setChecked(true);
 
-	//currentBasket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterAll(doFilter);
+    //currentBasket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterAll(doFilter);
 
-//	Basket *current = currentBasket();
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterAll(doFilter);
-		++it;
-	}
+//  Basket *current = currentBasket();
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterAll(doFilter);
+        ++it;
+    }
 
-	if (doFilter)
-		currentBasket()-&gt;decoration()-&gt;filterBar()-&gt;setEditFocus();
+    if (doFilter)
+        currentBasket()-&gt;decoration()-&gt;filterBar()-&gt;setEditFocus();
 
-	// Filter every baskets:
-	newFilter();
+    // Filter every baskets:
+    newFilter();
 }
 
 /** This function can be called recursively because we call kapp-&gt;processEvents().
@@ -1299,421 +1296,496 @@ void BNPView::toggleFilterAllBaskets(bool doFilter)
  */
 void BNPView::newFilter()
 {
-	static bool alreadyEntered = false;
-	static bool shouldRestart  = false;
-
-	if (alreadyEntered) {
-		shouldRestart = true;
-		return;
-	}
-	alreadyEntered = true;
-	shouldRestart  = false;
-
-	Basket *current = currentBasket();
-	const FilterData &amp;filterData = current-&gt;decoration()-&gt;filterBar()-&gt;filterData();
-
-	// Set the filter data for every other baskets, or reset the filter for every other baskets if we just disabled the filterInAllBaskets:
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		if (item-&gt;basket() != current){
-			if (isFilteringAllBaskets())
-				item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterData(filterData); // Set the new FilterData for every other baskets
-			else
-				item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterData(FilterData()); // We just disabled the global filtering: remove the FilterData
-		}
-		++it;
-	}
-
-	// Show/hide the &quot;little filter icons&quot; (during basket load)
-	// or the &quot;little numbers&quot; (to show number of found notes in the baskets) is the tree:
-	kapp-&gt;processEvents();
-
-	// Load every baskets for filtering, if they are not already loaded, and if necessary:
-	if (filterData.isFiltering) {
-		Basket *current = currentBasket();
-		QTreeWidgetItemIterator it(m_tree);
-		while (*it) {
-			BasketListViewItem *item = ((BasketListViewItem*)*it);
-			if (item-&gt;basket() != current) {
-				Basket *basket = item-&gt;basket();
-				if (!basket-&gt;loadingLaunched() &amp;&amp; !basket-&gt;isLocked())
-					basket-&gt;load();
-				basket-&gt;filterAgain();
-				kapp-&gt;processEvents();
-				if (shouldRestart) {
-					alreadyEntered = false;
-					shouldRestart  = false;
-					newFilter();
-					return;
-				}
-			}
-			++it;
-		}
-	}
-
-//	kapp-&gt;processEvents();
-
-	alreadyEntered = false;
-	shouldRestart  = false;
+    static bool alreadyEntered = false;
+    static bool shouldRestart  = false;
+
+    if (alreadyEntered) {
+        shouldRestart = true;
+        return;
+    }
+    alreadyEntered = true;
+    shouldRestart  = false;
+
+    Basket *current = currentBasket();
+    const FilterData &amp;filterData = current-&gt;decoration()-&gt;filterBar()-&gt;filterData();
+
+    // Set the filter data for every other baskets, or reset the filter for every other baskets if we just disabled the filterInAllBaskets:
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        if (item-&gt;basket() != current) {
+            if (isFilteringAllBaskets())
+                item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterData(filterData); // Set the new FilterData for every other baskets
+            else
+                item-&gt;basket()-&gt;decoration()-&gt;filterBar()-&gt;setFilterData(FilterData()); // We just disabled the global filtering: remove the FilterData
+        }
+        ++it;
+    }
+
+    // Show/hide the &quot;little filter icons&quot; (during basket load)
+    // or the &quot;little numbers&quot; (to show number of found notes in the baskets) is the tree:
+    kapp-&gt;processEvents();
+
+    // Load every baskets for filtering, if they are not already loaded, and if necessary:
+    if (filterData.isFiltering) {
+        Basket *current = currentBasket();
+        QTreeWidgetItemIterator it(m_tree);
+        while (*it) {
+            BasketListViewItem *item = ((BasketListViewItem*) * it);
+            if (item-&gt;basket() != current) {
+                Basket *basket = item-&gt;basket();
+                if (!basket-&gt;loadingLaunched() &amp;&amp; !basket-&gt;isLocked())
+                    basket-&gt;load();
+                basket-&gt;filterAgain();
+                kapp-&gt;processEvents();
+                if (shouldRestart) {
+                    alreadyEntered = false;
+                    shouldRestart  = false;
+                    newFilter();
+                    return;
+                }
+            }
+            ++it;
+        }
+    }
+
+//  kapp-&gt;processEvents();
+
+    alreadyEntered = false;
+    shouldRestart  = false;
 }
 
 void BNPView::newFilterFromFilterBar()
 {
-	if (isFilteringAllBaskets())
-		QTimer::singleShot(0, this, SLOT(newFilter())); // Keep time for the QLineEdit to display the filtered character and refresh correctly!
+    if (isFilteringAllBaskets())
+        QTimer::singleShot(0, this, SLOT(newFilter())); // Keep time for the QLineEdit to display the filtered character and refresh correctly!
 }
 
 bool BNPView::isFilteringAllBaskets()
 {
-	return m_actFilterAllBaskets-&gt;isChecked();
+    return m_actFilterAllBaskets-&gt;isChecked();
 }
 
 
 BasketListViewItem* BNPView::listViewItemForBasket(Basket *basket)
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		if (item-&gt;basket() == basket)
-			return item;
-		++it;
-	}
-	return 0L;
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        if (item-&gt;basket() == basket)
+            return item;
+        ++it;
+    }
+    return 0L;
 }
 
 Basket* BNPView::currentBasket()
 {
-	DecoratedBasket *decoBasket = (DecoratedBasket*)m_stack-&gt;currentWidget();
-	if (decoBasket)
-		return decoBasket-&gt;basket();
-	else
-		return 0;
+    DecoratedBasket *decoBasket = (DecoratedBasket*)m_stack-&gt;currentWidget();
+    if (decoBasket)
+        return decoBasket-&gt;basket();
+    else
+        return 0;
 }
 
 Basket* BNPView::parentBasketOf(Basket *basket)
 {
-	BasketListViewItem *item = (BasketListViewItem*)(listViewItemForBasket(basket)-&gt;parent());
-	if (item)
-		return item-&gt;basket();
-	else
-		return 0;
+    BasketListViewItem *item = (BasketListViewItem*)(listViewItemForBasket(basket)-&gt;parent());
+    if (item)
+        return item-&gt;basket();
+    else
+        return 0;
 }
 
 void BNPView::setCurrentBasket(Basket *basket)
 {
-	if (currentBasket() == basket)
-		return;
-
-	if (currentBasket())
-		currentBasket()-&gt;closeBasket();
-
-	if (basket)
-		basket-&gt;aboutToBeActivated();
-
-	BasketListViewItem *item = listViewItemForBasket(basket);
-	if (item) {
-		m_tree-&gt;setCurrentItem(item);
-		item-&gt;ensureVisible();
-		m_stack-&gt;setCurrentWidget(basket-&gt;decoration());
-		// If the window has changed size, only the current basket receive the event,
-		// the others will receive ony one just before they are shown.
-		// But this triggers unwanted animations, so we eliminate it:
-		basket-&gt;relayoutNotes(/*animate=*/false);
-		basket-&gt;openBasket();
-		setCaption(item-&gt;basket()-&gt;basketName());
-		countsChanged(basket);
-		updateStatusBarHint();
-		if (Global::systemTray)
-			Global::systemTray-&gt;updateDisplay();
-		m_tree-&gt;scrollToItem(m_tree-&gt;currentItem());
-		item-&gt;basket()-&gt;setFocus();
-	}
-	m_tree-&gt;viewport()-&gt;update();
-	emit basketChanged();
+    if (currentBasket() == basket)
+        return;
+
+    if (currentBasket())
+        currentBasket()-&gt;closeBasket();
+
+    if (basket)
+        basket-&gt;aboutToBeActivated();
+
+    BasketListViewItem *item = listViewItemForBasket(basket);
+    if (item) {
+        m_tree-&gt;setCurrentItem(item);
+        item-&gt;ensureVisible();
+        m_stack-&gt;setCurrentWidget(basket-&gt;decoration());
+        // If the window has changed size, only the current basket receive the event,
+        // the others will receive ony one just before they are shown.
+        // But this triggers unwanted animations, so we eliminate it:
+        basket-&gt;relayoutNotes(/*animate=*/false);
+        basket-&gt;openBasket();
+        setCaption(item-&gt;basket()-&gt;basketName());
+        countsChanged(basket);
+        updateStatusBarHint();
+        if (Global::systemTray)
+            Global::systemTray-&gt;updateDisplay();
+        m_tree-&gt;scrollToItem(m_tree-&gt;currentItem());
+        item-&gt;basket()-&gt;setFocus();
+    }
+    m_tree-&gt;viewport()-&gt;update();
+    emit basketChanged();
 }
 
 void BNPView::removeBasket(Basket *basket)
 {
-	if (basket-&gt;isDuringEdit())
-		basket-&gt;closeEditor();
+    if (basket-&gt;isDuringEdit())
+        basket-&gt;closeEditor();
 
-	// Find a new basket to switch to and select it.
-	// Strategy: get the next sibling, or the previous one if not found.
-	// If there is no such one, get the parent basket:
-	BasketListViewItem *basketItem = listViewItemForBasket(basket);
-	BasketListViewItem *nextBasketItem = (BasketListViewItem*)(m_tree-&gt;itemBelow(basketItem));
-	if (!nextBasketItem)
-		nextBasketItem = (BasketListViewItem*)m_tree-&gt;itemAbove(basketItem);
-	if (!nextBasketItem)
-		nextBasketItem = (BasketListViewItem*)(basketItem-&gt;parent());
+    // Find a new basket to switch to and select it.
+    // Strategy: get the next sibling, or the previous one if not found.
+    // If there is no such one, get the parent basket:
+    BasketListViewItem *basketItem = listViewItemForBasket(basket);
+    BasketListViewItem *nextBasketItem = (BasketListViewItem*)(m_tree-&gt;itemBelow(basketItem));
+    if (!nextBasketItem)
+        nextBasketItem = (BasketListViewItem*)m_tree-&gt;itemAbove(basketItem);
+    if (!nextBasketItem)
+        nextBasketItem = (BasketListViewItem*)(basketItem-&gt;parent());
 
-	if (nextBasketItem)
-		setCurrentBasket(nextBasketItem-&gt;basket());
+    if (nextBasketItem)
+        setCurrentBasket(nextBasketItem-&gt;basket());
 
-	// Remove from the view:
-	basket-&gt;unsubscribeBackgroundImages();
-	m_stack-&gt;removeWidget(basket-&gt;decoration());
-//	delete basket-&gt;decoration();
-	delete basketItem;
-//	delete basket;
+    // Remove from the view:
+    basket-&gt;unsubscribeBackgroundImages();
+    m_stack-&gt;removeWidget(basket-&gt;decoration());
+//  delete basket-&gt;decoration();
+    delete basketItem;
+//  delete basket;
 
-	// If there is no basket anymore, add a new one:
-	if (!nextBasketItem)
-		BasketFactory::newBasket(/*icon=*/&quot;&quot;, /*name=*/i18n(&quot;General&quot;), /*backgroundImage=*/&quot;&quot;, /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/&quot;1column&quot;, /*createIn=*/0);
-	else // No need to save two times if we add a basket
-		save();
+    // If there is no basket anymore, add a new one:
+    if (!nextBasketItem)
+        BasketFactory::newBasket(/*icon=*/&quot;&quot;, /*name=*/i18n(&quot;General&quot;), /*backgroundImage=*/&quot;&quot;, /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/&quot;1column&quot;, /*createIn=*/0);
+    else // No need to save two times if we add a basket
+        save();
 
-	emit basketNumberChanged(basketCount());
+    emit basketNumberChanged(basketCount());
 }
 
 void BNPView::setTreePlacement(bool onLeft)
 {
-	if (onLeft)
-		insertWidget(0, m_tree);
-	else
-		addWidget(m_tree);
-	//updateGeometry();
-	kapp-&gt;postEvent( this, new QResizeEvent(size(), size()) );
+    if (onLeft)
+        insertWidget(0, m_tree);
+    else
+        addWidget(m_tree);
+    //updateGeometry();
+    kapp-&gt;postEvent(this, new QResizeEvent(size(), size()));
 }
 
 void BNPView::relayoutAllBaskets()
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		//item-&gt;basket()-&gt;unbufferizeAll();
-		item-&gt;basket()-&gt;unsetNotesWidth();
-		item-&gt;basket()-&gt;relayoutNotes(true);
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        //item-&gt;basket()-&gt;unbufferizeAll();
+        item-&gt;basket()-&gt;unsetNotesWidth();
+        item-&gt;basket()-&gt;relayoutNotes(true);
+        ++it;
+    }
 }
 
 void BNPView::recomputeAllStyles()
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		item-&gt;basket()-&gt;recomputeAllStyles();
-		item-&gt;basket()-&gt;unsetNotesWidth();
-		item-&gt;basket()-&gt;relayoutNotes(true);
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        item-&gt;basket()-&gt;recomputeAllStyles();
+        item-&gt;basket()-&gt;unsetNotesWidth();
+        item-&gt;basket()-&gt;relayoutNotes(true);
+        ++it;
+    }
 }
 
 void BNPView::removedStates(const QList&lt;State*&gt; &amp;deletedStates)
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		item-&gt;basket()-&gt;removedStates(deletedStates);
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        item-&gt;basket()-&gt;removedStates(deletedStates);
+        ++it;
+    }
 }
 
 void BNPView::linkLookChanged()
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		item-&gt;basket()-&gt;linkLookChanged();
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        item-&gt;basket()-&gt;linkLookChanged();
+        ++it;
+    }
 }
 
 void BNPView::filterPlacementChanged(bool onTop)
 {
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item        = static_cast&lt;BasketListViewItem*&gt;(*it);
-		DecoratedBasket    *decoration  = static_cast&lt;DecoratedBasket*&gt;(item-&gt;basket()-&gt;parent());
-		decoration-&gt;setFilterBarPosition(onTop);
-		++it;
-	}
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item        = static_cast&lt;BasketListViewItem*&gt;(*it);
+        DecoratedBasket    *decoration  = static_cast&lt;DecoratedBasket*&gt;(item-&gt;basket()-&gt;parent());
+        decoration-&gt;setFilterBarPosition(onTop);
+        ++it;
+    }
 }
 
 void BNPView::updateBasketListViewItem(Basket *basket)
 {
-	BasketListViewItem *item = listViewItemForBasket(basket);
-	if (item)
-		item-&gt;setup();
+    BasketListViewItem *item = listViewItemForBasket(basket);
+    if (item)
+        item-&gt;setup();
 
-	if (basket == currentBasket()) {
-		setCaption(basket-&gt;basketName());
-		if (Global::systemTray)
-			Global::systemTray-&gt;updateDisplay();
-	}
+    if (basket == currentBasket()) {
+        setCaption(basket-&gt;basketName());
+        if (Global::systemTray)
+            Global::systemTray-&gt;updateDisplay();
+    }
 
-	// Don't save if we are loading!
-	if (!m_loading)
-		save();
+    // Don't save if we are loading!
+    if (!m_loading)
+        save();
 }
 
 void BNPView::needSave(QTreeWidgetItem *)
 {
-	if (!m_loading)
-		// A basket has been collapsed/expanded or a new one is select: this is not urgent:
-		QTimer::singleShot(500/*ms*/, this, SLOT(save()));
+    if (!m_loading)
+        // A basket has been collapsed/expanded or a new one is select: this is not urgent:
+        QTimer::singleShot(500/*ms*/, this, SLOT(save()));
 }
 
 void BNPView::slotPressed(QTreeWidgetItem *item, int column)
 {
-	Basket *basket = currentBasket();
+    Basket *basket = currentBasket();
 
-	if (basket == 0)
-		return;
+    if (basket == 0)
+        return;
 
-	// Impossible to Select no Basket:
-	if (!item)
-		m_tree-&gt;setCurrentItem(listViewItemForBasket(basket), true);
+    // Impossible to Select no Basket:
+    if (!item)
+        m_tree-&gt;setCurrentItem(listViewItemForBasket(basket), true);
 
-	else if (dynamic_cast&lt;BasketListViewItem*&gt;(item) != 0 &amp;&amp; currentBasket() != ((BasketListViewItem*)item)-&gt;basket()) {
-		setCurrentBasket( ((BasketListViewItem*)item)-&gt;basket() );
-		needSave(0);
-	}
-	basket-&gt;setFocus();
+    else if (dynamic_cast&lt;BasketListViewItem*&gt;(item) != 0 &amp;&amp; currentBasket() != ((BasketListViewItem*)item)-&gt;basket()) {
+        setCurrentBasket(((BasketListViewItem*)item)-&gt;basket());
+        needSave(0);
+    }
+    basket-&gt;setFocus();
 }
 
 DecoratedBasket* BNPView::currentDecoratedBasket()
 {
-	if (currentBasket())
-		return currentBasket()-&gt;decoration();
-	else
-		return 0;
+    if (currentBasket())
+        return currentBasket()-&gt;decoration();
+    else
+        return 0;
 }
 
 // Redirected actions :
 
-void BNPView::exportToHTML()              { HTMLExporter exporter(currentBasket());  }
-void BNPView::editNote()                  { currentBasket()-&gt;noteEdit();             }
-void BNPView::cutNote()                   { currentBasket()-&gt;noteCut();              }
-void BNPView::copyNote()                  { currentBasket()-&gt;noteCopy();             }
-void BNPView::delNote()                   { currentBasket()-&gt;noteDelete();           }
-void BNPView::openNote()                  { currentBasket()-&gt;noteOpen();             }
-void BNPView::openNoteWith()              { currentBasket()-&gt;noteOpenWith();         }
-void BNPView::saveNoteAs()                { currentBasket()-&gt;noteSaveAs();           }
-void BNPView::noteGroup()                 { currentBasket()-&gt;noteGroup();            }
-void BNPView::noteUngroup()               { currentBasket()-&gt;noteUngroup();          }
-void BNPView::moveOnTop()                 { currentBasket()-&gt;noteMoveOnTop();        }
-void BNPView::moveOnBottom()              { currentBasket()-&gt;noteMoveOnBottom();     }
-void BNPView::moveNoteUp()                { currentBasket()-&gt;noteMoveNoteUp();       }
-void BNPView::moveNoteDown()              { currentBasket()-&gt;noteMoveNoteDown();     }
-void BNPView::slotSelectAll()             { currentBasket()-&gt;selectAll();            }
-void BNPView::slotUnselectAll()           { currentBasket()-&gt;unselectAll();          }
-void BNPView::slotInvertSelection()       { currentBasket()-&gt;invertSelection();      }
-void BNPView::slotResetFilter()           { currentDecoratedBasket()-&gt;resetFilter(); }
-
-void BNPView::importKJots()       { SoftwareImporters::importKJots();       }
-void BNPView::importKNotes()      { SoftwareImporters::importKNotes();      }
-void BNPView::importKnowIt()      { SoftwareImporters::importKnowIt();      }
-void BNPView::importTuxCards()    { SoftwareImporters::importTuxCards();    }
-void BNPView::importStickyNotes() { SoftwareImporters::importStickyNotes(); }
-void BNPView::importTomboy()      { SoftwareImporters::importTomboy();      }
-void BNPView::importTextFile()    { SoftwareImporters::importTextFile();    }
+void BNPView::exportToHTML()
+{
+    HTMLExporter exporter(currentBasket());
+}
+void BNPView::editNote()
+{
+    currentBasket()-&gt;noteEdit();
+}
+void BNPView::cutNote()
+{
+    currentBasket()-&gt;noteCut();
+}
+void BNPView::copyNote()
+{
+    currentBasket()-&gt;noteCopy();
+}
+void BNPView::delNote()
+{
+    currentBasket()-&gt;noteDelete();
+}
+void BNPView::openNote()
+{
+    currentBasket()-&gt;noteOpen();
+}
+void BNPView::openNoteWith()
+{
+    currentBasket()-&gt;noteOpenWith();
+}
+void BNPView::saveNoteAs()
+{
+    currentBasket()-&gt;noteSaveAs();
+}
+void BNPView::noteGroup()
+{
+    currentBasket()-&gt;noteGroup();
+}
+void BNPView::noteUngroup()
+{
+    currentBasket()-&gt;noteUngroup();
+}
+void BNPView::moveOnTop()
+{
+    currentBasket()-&gt;noteMoveOnTop();
+}
+void BNPView::moveOnBottom()
+{
+    currentBasket()-&gt;noteMoveOnBottom();
+}
+void BNPView::moveNoteUp()
+{
+    currentBasket()-&gt;noteMoveNoteUp();
+}
+void BNPView::moveNoteDown()
+{
+    currentBasket()-&gt;noteMoveNoteDown();
+}
+void BNPView::slotSelectAll()
+{
+    currentBasket()-&gt;selectAll();
+}
+void BNPView::slotUnselectAll()
+{
+    currentBasket()-&gt;unselectAll();
+}
+void BNPView::slotInvertSelection()
+{
+    currentBasket()-&gt;invertSelection();
+}
+void BNPView::slotResetFilter()
+{
+    currentDecoratedBasket()-&gt;resetFilter();
+}
+
+void BNPView::importKJots()
+{
+    SoftwareImporters::importKJots();
+}
+void BNPView::importKNotes()
+{
+    SoftwareImporters::importKNotes();
+}
+void BNPView::importKnowIt()
+{
+    SoftwareImporters::importKnowIt();
+}
+void BNPView::importTuxCards()
+{
+    SoftwareImporters::importTuxCards();
+}
+void BNPView::importStickyNotes()
+{
+    SoftwareImporters::importStickyNotes();
+}
+void BNPView::importTomboy()
+{
+    SoftwareImporters::importTomboy();
+}
+void BNPView::importTextFile()
+{
+    SoftwareImporters::importTextFile();
+}
 
 void BNPView::backupRestore()
 {
-	BackupDialog dialog;
-	dialog.exec();
+    BackupDialog dialog;
+    dialog.exec();
 }
 
 void BNPView::countsChanged(Basket *basket)
 {
-	if (basket == currentBasket())
-		notesStateChanged();
+    if (basket == currentBasket())
+        notesStateChanged();
 }
 
 void BNPView::notesStateChanged()
 {
-	Basket *basket = currentBasket();
-
-	// Update statusbar message :
-	if (currentBasket()-&gt;isLocked())
-		setSelectionStatus(i18n(&quot;Locked&quot;));
-	else if (!basket-&gt;isLoaded())
-		setSelectionStatus(i18n(&quot;Loading...&quot;));
-	else if (basket-&gt;count() == 0)
-		setSelectionStatus(i18n(&quot;No notes&quot;));
-	else {
-		QString count     = i18np(&quot;%1 note&quot;,     &quot;%1 notes&quot;,    basket-&gt;count()         );
-		QString selecteds = i18np(&quot;%1 selected&quot;, &quot;%1 selected&quot;, basket-&gt;countSelecteds());
-		QString showns    = (currentDecoratedBasket()-&gt;filterData().isFiltering ? i18n(&quot;all matches&quot;) : i18n(&quot;no filter&quot;));
-		if (basket-&gt;countFounds() != basket-&gt;count())
-			showns = i18np(&quot;%1 match&quot;, &quot;%1 matches&quot;, basket-&gt;countFounds());
-		setSelectionStatus(
-				i18nc(&quot;e.g. '18 notes, 10 matches, 5 selected'&quot;, &quot;%1, %2, %3&quot;,count, showns, selecteds));
-	}
-
-	if (currentBasket()-&gt;redirectEditActions()) {
-		m_actSelectAll         -&gt;setEnabled( !currentBasket()-&gt;selectedAllTextInEditor() );
-		m_actUnselectAll       -&gt;setEnabled( currentBasket()-&gt;hasSelectedTextInEditor()  );
-	} else {
-		m_actSelectAll         -&gt;setEnabled( basket-&gt;countSelecteds() &lt; basket-&gt;countFounds() );
-		m_actUnselectAll       -&gt;setEnabled( basket-&gt;countSelecteds() &gt; 0                     );
-	}
-	m_actInvertSelection   -&gt;setEnabled( basket-&gt;countFounds() &gt; 0 );
-
-	updateNotesActions();
+    Basket *basket = currentBasket();
+
+    // Update statusbar message :
+    if (currentBasket()-&gt;isLocked())
+        setSelectionStatus(i18n(&quot;Locked&quot;));
+    else if (!basket-&gt;isLoaded())
+        setSelectionStatus(i18n(&quot;Loading...&quot;));
+    else if (basket-&gt;count() == 0)
+        setSelectionStatus(i18n(&quot;No notes&quot;));
+    else {
+        QString count     = i18np(&quot;%1 note&quot;,     &quot;%1 notes&quot;,    basket-&gt;count());
+        QString selecteds = i18np(&quot;%1 selected&quot;, &quot;%1 selected&quot;, basket-&gt;countSelecteds());
+        QString showns    = (currentDecoratedBasket()-&gt;filterData().isFiltering ? i18n(&quot;all matches&quot;) : i18n(&quot;no filter&quot;));
+        if (basket-&gt;countFounds() != basket-&gt;count())
+            showns = i18np(&quot;%1 match&quot;, &quot;%1 matches&quot;, basket-&gt;countFounds());
+        setSelectionStatus(
+            i18nc(&quot;e.g. '18 notes, 10 matches, 5 selected'&quot;, &quot;%1, %2, %3&quot;, count, showns, selecteds));
+    }
+
+    if (currentBasket()-&gt;redirectEditActions()) {
+        m_actSelectAll         -&gt;setEnabled(!currentBasket()-&gt;selectedAllTextInEditor());
+        m_actUnselectAll       -&gt;setEnabled(currentBasket()-&gt;hasSelectedTextInEditor());
+    } else {
+        m_actSelectAll         -&gt;setEnabled(basket-&gt;countSelecteds() &lt; basket-&gt;countFounds());
+        m_actUnselectAll       -&gt;setEnabled(basket-&gt;countSelecteds() &gt; 0);
+    }
+    m_actInvertSelection   -&gt;setEnabled(basket-&gt;countFounds() &gt; 0);
+
+    updateNotesActions();
 }
 
 void BNPView::updateNotesActions()
 {
-	bool isLocked             = currentBasket()-&gt;isLocked();
-	bool oneSelected          = currentBasket()-&gt;countSelecteds() == 1;
-	bool oneOrSeveralSelected = currentBasket()-&gt;countSelecteds() &gt;= 1;
-	bool severalSelected      = currentBasket()-&gt;countSelecteds() &gt;= 2;
-
-	// FIXME: m_actCheckNotes is also modified in void BNPView::areSelectedNotesCheckedChanged(bool checked)
-	//        bool Basket::areSelectedNotesChecked() should return false if bool Basket::showCheckBoxes() is false
-//	m_actCheckNotes-&gt;setChecked( oneOrSeveralSelected &amp;&amp;
-//	                             currentBasket()-&gt;areSelectedNotesChecked() &amp;&amp;
-//	                             currentBasket()-&gt;showCheckBoxes()             );
-
-	Note *selectedGroup = (severalSelected ? currentBasket()-&gt;selectedGroup() : 0);
-
-	m_actEditNote            -&gt;setEnabled( !isLocked &amp;&amp; oneSelected &amp;&amp; !currentBasket()-&gt;isDuringEdit() );
-	if (currentBasket()-&gt;redirectEditActions()) {
-		m_actCutNote         -&gt;setEnabled( currentBasket()-&gt;hasSelectedTextInEditor() );
-		m_actCopyNote        -&gt;setEnabled( currentBasket()-&gt;hasSelectedTextInEditor() );
-		m_actPaste           -&gt;setEnabled( true                                       );
-		m_actDelNote         -&gt;setEnabled( currentBasket()-&gt;hasSelectedTextInEditor() );
-	} else {
-		m_actCutNote         -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected );
-		m_actCopyNote        -&gt;setEnabled(              oneOrSeveralSelected );
-		m_actPaste           -&gt;setEnabled( !isLocked                         );
-		m_actDelNote         -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected );
-	}
-	m_actOpenNote        -&gt;setEnabled(              oneOrSeveralSelected );
-	m_actOpenNoteWith    -&gt;setEnabled(              oneSelected          ); // TODO: oneOrSeveralSelected IF SAME TYPE
-	m_actSaveNoteAs      -&gt;setEnabled(              oneSelected          ); // IDEM?
-	m_actGroup           -&gt;setEnabled( !isLocked &amp;&amp; severalSelected &amp;&amp; (!selectedGroup || selectedGroup-&gt;isColumn()) );
-	m_actUngroup         -&gt;setEnabled( !isLocked &amp;&amp; selectedGroup &amp;&amp; !selectedGroup-&gt;isColumn() );
-	m_actMoveOnTop       -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected &amp;&amp; !currentBasket()-&gt;isFreeLayout() );
-	m_actMoveNoteUp      -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected ); // TODO: Disable when unavailable!
-	m_actMoveNoteDown    -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected );
-	m_actMoveOnBottom    -&gt;setEnabled( !isLocked &amp;&amp; oneOrSeveralSelected &amp;&amp; !currentBasket()-&gt;isFreeLayout() );
-
-	for (QList&lt;KAction *&gt;::const_iterator action = m_insertActions.constBegin(); action != m_insertActions.constEnd(); ++action)
-		(*action)-&gt;setEnabled( !isLocked );
-
-	// From the old Note::contextMenuEvent(...) :
-/*	if (useFile() || m_type == Link) {
-	m_type == Link ? i18n(&quot;&amp;Open target&quot;)         : i18n(&quot;&amp;Open&quot;)
-	m_type == Link ? i18n(&quot;Open target &amp;with...&quot;) : i18n(&quot;Open &amp;with...&quot;)
-	m_type == Link ? i18n(&quot;&amp;Save target as...&quot;)   : i18n(&quot;&amp;Save a copy as...&quot;)
-		// If useFile() theire is always a file to open / open with / save, but :
-	if (m_type == Link) {
-			if (url().prettyUrl().isEmpty() &amp;&amp; runCommand().isEmpty())     // no URL nor runCommand :
-	popupMenu-&gt;setItemEnabled(7, false);                       //  no possible Open !
-			if (url().prettyUrl().isEmpty())                               // no URL :
-	popupMenu-&gt;setItemEnabled(8, false);                       //  no possible Open with !
-			if (url().prettyUrl().isEmpty() || url().path().endsWith(&quot;/&quot;)) // no URL or target a folder :
-	popupMenu-&gt;setItemEnabled(9, false);                       //  not possible to save target file
-}
-} else if (m_type != Color) {
-	popupMenu-&gt;insertSeparator();
-	popupMenu-&gt;insertItem( KIcon(&quot;document-save-as&quot;), i18n(&quot;&amp;Save a copy as...&quot;), this, SLOT(slotSaveAs()), 0, 10 );
-}*/
+    bool isLocked             = currentBasket()-&gt;isLocked();
+    bool oneSelected          = currentBasket()-&gt;countSelecteds() == 1;
+    bool oneOrSeveralSelected = currentBasket()-&gt;countSelecteds() &gt;= 1;
+    bool severalSelected      = currentBasket()-&gt;countSelecteds() &gt;= 2;
+
+    // FIXME: m_actCheckNotes is also modified in void BNPView::areSelectedNotesCheckedChanged(bool checked)
+    //        bool Basket::areSelectedNotesChecked() should return false if bool Basket::showCheckBoxes() is false
+//  m_actCheckNotes-&gt;setChecked( oneOrSeveralSelected &amp;&amp;
+//                               currentBasket()-&gt;areSelectedNotesChecked() &amp;&amp;
+//                               currentBasket()-&gt;showCheckBoxes()             );
+
+    Note *selectedGroup = (severalSelected ? currentBasket()-&gt;selectedGroup() : 0);
+
+    m_actEditNote            -&gt;setEnabled(!isLocked &amp;&amp; oneSelected &amp;&amp; !currentBasket()-&gt;isDuringEdit());
+    if (currentBasket()-&gt;redirectEditActions()) {
+        m_actCutNote         -&gt;setEnabled(currentBasket()-&gt;hasSelectedTextInEditor());
+        m_actCopyNote        -&gt;setEnabled(currentBasket()-&gt;hasSelectedTextInEditor());
+        m_actPaste           -&gt;setEnabled(true);
+        m_actDelNote         -&gt;setEnabled(currentBasket()-&gt;hasSelectedTextInEditor());
+    } else {
+        m_actCutNote         -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected);
+        m_actCopyNote        -&gt;setEnabled(oneOrSeveralSelected);
+        m_actPaste           -&gt;setEnabled(!isLocked);
+        m_actDelNote         -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected);
+    }
+    m_actOpenNote        -&gt;setEnabled(oneOrSeveralSelected);
+    m_actOpenNoteWith    -&gt;setEnabled(oneSelected);                         // TODO: oneOrSeveralSelected IF SAME TYPE
+    m_actSaveNoteAs      -&gt;setEnabled(oneSelected);                         // IDEM?
+    m_actGroup           -&gt;setEnabled(!isLocked &amp;&amp; severalSelected &amp;&amp; (!selectedGroup || selectedGroup-&gt;isColumn()));
+    m_actUngroup         -&gt;setEnabled(!isLocked &amp;&amp; selectedGroup &amp;&amp; !selectedGroup-&gt;isColumn());
+    m_actMoveOnTop       -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected &amp;&amp; !currentBasket()-&gt;isFreeLayout());
+    m_actMoveNoteUp      -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected);   // TODO: Disable when unavailable!
+    m_actMoveNoteDown    -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected);
+    m_actMoveOnBottom    -&gt;setEnabled(!isLocked &amp;&amp; oneOrSeveralSelected &amp;&amp; !currentBasket()-&gt;isFreeLayout());
+
+    for (QList&lt;KAction *&gt;::const_iterator action = m_insertActions.constBegin(); action != m_insertActions.constEnd(); ++action)
+        (*action)-&gt;setEnabled(!isLocked);
+
+    // From the old Note::contextMenuEvent(...) :
+    /*  if (useFile() || m_type == Link) {
+        m_type == Link ? i18n(&quot;&amp;Open target&quot;)         : i18n(&quot;&amp;Open&quot;)
+        m_type == Link ? i18n(&quot;Open target &amp;with...&quot;) : i18n(&quot;Open &amp;with...&quot;)
+        m_type == Link ? i18n(&quot;&amp;Save target as...&quot;)   : i18n(&quot;&amp;Save a copy as...&quot;)
+            // If useFile() theire is always a file to open / open with / save, but :
+        if (m_type == Link) {
+                if (url().prettyUrl().isEmpty() &amp;&amp; runCommand().isEmpty())     // no URL nor runCommand :
+        popupMenu-&gt;setItemEnabled(7, false);                       //  no possible Open !
+                if (url().prettyUrl().isEmpty())                               // no URL :
+        popupMenu-&gt;setItemEnabled(8, false);                       //  no possible Open with !
+                if (url().prettyUrl().isEmpty() || url().path().endsWith(&quot;/&quot;)) // no URL or target a folder :
+        popupMenu-&gt;setItemEnabled(9, false);                       //  not possible to save target file
+    }
+    } else if (m_type != Color) {
+        popupMenu-&gt;insertSeparator();
+        popupMenu-&gt;insertItem( KIcon(&quot;document-save-as&quot;), i18n(&quot;&amp;Save a copy as...&quot;), this, SLOT(slotSaveAs()), 0, 10 );
+    }*/
 }
 
 // BEGIN Color picker (code from KColorEdit):
@@ -1722,442 +1794,437 @@ void BNPView::updateNotesActions()
  */
 void BNPView::slotColorFromScreen(bool global)
 {
-	m_colorPickWasGlobal = global;
-	if (isMainWindowActive()) {
-		if(Global::mainWindow()) Global::mainWindow()-&gt;hide();
-		m_colorPickWasShown = true;
-	} else
-		m_colorPickWasShown = false;
+    m_colorPickWasGlobal = global;
+    if (isMainWindowActive()) {
+        if (Global::mainWindow()) Global::mainWindow()-&gt;hide();
+        m_colorPickWasShown = true;
+    } else
+        m_colorPickWasShown = false;
 
-		currentBasket()-&gt;saveInsertionData();
-		m_colorPicker-&gt;pickColor();
+    currentBasket()-&gt;saveInsertionData();
+    m_colorPicker-&gt;pickColor();
 
-/*	m_gettingColorFromScreen = true;
-		kapp-&gt;processEvents();
-		QTimer::singleShot( 100, this, SLOT(grabColorFromScreen()) );*/
+    /*  m_gettingColorFromScreen = true;
+            kapp-&gt;processEvents();
+            QTimer::singleShot( 100, this, SLOT(grabColorFromScreen()) );*/
 }
 
 void BNPView::slotColorFromScreenGlobal()
 {
-	slotColorFromScreen(true);
+    slotColorFromScreen(true);
 }
 
 void BNPView::colorPicked(const QColor &amp;color)
 {
-	if (!currentBasket()-&gt;isLoaded()) {
-		showPassiveLoading(currentBasket());
-		currentBasket()-&gt;load();
-	}
-	currentBasket()-&gt;insertColor(color);
+    if (!currentBasket()-&gt;isLoaded()) {
+        showPassiveLoading(currentBasket());
+        currentBasket()-&gt;load();
+    }
+    currentBasket()-&gt;insertColor(color);
 
-	if (m_colorPickWasShown)
-		showMainWindow();
+    if (m_colorPickWasShown)
+        showMainWindow();
 
-	if (Settings::usePassivePopup())
-		showPassiveDropped(i18n(&quot;Picked color to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
+    if (Settings::usePassivePopup())
+        showPassiveDropped(i18n(&quot;Picked color to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
 }
 
 void BNPView::colorPickingCanceled()
 {
-	if (m_colorPickWasShown)
-		showMainWindow();
+    if (m_colorPickWasShown)
+        showMainWindow();
 }
 
 void BNPView::slotConvertTexts()
 {
-/*
-	int result = KMessageBox::questionYesNoCancel(
-		this,
-		i18n(
-			&quot;&lt;p&gt;This will convert every text notes into rich text notes.&lt;br&gt;&quot;
-			&quot;The content of the notes will not change and you will be able to apply formating to those notes.&lt;/p&gt;&quot;
-			&quot;&lt;p&gt;This process cannot be reverted back: you will not be able to convert the rich text notes to plain text ones later.&lt;/p&gt;&quot;
-			&quot;&lt;p&gt;As a beta-tester, you are strongly encouraged to do the convert process because it is to test if plain text notes are still needed.&lt;br&gt;&quot;
-			&quot;If nobody complain about not having plain text notes anymore, then the final version is likely to not support plain text notes anymore.&lt;/p&gt;&quot;
-			&quot;&lt;p&gt;&lt;b&gt;Which basket notes do you want to convert?&lt;/b&gt;&lt;/p&gt;&quot;
-		),
-		i18n(&quot;Convert Text Notes&quot;),
-		KGuiItem(i18n(&quot;Only in the Current Basket&quot;)),
-		KGuiItem(i18n(&quot;In Every Baskets&quot;))
-	);
-	if (result == KMessageBox::Cancel)
-		return;
-*/
-
-	bool conversionsDone;
-//	if (result == KMessageBox::Yes)
-//		conversionsDone = currentBasket()-&gt;convertTexts();
-//	else
-		conversionsDone = convertTexts();
-
-	if (conversionsDone)
-		KMessageBox::information(this, i18n(&quot;The plain text notes have been converted to rich text.&quot;), i18n(&quot;Conversion Finished&quot;));
-	else
-		KMessageBox::information(this, i18n(&quot;There are no plain text notes to convert.&quot;), i18n(&quot;Conversion Finished&quot;));
+    /*
+        int result = KMessageBox::questionYesNoCancel(
+            this,
+            i18n(
+                &quot;&lt;p&gt;This will convert every text notes into rich text notes.&lt;br&gt;&quot;
+                &quot;The content of the notes will not change and you will be able to apply formating to those notes.&lt;/p&gt;&quot;
+                &quot;&lt;p&gt;This process cannot be reverted back: you will not be able to convert the rich text notes to plain text ones later.&lt;/p&gt;&quot;
+                &quot;&lt;p&gt;As a beta-tester, you are strongly encouraged to do the convert process because it is to test if plain text notes are still needed.&lt;br&gt;&quot;
+                &quot;If nobody complain about not having plain text notes anymore, then the final version is likely to not support plain text notes anymore.&lt;/p&gt;&quot;
+                &quot;&lt;p&gt;&lt;b&gt;Which basket notes do you want to convert?&lt;/b&gt;&lt;/p&gt;&quot;
+            ),
+            i18n(&quot;Convert Text Notes&quot;),
+            KGuiItem(i18n(&quot;Only in the Current Basket&quot;)),
+            KGuiItem(i18n(&quot;In Every Baskets&quot;))
+        );
+        if (result == KMessageBox::Cancel)
+            return;
+    */
+
+    bool conversionsDone;
+//  if (result == KMessageBox::Yes)
+//      conversionsDone = currentBasket()-&gt;convertTexts();
+//  else
+    conversionsDone = convertTexts();
+
+    if (conversionsDone)
+        KMessageBox::information(this, i18n(&quot;The plain text notes have been converted to rich text.&quot;), i18n(&quot;Conversion Finished&quot;));
+    else
+        KMessageBox::information(this, i18n(&quot;There are no plain text notes to convert.&quot;), i18n(&quot;Conversion Finished&quot;));
 }
 
 KMenu* BNPView::popupMenu(const QString &amp;menuName)
 {
-	KMenu *menu = 0;
-	bool hack = false; // TODO fix this
-	// When running in kontact and likeback Information message is shown
-	// factory is 0. Don't show error then and don't crash either :-)
-
-	if(m_guiClient)
-	{
-		KXMLGUIFactory* factory = m_guiClient-&gt;factory();
-		if(factory)
-		{
-			menu = (KMenu *)factory-&gt;container(menuName, m_guiClient);
-		}
-		else
-			hack = isPart();
-	}
-	if (menu == 0) {
-		if(!hack)
-		{
-			KStandardDirs stdDirs;
-			const KAboutData *aboutData = KGlobal::mainComponent().aboutData();
-			KMessageBox::error( this, i18n(
-					&quot;&lt;p&gt;&lt;b&gt;The file basketui.rc seems to not exist or is too old.&lt;br&gt;&quot;
-							&quot;%1 cannot run without it and will stop.&lt;/b&gt;&lt;/p&gt;&quot;
-							&quot;&lt;p&gt;Please check your installation of %2.&lt;/p&gt;&quot;
-							&quot;&lt;p&gt;If you do not have administrator access to install the application &quot;
-							&quot;system wide, you can copy the file basketui.rc from the installation &quot;
-							&quot;archive to the folder &lt;a href='file://%3'&gt;%4&lt;/a&gt;.&lt;/p&gt;&quot;
-							&quot;&lt;p&gt;As last ressort, if you are sure the application is correctly installed &quot;
-							&quot;but you had a preview version of it, try to remove the &quot;
-							&quot;file %5basketui.rc&lt;/p&gt;&quot;,
-							aboutData-&gt;programName(), aboutData-&gt;programName(),
-								stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;),stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;), stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;)),
-					i18n(&quot;Ressource not Found&quot;), KMessageBox::AllowLink );
-		}
-		if(!isPart())
-			exit(1); // We SHOULD exit right now and abord everything because the caller except menu != 0 to not crash.
-		else
-			menu = new KMenu; // When running in kpart we cannot exit
-	}
-	return menu;
+    KMenu *menu = 0;
+    bool hack = false; // TODO fix this
+    // When running in kontact and likeback Information message is shown
+    // factory is 0. Don't show error then and don't crash either :-)
+
+    if (m_guiClient) {
+        KXMLGUIFactory* factory = m_guiClient-&gt;factory();
+        if (factory) {
+            menu = (KMenu *)factory-&gt;container(menuName, m_guiClient);
+        } else
+            hack = isPart();
+    }
+    if (menu == 0) {
+        if (!hack) {
+            KStandardDirs stdDirs;
+            const KAboutData *aboutData = KGlobal::mainComponent().aboutData();
+            KMessageBox::error(this, i18n(
+                                   &quot;&lt;p&gt;&lt;b&gt;The file basketui.rc seems to not exist or is too old.&lt;br&gt;&quot;
+                                   &quot;%1 cannot run without it and will stop.&lt;/b&gt;&lt;/p&gt;&quot;
+                                   &quot;&lt;p&gt;Please check your installation of %2.&lt;/p&gt;&quot;
+                                   &quot;&lt;p&gt;If you do not have administrator access to install the application &quot;
+                                   &quot;system wide, you can copy the file basketui.rc from the installation &quot;
+                                   &quot;archive to the folder &lt;a href='file://%3'&gt;%4&lt;/a&gt;.&lt;/p&gt;&quot;
+                                   &quot;&lt;p&gt;As last ressort, if you are sure the application is correctly installed &quot;
+                                   &quot;but you had a preview version of it, try to remove the &quot;
+                                   &quot;file %5basketui.rc&lt;/p&gt;&quot;,
+                                   aboutData-&gt;programName(), aboutData-&gt;programName(),
+                                   stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;), stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;), stdDirs.saveLocation(&quot;data&quot;, &quot;basket/&quot;)),
+                               i18n(&quot;Ressource not Found&quot;), KMessageBox::AllowLink);
+        }
+        if (!isPart())
+            exit(1); // We SHOULD exit right now and abord everything because the caller except menu != 0 to not crash.
+        else
+            menu = new KMenu; // When running in kpart we cannot exit
+    }
+    return menu;
 }
 
 void BNPView::showHideFilterBar(bool show, bool switchFocus)
 {
-//	if (show != m_actShowFilter-&gt;isChecked())
-//		m_actShowFilter-&gt;setChecked(show);
-	m_actShowFilter-&gt;setChecked(show);
+//  if (show != m_actShowFilter-&gt;isChecked())
+//      m_actShowFilter-&gt;setChecked(show);
+    m_actShowFilter-&gt;setChecked(show);
 
-	currentDecoratedBasket()-&gt;setFilterBarVisible(show, switchFocus);
-	if (!show)
-		currentDecoratedBasket()-&gt;resetFilter();
+    currentDecoratedBasket()-&gt;setFilterBarVisible(show, switchFocus);
+    if (!show)
+        currentDecoratedBasket()-&gt;resetFilter();
 }
 
 void BNPView::insertEmpty(int type)
 {
-	if (currentBasket()-&gt;isLocked()) {
-		showPassiveImpossible(i18n(&quot;Cannot add note.&quot;));
-		return;
-	}
-	currentBasket()-&gt;insertEmptyNote(type);
+    if (currentBasket()-&gt;isLocked()) {
+        showPassiveImpossible(i18n(&quot;Cannot add note.&quot;));
+        return;
+    }
+    currentBasket()-&gt;insertEmptyNote(type);
 }
 
 void BNPView::insertWizard(int type)
 {
-	if (currentBasket()-&gt;isLocked()) {
-		showPassiveImpossible(i18n(&quot;Cannot add note.&quot;));
-		return;
-	}
-	currentBasket()-&gt;insertWizard(type);
+    if (currentBasket()-&gt;isLocked()) {
+        showPassiveImpossible(i18n(&quot;Cannot add note.&quot;));
+        return;
+    }
+    currentBasket()-&gt;insertWizard(type);
 }
 
 // BEGIN Screen Grabbing:
 void BNPView::grabScreenshot(bool global)
 {
-	if (m_regionGrabber) {
-		KWindowSystem::activateWindow(m_regionGrabber-&gt;winId());
-		return;
-	}
+    if (m_regionGrabber) {
+        KWindowSystem::activateWindow(m_regionGrabber-&gt;winId());
+        return;
+    }
 
-	// Delay before to take a screenshot because if we hide the main window OR the systray popup menu,
-	// we should wait the windows below to be repainted!!!
-	// A special case is where the action is triggered with the global keyboard shortcut.
-	// In this case, global is true, and we don't wait.
-	// In the future, if global is also defined for other cases, check for
-	// enum KAction::ActivationReason { UnknownActivation, EmulatedActivation, AccelActivation, PopupMenuActivation, ToolBarActivation };
-	int delay = (isMainWindowActive() ? 500 : (global/*kapp-&gt;activePopupWidget()*/ ? 0 : 200));
+    // Delay before to take a screenshot because if we hide the main window OR the systray popup menu,
+    // we should wait the windows below to be repainted!!!
+    // A special case is where the action is triggered with the global keyboard shortcut.
+    // In this case, global is true, and we don't wait.
+    // In the future, if global is also defined for other cases, check for
+    // enum KAction::ActivationReason { UnknownActivation, EmulatedActivation, AccelActivation, PopupMenuActivation, ToolBarActivation };
+    int delay = (isMainWindowActive() ? 500 : (global/*kapp-&gt;activePopupWidget()*/ ? 0 : 200));
 
-	m_colorPickWasGlobal = global;
-	if (isMainWindowActive()) {
-		if(Global::mainWindow()) Global::mainWindow()-&gt;hide();
-		m_colorPickWasShown = true;
-	} else
-		m_colorPickWasShown = false;
+    m_colorPickWasGlobal = global;
+    if (isMainWindowActive()) {
+        if (Global::mainWindow()) Global::mainWindow()-&gt;hide();
+        m_colorPickWasShown = true;
+    } else
+        m_colorPickWasShown = false;
 
-		currentBasket()-&gt;saveInsertionData();
-		usleep(delay * 1000);
-		m_regionGrabber = new RegionGrabber;
-		connect( m_regionGrabber, SIGNAL(regionGrabbed(const QPixmap&amp;)), this, SLOT(screenshotGrabbed(const QPixmap&amp;)) );
+    currentBasket()-&gt;saveInsertionData();
+    usleep(delay * 1000);
+    m_regionGrabber = new RegionGrabber;
+    connect(m_regionGrabber, SIGNAL(regionGrabbed(const QPixmap&amp;)), this, SLOT(screenshotGrabbed(const QPixmap&amp;)));
 }
 
 void BNPView::grabScreenshotGlobal()
 {
-	grabScreenshot(true);
+    grabScreenshot(true);
 }
 
 void BNPView::screenshotGrabbed(const QPixmap &amp;pixmap)
 {
-	delete m_regionGrabber;
-	m_regionGrabber = 0;
+    delete m_regionGrabber;
+    m_regionGrabber = 0;
 
-	// Cancelled (pressed Escape):
-	if (pixmap.isNull()) {
-		if (m_colorPickWasShown)
-			showMainWindow();
-		return;
-	}
+    // Cancelled (pressed Escape):
+    if (pixmap.isNull()) {
+        if (m_colorPickWasShown)
+            showMainWindow();
+        return;
+    }
 
-	if (!currentBasket()-&gt;isLoaded()) {
-		showPassiveLoading(currentBasket());
-		currentBasket()-&gt;load();
-	}
-	currentBasket()-&gt;insertImage(pixmap);
+    if (!currentBasket()-&gt;isLoaded()) {
+        showPassiveLoading(currentBasket());
+        currentBasket()-&gt;load();
+    }
+    currentBasket()-&gt;insertImage(pixmap);
 
-	if (m_colorPickWasShown)
-		showMainWindow();
+    if (m_colorPickWasShown)
+        showMainWindow();
 
-	if (Settings::usePassivePopup())
-		showPassiveDropped(i18n(&quot;Grabbed screen zone to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
+    if (Settings::usePassivePopup())
+        showPassiveDropped(i18n(&quot;Grabbed screen zone to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
 }
 
 Basket* BNPView::basketForFolderName(const QString &amp;folderName)
 {
-/*	QPtrList&lt;Basket&gt; basketsList = listBaskets();
-	Basket *basket;
-	for (basket = basketsList.first(); basket; basket = basketsList.next())
-	if (basket-&gt;folderName() == folderName)
-	return basket;
-*/
-
-	QString name = folderName;
-	if (!name.endsWith(&quot;/&quot;))
-		name += &quot;/&quot;;
-
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		if (item-&gt;basket()-&gt;folderName() == name)
-			return item-&gt;basket();
-		++it;
-	}
+    /*  QPtrList&lt;Basket&gt; basketsList = listBaskets();
+        Basket *basket;
+        for (basket = basketsList.first(); basket; basket = basketsList.next())
+        if (basket-&gt;folderName() == folderName)
+        return basket;
+    */
+
+    QString name = folderName;
+    if (!name.endsWith(&quot;/&quot;))
+        name += &quot;/&quot;;
+
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        if (item-&gt;basket()-&gt;folderName() == name)
+            return item-&gt;basket();
+        ++it;
+    }
 
 
-	return 0;
+    return 0;
 }
 
 Note* BNPView::noteForFileName(const QString &amp;fileName, Basket &amp;basket, Note* note)
 {
-	if (!note)
-		note = basket.firstNote();
-	if (note-&gt;fullPath().endsWith(fileName))
-		return note;
-	Note* child = note-&gt;firstChild();
-	Note* found;
-	while(child)
-	{
-		found = noteForFileName(fileName, basket, child);
-		if (found)
-			return found;
-		child = child-&gt;next();
-	}
-	return 0;
+    if (!note)
+        note = basket.firstNote();
+    if (note-&gt;fullPath().endsWith(fileName))
+        return note;
+    Note* child = note-&gt;firstChild();
+    Note* found;
+    while (child) {
+        found = noteForFileName(fileName, basket, child);
+        if (found)
+            return found;
+        child = child-&gt;next();
+    }
+    return 0;
 }
 
 void BNPView::setFiltering(bool filtering)
 {
-	m_actShowFilter-&gt;setChecked(filtering);
-	m_actResetFilter-&gt;setEnabled(filtering);
-	if (!filtering)
-		m_actFilterAllBaskets-&gt;setEnabled(false);
+    m_actShowFilter-&gt;setChecked(filtering);
+    m_actResetFilter-&gt;setEnabled(filtering);
+    if (!filtering)
+        m_actFilterAllBaskets-&gt;setEnabled(false);
 }
 
 void BNPView::undo()
 {
-	// TODO
+    // TODO
 }
 
 void BNPView::redo()
 {
-	// TODO
+    // TODO
 }
 
 void BNPView::pasteToBasket(int /*index*/, QClipboard::Mode /*mode*/)
 {
-	//TODO: REMOVE!
-	//basketAt(index)-&gt;pasteNote(mode);
+    //TODO: REMOVE!
+    //basketAt(index)-&gt;pasteNote(mode);
 }
 
 void BNPView::propBasket()
 {
-	BasketPropertiesDialog dialog(currentBasket(), this);
-	dialog.exec();
+    BasketPropertiesDialog dialog(currentBasket(), this);
+    dialog.exec();
 }
 
 void BNPView::delBasket()
 {
-//	DecoratedBasket *decoBasket    = currentDecoratedBasket();
-	Basket          *basket        = currentBasket();
+//  DecoratedBasket *decoBasket    = currentDecoratedBasket();
+    Basket          *basket        = currentBasket();
 
-	int really = KMessageBox::questionYesNo( this,
-											 i18n(&quot;&lt;qt&gt;Do you really want to remove the basket &lt;b&gt;%1&lt;/b&gt; and its contents?&lt;/qt&gt;&quot;,
-													 Tools::textToHTMLWithoutP(basket-&gt;basketName())),
-											 i18n(&quot;Remove Basket&quot;)
+    int really = KMessageBox::questionYesNo(this,
+                                            i18n(&quot;&lt;qt&gt;Do you really want to remove the basket &lt;b&gt;%1&lt;/b&gt; and its contents?&lt;/qt&gt;&quot;,
+                                                 Tools::textToHTMLWithoutP(basket-&gt;basketName())),
+                                            i18n(&quot;Remove Basket&quot;)
 #if KDE_IS_VERSION( 3, 2, 90 ) // KDE 3.3.x
-													 , KGuiItem(i18n(&quot;&amp;Remove Basket&quot;), &quot;edit-delete&quot;), KStandardGuiItem::cancel());
+                                            , KGuiItem(i18n(&quot;&amp;Remove Basket&quot;), &quot;edit-delete&quot;), KStandardGuiItem::cancel());
 #else
-		                    );
+                                           );
 #endif
 
-	if (really == KMessageBox::No)
-		return;
+    if (really == KMessageBox::No)
+        return;
 
-	QStringList basketsList = listViewItemForBasket(basket)-&gt;childNamesTree(0);
-	if (basketsList.count() &gt; 0) {
-		int deleteChilds = KMessageBox::questionYesNoList( this,
-				i18n(&quot;&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; have the following children baskets.&lt;br&gt;Do you want to remove them too?&lt;/qt&gt;&quot;,
-						Tools::textToHTMLWithoutP(basket-&gt;basketName())),
-				basketsList,
-				i18n(&quot;Remove Children Baskets&quot;)
+    QStringList basketsList = listViewItemForBasket(basket)-&gt;childNamesTree(0);
+    if (basketsList.count() &gt; 0) {
+        int deleteChilds = KMessageBox::questionYesNoList(this,
+                           i18n(&quot;&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; have the following children baskets.&lt;br&gt;Do you want to remove them too?&lt;/qt&gt;&quot;,
+                                Tools::textToHTMLWithoutP(basket-&gt;basketName())),
+                           basketsList,
+                           i18n(&quot;Remove Children Baskets&quot;)
 #if KDE_IS_VERSION( 3, 2, 90 ) // KDE 3.3.x
-						, KGuiItem(i18n(&quot;&amp;Remove Children Baskets&quot;), &quot;edit-delete&quot;));
+                           , KGuiItem(i18n(&quot;&amp;Remove Children Baskets&quot;), &quot;edit-delete&quot;));
 #else
-		);
+                                                         );
 #endif
 
-		if (deleteChilds == KMessageBox::No)
-			listViewItemForBasket(basket)-&gt;moveChildsBaskets();
-	}
+        if (deleteChilds == KMessageBox::No)
+            listViewItemForBasket(basket)-&gt;moveChildsBaskets();
+    }
 
-	doBasketDeletion(basket);
+    doBasketDeletion(basket);
 
-//	basketNumberChanged();
-//	rebuildBasketsMenu();
+//  basketNumberChanged();
+//  rebuildBasketsMenu();
 }
 
 void BNPView::doBasketDeletion(Basket *basket)
 {
-	basket-&gt;closeEditor();
+    basket-&gt;closeEditor();
 
-	QTreeWidgetItem *basketItem = listViewItemForBasket(basket);
-	for (int i=0;i&lt;basketItem-&gt;childCount();i++){
-		// First delete the child baskets:
-		doBasketDeletion(((BasketListViewItem*)basketItem-&gt;child(i))-&gt;basket());
-	}
-	// Then, basket have no child anymore, delete it:
-	DecoratedBasket *decoBasket = basket-&gt;decoration();
-	basket-&gt;deleteFiles();
-	removeBasket(basket);
-	// Remove the action to avoir keyboard-shortcut clashes:
-	delete basket-&gt;m_action; // FIXME: It's quick&amp;dirty. In the future, the Basket should be deleted, and then the KAction deleted in the Basket destructor.
-	delete decoBasket;
-//	delete basket;
+    QTreeWidgetItem *basketItem = listViewItemForBasket(basket);
+    for (int i = 0; i &lt; basketItem-&gt;childCount(); i++) {
+        // First delete the child baskets:
+        doBasketDeletion(((BasketListViewItem*)basketItem-&gt;child(i))-&gt;basket());
+    }
+    // Then, basket have no child anymore, delete it:
+    DecoratedBasket *decoBasket = basket-&gt;decoration();
+    basket-&gt;deleteFiles();
+    removeBasket(basket);
+    // Remove the action to avoir keyboard-shortcut clashes:
+    delete basket-&gt;m_action; // FIXME: It's quick&amp;dirty. In the future, the Basket should be deleted, and then the KAction deleted in the Basket destructor.
+    delete decoBasket;
+//  delete basket;
 }
 
 void BNPView::password()
 {
 #ifdef HAVE_LIBGPGME
-	PasswordDlg dlg(kapp-&gt;activeWindow());
-	Basket *cur = currentBasket();
-
-	dlg.setType(cur-&gt;encryptionType());
-	dlg.setKey(cur-&gt;encryptionKey());
-	if(dlg.exec()) {
-		cur-&gt;setProtection(dlg.type(), dlg.key());
-		if (cur-&gt;encryptionType() != Basket::NoEncryption)
-			cur-&gt;lock();
-	}
+    PasswordDlg dlg(kapp-&gt;activeWindow());
+    Basket *cur = currentBasket();
+
+    dlg.setType(cur-&gt;encryptionType());
+    dlg.setKey(cur-&gt;encryptionKey());
+    if (dlg.exec()) {
+        cur-&gt;setProtection(dlg.type(), dlg.key());
+        if (cur-&gt;encryptionType() != Basket::NoEncryption)
+            cur-&gt;lock();
+    }
 #endif
 }
 
 void BNPView::lockBasket()
 {
 #ifdef HAVE_LIBGPGME
-	Basket *cur = currentBasket();
+    Basket *cur = currentBasket();
 
-	cur-&gt;lock();
+    cur-&gt;lock();
 #endif
 }
 
 void BNPView::saveAsArchive()
 {
-	Basket *basket = currentBasket();
-
-	QDir dir;
-
-	KConfigGroup config = KGlobal::config()-&gt;group(&quot;Basket Archive&quot;);
-	QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
-	QString url = folder + QString(basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.baskets&quot;;
-
-	QString filter = &quot;*.baskets|&quot; + i18n(&quot;Basket Archives&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
-	QString destination = url;
-	for (bool askAgain = true; askAgain; ) {
-		destination = KFileDialog::getSaveFileName(destination, filter, this, i18n(&quot;Save as Basket Archive&quot;));
-		if (destination.isEmpty()) // User canceled
-			return;
-		if (dir.exists(destination)) {
-			int result = KMessageBox::questionYesNoCancel(
-				this,
-				&quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
-					KUrl(destination).fileName()),
-				i18n(&quot;Override File?&quot;),
-				KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
-			);
-			if (result == KMessageBox::Cancel)
-				return;
-			else if (result == KMessageBox::Yes)
-				askAgain = false;
-		} else
-			askAgain = false;
-	}
-	bool withSubBaskets = true;//KMessageBox::questionYesNo(this, i18n(&quot;Do you want to export sub-baskets too?&quot;), i18n(&quot;Save as Basket Archive&quot;)) == KMessageBox::Yes;
-
-	config.writeEntry(&quot;lastFolder&quot;, KUrl(destination).directory());
-	config.sync();
-
-	Archive::save(basket, withSubBaskets, destination);
+    Basket *basket = currentBasket();
+
+    QDir dir;
+
+    KConfigGroup config = KGlobal::config()-&gt;group(&quot;Basket Archive&quot;);
+    QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
+    QString url = folder + QString(basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.baskets&quot;;
+
+    QString filter = &quot;*.baskets|&quot; + i18n(&quot;Basket Archives&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
+    QString destination = url;
+    for (bool askAgain = true; askAgain;) {
+        destination = KFileDialog::getSaveFileName(destination, filter, this, i18n(&quot;Save as Basket Archive&quot;));
+        if (destination.isEmpty()) // User canceled
+            return;
+        if (dir.exists(destination)) {
+            int result = KMessageBox::questionYesNoCancel(
+                             this,
+                             &quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
+                                           KUrl(destination).fileName()),
+                             i18n(&quot;Override File?&quot;),
+                             KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
+                         );
+            if (result == KMessageBox::Cancel)
+                return;
+            else if (result == KMessageBox::Yes)
+                askAgain = false;
+        } else
+            askAgain = false;
+    }
+    bool withSubBaskets = true;//KMessageBox::questionYesNo(this, i18n(&quot;Do you want to export sub-baskets too?&quot;), i18n(&quot;Save as Basket Archive&quot;)) == KMessageBox::Yes;
+
+    config.writeEntry(&quot;lastFolder&quot;, KUrl(destination).directory());
+    config.sync();
+
+    Archive::save(basket, withSubBaskets, destination);
 }
 
 QString BNPView::s_fileToOpen = &quot;&quot;;
 
 void BNPView::delayedOpenArchive()
 {
-	Archive::open(s_fileToOpen);
+    Archive::open(s_fileToOpen);
 }
 
 void BNPView::openArchive()
 {
-	QString filter = &quot;*.baskets|&quot; + i18n(&quot;Basket Archives&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
-	QString path = KFileDialog::getOpenFileName(KUrl(), filter, this, i18n(&quot;Open Basket Archive&quot;));
-	if (!path.isEmpty()) // User has not canceled
-		Archive::open(path);
+    QString filter = &quot;*.baskets|&quot; + i18n(&quot;Basket Archives&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
+    QString path = KFileDialog::getOpenFileName(KUrl(), filter, this, i18n(&quot;Open Basket Archive&quot;));
+    if (!path.isEmpty()) // User has not canceled
+        Archive::open(path);
 }
 
 
 void BNPView::activatedTagShortcut()
 {
-	Tag *tag = Tag::tagForKAction((KAction*)sender());
-	currentBasket()-&gt;activatedTagShortcut(tag);
+    Tag *tag = Tag::tagForKAction((KAction*)sender());
+    currentBasket()-&gt;activatedTagShortcut(tag);
 }
 
 void BNPView::slotBasketNumberChanged(int number)
 {
-	m_actPreviousBasket-&gt;setEnabled(number &gt; 1);
-	m_actNextBasket    -&gt;setEnabled(number &gt; 1);
+    m_actPreviousBasket-&gt;setEnabled(number &gt; 1);
+    m_actNextBasket    -&gt;setEnabled(number &gt; 1);
 }
 
 void BNPView::slotBasketChanged()
 {
-	m_actFoldBasket-&gt;setEnabled(canFold());
-	m_actExpandBasket-&gt;setEnabled(canExpand());
-	setFiltering(currentBasket() &amp;&amp; currentBasket()-&gt;decoration()-&gt;filterData().isFiltering);
+    m_actFoldBasket-&gt;setEnabled(canFold());
+    m_actExpandBasket-&gt;setEnabled(canExpand());
+    setFiltering(currentBasket() &amp;&amp; currentBasket()-&gt;decoration()-&gt;filterData().isFiltering);
 }
 
 void BNPView::currentBasketChanged()
@@ -2166,341 +2233,355 @@ void BNPView::currentBasketChanged()
 
 void BNPView::isLockedChanged()
 {
-	bool isLocked = currentBasket()-&gt;isLocked();
+    bool isLocked = currentBasket()-&gt;isLocked();
 
-	setLockStatus(isLocked);
+    setLockStatus(isLocked);
 
-//	m_actLockBasket-&gt;setChecked(isLocked);
-	m_actPropBasket-&gt;setEnabled(!isLocked);
-	m_actDelBasket -&gt;setEnabled(!isLocked);
-	updateNotesActions();
+//  m_actLockBasket-&gt;setChecked(isLocked);
+    m_actPropBasket-&gt;setEnabled(!isLocked);
+    m_actDelBasket -&gt;setEnabled(!isLocked);
+    updateNotesActions();
 }
 
 void BNPView::askNewBasket()
 {
-	askNewBasket(0, 0);
+    askNewBasket(0, 0);
 }
 
 void BNPView::askNewBasket(Basket *parent, Basket *pickProperties)
 {
-	NewBasketDefaultProperties properties;
-	if (pickProperties) {
-		properties.icon            = pickProperties-&gt;icon();
-		properties.backgroundImage = pickProperties-&gt;backgroundImageName();
-		properties.backgroundColor = pickProperties-&gt;backgroundColorSetting();
-		properties.textColor       = pickProperties-&gt;textColorSetting();
-		properties.freeLayout      = pickProperties-&gt;isFreeLayout();
-		properties.columnCount     = pickProperties-&gt;columnsCount();
-	}
+    NewBasketDefaultProperties properties;
+    if (pickProperties) {
+        properties.icon            = pickProperties-&gt;icon();
+        properties.backgroundImage = pickProperties-&gt;backgroundImageName();
+        properties.backgroundColor = pickProperties-&gt;backgroundColorSetting();
+        properties.textColor       = pickProperties-&gt;textColorSetting();
+        properties.freeLayout      = pickProperties-&gt;isFreeLayout();
+        properties.columnCount     = pickProperties-&gt;columnsCount();
+    }
 
-	NewBasketDialog(parent, properties, this).exec();
+    NewBasketDialog(parent, properties, this).exec();
 }
 
 void BNPView::askNewSubBasket()
 {
-	askNewBasket( /*parent=*/currentBasket(), /*pickPropertiesOf=*/currentBasket() );
+    askNewBasket(/*parent=*/currentBasket(), /*pickPropertiesOf=*/currentBasket());
 }
 
 void BNPView::askNewSiblingBasket()
 {
-	askNewBasket( /*parent=*/parentBasketOf(currentBasket()), /*pickPropertiesOf=*/currentBasket() );
+    askNewBasket(/*parent=*/parentBasketOf(currentBasket()), /*pickPropertiesOf=*/currentBasket());
 }
 
 void BNPView::globalPasteInCurrentBasket()
 {
-	currentBasket()-&gt;setInsertPopupMenu();
-	pasteInCurrentBasket();
-	currentBasket()-&gt;cancelInsertPopupMenu();
+    currentBasket()-&gt;setInsertPopupMenu();
+    pasteInCurrentBasket();
+    currentBasket()-&gt;cancelInsertPopupMenu();
 }
 
 void BNPView::pasteInCurrentBasket()
 {
-	currentBasket()-&gt;pasteNote();
+    currentBasket()-&gt;pasteNote();
 
-	if (Settings::usePassivePopup())
-		showPassiveDropped(i18n(&quot;Clipboard content pasted to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
+    if (Settings::usePassivePopup())
+        showPassiveDropped(i18n(&quot;Clipboard content pasted to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
 }
 
 void BNPView::pasteSelInCurrentBasket()
 {
-	currentBasket()-&gt;pasteNote(QClipboard::Selection);
+    currentBasket()-&gt;pasteNote(QClipboard::Selection);
 
-	if (Settings::usePassivePopup())
-		showPassiveDropped(i18n(&quot;Selection pasted to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
+    if (Settings::usePassivePopup())
+        showPassiveDropped(i18n(&quot;Selection pasted to basket &lt;i&gt;%1&lt;/i&gt;&quot;));
 }
 
 void BNPView::showPassiveDropped(const QString &amp;title)
 {
-	if ( ! currentBasket()-&gt;isLocked() ) {
-		// TODO: Keep basket, so that we show the message only if something was added to a NOT visible basket
-		m_passiveDroppedTitle     = title;
-		m_passiveDroppedSelection = currentBasket()-&gt;selectedNotes();
-		QTimer::singleShot( c_delayTooltipTime, this, SLOT(showPassiveDroppedDelayed()) );
-		// DELAY IT BELOW:
-	} else
-		showPassiveImpossible(i18n(&quot;No note was added.&quot;));
+    if (! currentBasket()-&gt;isLocked()) {
+        // TODO: Keep basket, so that we show the message only if something was added to a NOT visible basket
+        m_passiveDroppedTitle     = title;
+        m_passiveDroppedSelection = currentBasket()-&gt;selectedNotes();
+        QTimer::singleShot(c_delayTooltipTime, this, SLOT(showPassiveDroppedDelayed()));
+        // DELAY IT BELOW:
+    } else
+        showPassiveImpossible(i18n(&quot;No note was added.&quot;));
 }
 
 void BNPView::showPassiveDroppedDelayed()
 {
-	if (isMainWindowActive() || m_passiveDroppedSelection == 0)
-		return;
+    if (isMainWindowActive() || m_passiveDroppedSelection == 0)
+        return;
 
-	QString title = m_passiveDroppedTitle;
+    QString title = m_passiveDroppedTitle;
 
-	delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
-	m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : this);
-	QImage contentsImage = NoteDrag::feedbackPixmap(m_passiveDroppedSelection).toImage();
-	QResource::registerResource(contentsImage.bits(), &quot;:/images/passivepopup_image&quot;);
-	m_passivePopup-&gt;setView(
-		title.arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())),
-		(contentsImage.isNull() ? &quot;&quot; : &quot;&lt;img src=\&quot;:/images/passivepopup_image\&quot;&gt;&quot;),
-		KIconLoader::global()-&gt;loadIcon(
-			currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
-			KIconLoader::DefaultState, QStringList(), 0L, true
-			)
-		);
-	m_passivePopup-&gt;show();
+    delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
+    m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : this);
+    QImage contentsImage = NoteDrag::feedbackPixmap(m_passiveDroppedSelection).toImage();
+    QResource::registerResource(contentsImage.bits(), &quot;:/images/passivepopup_image&quot;);
+    m_passivePopup-&gt;setView(
+        title.arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())),
+        (contentsImage.isNull() ? &quot;&quot; : &quot;&lt;img src=\&quot;:/images/passivepopup_image\&quot;&gt;&quot;),
+        KIconLoader::global()-&gt;loadIcon(
+            currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
+            KIconLoader::DefaultState, QStringList(), 0L, true
+        )
+    );
+    m_passivePopup-&gt;show();
 }
 
 void BNPView::showPassiveImpossible(const QString &amp;message)
 {
-	delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
-	m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
-	m_passivePopup-&gt;setView(
-		QString(&quot;&lt;font color=red&gt;%1&lt;/font&gt;&quot;)
-		    .arg(i18n(&quot;Basket &lt;i&gt;%1&lt;/i&gt; is locked&quot;))
-		    .arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())),
-		message,
-		KIconLoader::global()-&gt;loadIcon(
-			currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
-			KIconLoader::DefaultState, QStringList(), 0L, true
-			)
-		);
-	m_passivePopup-&gt;show();
+    delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
+    m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+    m_passivePopup-&gt;setView(
+        QString(&quot;&lt;font color=red&gt;%1&lt;/font&gt;&quot;)
+        .arg(i18n(&quot;Basket &lt;i&gt;%1&lt;/i&gt; is locked&quot;))
+        .arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())),
+        message,
+        KIconLoader::global()-&gt;loadIcon(
+            currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
+            KIconLoader::DefaultState, QStringList(), 0L, true
+        )
+    );
+    m_passivePopup-&gt;show();
 }
 
 void BNPView::showPassiveContentForced()
 {
-	showPassiveContent(/*forceShow=*/true);
+    showPassiveContent(/*forceShow=*/true);
 }
 
 void BNPView::showPassiveContent(bool forceShow/* = false*/)
 {
-	if (!forceShow &amp;&amp; isMainWindowActive())
-		return;
-
-	// FIXME: Duplicate code (2 times)
-	QString message;
-
-	delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
-	m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
-	m_passivePopup-&gt;setView(
-			&quot;&lt;qt&gt;&quot; + KDialog::makeStandardCaption(
-				currentBasket()-&gt;isLocked() ? QString(&quot;%1 &lt;font color=gray30&gt;%2&lt;/font&gt;&quot;)
-				    .arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName()), i18n(&quot;(Locked)&quot;))
-				: Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())
-				),
-			message,
-			KIconLoader::global()-&gt;loadIcon(
-				currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
-				KIconLoader::DefaultState, QStringList(), 0L, true
-				)
-		);
-	m_passivePopup-&gt;show();
+    if (!forceShow &amp;&amp; isMainWindowActive())
+        return;
+
+    // FIXME: Duplicate code (2 times)
+    QString message;
+
+    delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
+    m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+    m_passivePopup-&gt;setView(
+        &quot;&lt;qt&gt;&quot; + KDialog::makeStandardCaption(
+            currentBasket()-&gt;isLocked() ? QString(&quot;%1 &lt;font color=gray30&gt;%2&lt;/font&gt;&quot;)
+            .arg(Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName()), i18n(&quot;(Locked)&quot;))
+            : Tools::textToHTMLWithoutP(currentBasket()-&gt;basketName())
+        ),
+        message,
+        KIconLoader::global()-&gt;loadIcon(
+            currentBasket()-&gt;icon(), KIconLoader::NoGroup, 16,
+            KIconLoader::DefaultState, QStringList(), 0L, true
+        )
+    );
+    m_passivePopup-&gt;show();
 }
 
 void BNPView::showPassiveLoading(Basket *basket)
 {
-	if (isMainWindowActive())
-		return;
+    if (isMainWindowActive())
+        return;
 
-	delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
-	m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
-	m_passivePopup-&gt;setView(
-		Tools::textToHTMLWithoutP(basket-&gt;basketName()),
-		i18n(&quot;Loading...&quot;),
-		KIconLoader::global()-&gt;loadIcon(
-			basket-&gt;icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
-			QStringList(), 0L, true
-			)
-		);
-	m_passivePopup-&gt;show();
+    delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
+    m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+    m_passivePopup-&gt;setView(
+        Tools::textToHTMLWithoutP(basket-&gt;basketName()),
+        i18n(&quot;Loading...&quot;),
+        KIconLoader::global()-&gt;loadIcon(
+            basket-&gt;icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
+            QStringList(), 0L, true
+        )
+    );
+    m_passivePopup-&gt;show();
 }
 
-void BNPView::addNoteText()  { showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Text);  }
-void BNPView::addNoteHtml()  { showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Html);  }
-void BNPView::addNoteImage() { showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Image); }
-void BNPView::addNoteLink()  { showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Link);  }
-void BNPView::addNoteColor() { showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Color); }
+void BNPView::addNoteText()
+{
+    showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Text);
+}
+void BNPView::addNoteHtml()
+{
+    showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Html);
+}
+void BNPView::addNoteImage()
+{
+    showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Image);
+}
+void BNPView::addNoteLink()
+{
+    showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Link);
+}
+void BNPView::addNoteColor()
+{
+    showMainWindow(); currentBasket()-&gt;insertEmptyNote(NoteType::Color);
+}
 
 void BNPView::aboutToHideNewBasketPopup()
 {
-	QTimer::singleShot(0, this, SLOT(cancelNewBasketPopup()));
+    QTimer::singleShot(0, this, SLOT(cancelNewBasketPopup()));
 }
 
 void BNPView::cancelNewBasketPopup()
 {
-	m_newBasketPopup = false;
+    m_newBasketPopup = false;
 }
 
 void BNPView::setNewBasketPopup()
 {
-	m_newBasketPopup = true;
+    m_newBasketPopup = true;
 }
 
 void BNPView::setCaption(QString s)
 {
-	emit setWindowCaption(s);
+    emit setWindowCaption(s);
 }
 
 void BNPView::updateStatusBarHint()
 {
-	m_statusbar-&gt;updateStatusBarHint();
+    m_statusbar-&gt;updateStatusBarHint();
 }
 
 void BNPView::setSelectionStatus(QString s)
 {
-	m_statusbar-&gt;setSelectionStatus(s);
+    m_statusbar-&gt;setSelectionStatus(s);
 }
 
 void BNPView::setLockStatus(bool isLocked)
 {
-	m_statusbar-&gt;setLockStatus(isLocked);
+    m_statusbar-&gt;setLockStatus(isLocked);
 }
 
 void BNPView::postStatusbarMessage(const QString&amp; msg)
 {
-	m_statusbar-&gt;postStatusbarMessage(msg);
+    m_statusbar-&gt;postStatusbarMessage(msg);
 }
 
 void BNPView::setStatusBarHint(const QString &amp;hint)
 {
-	m_statusbar-&gt;setStatusBarHint(hint);
+    m_statusbar-&gt;setStatusBarHint(hint);
 }
 
 void BNPView::setUnsavedStatus(bool isUnsaved)
 {
-	m_statusbar-&gt;setUnsavedStatus(isUnsaved);
+    m_statusbar-&gt;setUnsavedStatus(isUnsaved);
 }
 
 void BNPView::setActive(bool active)
 {
     KMainWindow* win = Global::mainWindow();
-    if(!win)
-	return;
+    if (!win)
+        return;
 
     if (active == isMainWindowActive())
-	return;
+        return;
     kapp-&gt;updateUserTimestamp(); // If &quot;activate on mouse hovering systray&quot;, or &quot;on drag throught systray&quot;
     Global::systemTray-&gt;toggleActive();
 }
 
 void BNPView::hideOnEscape()
 {
-	if (Settings::useSystray())
-		setActive(false);
+    if (Settings::useSystray())
+        setActive(false);
 }
 
 bool BNPView::isPart()
 {
-	return objectName() == &quot;BNPViewPart&quot;;
+    return objectName() == &quot;BNPViewPart&quot;;
 }
 
 bool BNPView::isMainWindowActive()
 {
-	KMainWindow* main = Global::mainWindow();
-	if (main &amp;&amp; main-&gt;isActiveWindow())
-		return true;
-	return false;
+    KMainWindow* main = Global::mainWindow();
+    if (main &amp;&amp; main-&gt;isActiveWindow())
+        return true;
+    return false;
 }
 
 void BNPView::newBasket()
 {
-	askNewBasket();
+    askNewBasket();
 }
 
 bool BNPView::createNoteHtml(const QString content, const QString basket)
 {
-	Basket* b = basketForFolderName(basket);
-	if (!b)
-		return false;
-	Note* note = NoteFactory::createNoteHtml(content, b);
-	if (!note)
-		return false;
-	b -&gt; insertCreatedNote(note);
-	return true;
+    Basket* b = basketForFolderName(basket);
+    if (!b)
+        return false;
+    Note* note = NoteFactory::createNoteHtml(content, b);
+    if (!note)
+        return false;
+    b -&gt; insertCreatedNote(note);
+    return true;
 }
 
 bool BNPView::changeNoteHtml(const QString content, const QString basket, const QString noteName)
 {
-	Basket* b = basketForFolderName(basket);
-	if (!b)
-		return false;
-	Note* note = noteForFileName(noteName , *b);
-	if (!note || note-&gt;content()-&gt;type()!=NoteType::Html)
-		return false;
-	HtmlContent* noteContent = (HtmlContent*)note-&gt;content();
-	noteContent-&gt;setHtml(content);
-	note-&gt;saveAgain();
-	return true;
+    Basket* b = basketForFolderName(basket);
+    if (!b)
+        return false;
+    Note* note = noteForFileName(noteName , *b);
+    if (!note || note-&gt;content()-&gt;type() != NoteType::Html)
+        return false;
+    HtmlContent* noteContent = (HtmlContent*)note-&gt;content();
+    noteContent-&gt;setHtml(content);
+    note-&gt;saveAgain();
+    return true;
 }
 
 bool BNPView::createNoteFromFile(const QString url, const QString basket)
 {
-	Basket* b = basketForFolderName(basket);
-	if (!b)
-		return false;
-	KUrl kurl(url);
-	if ( url.isEmpty() )
-		return false;
-	Note* n = NoteFactory::copyFileAndLoad(kurl, b);
-	if (!n)
-		return false;
-	b-&gt;insertCreatedNote(n);
-	return true;
+    Basket* b = basketForFolderName(basket);
+    if (!b)
+        return false;
+    KUrl kurl(url);
+    if (url.isEmpty())
+        return false;
+    Note* n = NoteFactory::copyFileAndLoad(kurl, b);
+    if (!n)
+        return false;
+    b-&gt;insertCreatedNote(n);
+    return true;
 }
 
 QStringList BNPView::listBaskets()
 {
-	QStringList basketList;
+    QStringList basketList;
 
-	QTreeWidgetItemIterator it(m_tree);
-	while (*it) {
-		BasketListViewItem *item = ((BasketListViewItem*)*it);
-		basketList.append(item-&gt;basket()-&gt;basketName());
-		basketList.append(item-&gt;basket()-&gt;folderName());
-		++it;
-	}
-	return basketList;
+    QTreeWidgetItemIterator it(m_tree);
+    while (*it) {
+        BasketListViewItem *item = ((BasketListViewItem*) * it);
+        basketList.append(item-&gt;basket()-&gt;basketName());
+        basketList.append(item-&gt;basket()-&gt;folderName());
+        ++it;
+    }
+    return basketList;
 }
 
 void BNPView::handleCommandLine()
 {
-	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-
-	/* Custom data folder */
-	QString customDataFolder = args-&gt;getOption(&quot;data-folder&quot;);
-	if (!customDataFolder.isNull() &amp;&amp; !customDataFolder.isEmpty())
-	{
-		Global::setCustomSavesFolder(customDataFolder);
-	}
-	/* Debug window */
-	if (args-&gt;isSet(&quot;debug&quot;)) {
-		new DebugWindow();
-		Global::debugWindow-&gt;show();
-	}
-
-	/* Crash Handler to Mail Developers when Crashing: */
+    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+    /* Custom data folder */
+    QString customDataFolder = args-&gt;getOption(&quot;data-folder&quot;);
+    if (!customDataFolder.isNull() &amp;&amp; !customDataFolder.isEmpty()) {
+        Global::setCustomSavesFolder(customDataFolder);
+    }
+    /* Debug window */
+    if (args-&gt;isSet(&quot;debug&quot;)) {
+        new DebugWindow();
+        Global::debugWindow-&gt;show();
+    }
+
+    /* Crash Handler to Mail Developers when Crashing: */
 #ifndef BASKET_USE_DRKONQI
-	if (!args-&gt;isSet(&quot;use-drkonqi&quot;))
-		KCrash::setCrashHandler(Crash::crashHandler);
+    if (!args-&gt;isSet(&quot;use-drkonqi&quot;))
+        KCrash::setCrashHandler(Crash::crashHandler);
 #endif
 }
 
 void BNPView::reloadBasket(const QString &amp;folderName)
 {
-	basketForFolderName(folderName)-&gt;reload();
+    basketForFolderName(folderName)-&gt;reload();
 }
 
 /** Scenario of &quot;Hide main window to system tray icon when mouse move out of the window&quot; :
@@ -2527,170 +2608,169 @@ void BNPView::reloadBasket(const QString &amp;folderName)
 
 void BNPView::enterEvent(QEvent*)
 {
-	if(m_tryHideTimer)
-		m_tryHideTimer-&gt;stop();
-	if(m_hideTimer)
-		m_hideTimer-&gt;stop();
+    if (m_tryHideTimer)
+        m_tryHideTimer-&gt;stop();
+    if (m_hideTimer)
+        m_hideTimer-&gt;stop();
 }
 
 void BNPView::leaveEvent(QEvent*)
 {
-	if (Settings::useSystray() &amp;&amp; Settings::hideOnMouseOut() &amp;&amp; m_tryHideTimer)
-		m_tryHideTimer-&gt;start(50);
+    if (Settings::useSystray() &amp;&amp; Settings::hideOnMouseOut() &amp;&amp; m_tryHideTimer)
+        m_tryHideTimer-&gt;start(50);
 }
 
 void BNPView::timeoutTryHide()
 {
-	// If a menu is displayed, do nothing for the moment
-	if (kapp-&gt;activePopupWidget() != 0L)
-		return;
+    // If a menu is displayed, do nothing for the moment
+    if (kapp-&gt;activePopupWidget() != 0L)
+        return;
 
-	if (kapp-&gt;widgetAt(QCursor::pos()) != 0L)
-		m_hideTimer-&gt;stop();
-	else if ( ! m_hideTimer-&gt;isActive() ) { // Start only one time
-		m_hideTimer-&gt;setSingleShot(true);
-		m_hideTimer-&gt;start(Settings::timeToHideOnMouseOut() * 100);
-	}
+    if (kapp-&gt;widgetAt(QCursor::pos()) != 0L)
+        m_hideTimer-&gt;stop();
+    else if (! m_hideTimer-&gt;isActive()) {   // Start only one time
+        m_hideTimer-&gt;setSingleShot(true);
+        m_hideTimer-&gt;start(Settings::timeToHideOnMouseOut() * 100);
+    }
 
-	// If a sub-dialog is oppened, we musn't hide the main window:
-	if (kapp-&gt;activeWindow() != 0L &amp;&amp; kapp-&gt;activeWindow() != Global::mainWindow())
-		m_hideTimer-&gt;stop();
+    // If a sub-dialog is oppened, we musn't hide the main window:
+    if (kapp-&gt;activeWindow() != 0L &amp;&amp; kapp-&gt;activeWindow() != Global::mainWindow())
+        m_hideTimer-&gt;stop();
 }
 
 void BNPView::timeoutHide()
 {
-	// We check that because the setting can have been set to off
-	if (Settings::useSystray() &amp;&amp; Settings::hideOnMouseOut())
-		setActive(false);
-	m_tryHideTimer-&gt;stop();
+    // We check that because the setting can have been set to off
+    if (Settings::useSystray() &amp;&amp; Settings::hideOnMouseOut())
+        setActive(false);
+    m_tryHideTimer-&gt;stop();
 }
 
 void BNPView::changedSelectedNotes()
 {
-//	tabChanged(0); // FIXME: NOT OPTIMIZED
+//  tabChanged(0); // FIXME: NOT OPTIMIZED
 }
 
 /*void BNPView::areSelectedNotesCheckedChanged(bool checked)
 {
-	m_actCheckNotes-&gt;setChecked(checked &amp;&amp; currentBasket()-&gt;showCheckBoxes());
+    m_actCheckNotes-&gt;setChecked(checked &amp;&amp; currentBasket()-&gt;showCheckBoxes());
 }*/
 
 void BNPView::enableActions()
 {
-	Basket *basket = currentBasket();
-	if(!basket)
-		return;
-	if(m_actLockBasket)
-		m_actLockBasket-&gt;setEnabled(!basket-&gt;isLocked() &amp;&amp; basket-&gt;isEncrypted());
-	if(m_actPassBasket)
-		m_actPassBasket-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actPropBasket-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actDelBasket-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actExportToHtml-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actShowFilter-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actFilterAllBaskets-&gt;setEnabled(!basket-&gt;isLocked());
-	m_actResetFilter-&gt;setEnabled(!basket-&gt;isLocked());
-	basket-&gt;decoration()-&gt;filterBar()-&gt;setEnabled(!basket-&gt;isLocked());
+    Basket *basket = currentBasket();
+    if (!basket)
+        return;
+    if (m_actLockBasket)
+        m_actLockBasket-&gt;setEnabled(!basket-&gt;isLocked() &amp;&amp; basket-&gt;isEncrypted());
+    if (m_actPassBasket)
+        m_actPassBasket-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actPropBasket-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actDelBasket-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actExportToHtml-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actShowFilter-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actFilterAllBaskets-&gt;setEnabled(!basket-&gt;isLocked());
+    m_actResetFilter-&gt;setEnabled(!basket-&gt;isLocked());
+    basket-&gt;decoration()-&gt;filterBar()-&gt;setEnabled(!basket-&gt;isLocked());
 }
 
 void BNPView::showMainWindow()
 {
-	KMainWindow *win = Global::mainWindow();
+    KMainWindow *win = Global::mainWindow();
 
-	if (win)
-	{
-		win-&gt;show();
-	}
-	setActive(true);
-	emit showPart();
+    if (win) {
+        win-&gt;show();
+    }
+    setActive(true);
+    emit showPart();
 }
 
 void BNPView::populateTagsMenu()
 {
-	KMenu *menu = (KMenu*)(popupMenu(&quot;tags&quot;));
-	if (menu == 0 || currentBasket() == 0) // TODO: Display a messagebox. [menu is 0, surely because on first launch, the XMLGUI does not work!]
-		return;
-	menu-&gt;clear();
+    KMenu *menu = (KMenu*)(popupMenu(&quot;tags&quot;));
+    if (menu == 0 || currentBasket() == 0) // TODO: Display a messagebox. [menu is 0, surely because on first launch, the XMLGUI does not work!]
+        return;
+    menu-&gt;clear();
 
-	Note *referenceNote;
-	if (currentBasket()-&gt;focusedNote() &amp;&amp; currentBasket()-&gt;focusedNote()-&gt;isSelected())
-		referenceNote = currentBasket()-&gt;focusedNote();
-	else
-		referenceNote = currentBasket()-&gt;firstSelected();
+    Note *referenceNote;
+    if (currentBasket()-&gt;focusedNote() &amp;&amp; currentBasket()-&gt;focusedNote()-&gt;isSelected())
+        referenceNote = currentBasket()-&gt;focusedNote();
+    else
+        referenceNote = currentBasket()-&gt;firstSelected();
 
-	populateTagsMenu(*menu, referenceNote);
+    populateTagsMenu(*menu, referenceNote);
 
-	m_lastOpenedTagsMenu = menu;
-//	connect( menu, SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
+    m_lastOpenedTagsMenu = menu;
+//  connect( menu, SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
 }
 
 void BNPView::populateTagsMenu(KMenu &amp;menu, Note *referenceNote)
 {
-	if (currentBasket() == 0)
-		return;
+    if (currentBasket() == 0)
+        return;
 
-	currentBasket()-&gt;m_tagPopupNote = referenceNote;
-	bool enable = currentBasket()-&gt;countSelecteds() &gt; 0;
+    currentBasket()-&gt;m_tagPopupNote = referenceNote;
+    bool enable = currentBasket()-&gt;countSelecteds() &gt; 0;
 
-	QList&lt;Tag*&gt;::iterator it;
-	Tag *currentTag;
-	State *currentState;
-	int i = 10;
-	for (it = Tag::all.begin(); it != Tag::all.end(); ++it) {
-	    // Current tag and first state of it:
-	    currentTag = *it;
-	    currentState = currentTag-&gt;states().first();
+    QList&lt;Tag*&gt;::iterator it;
+    Tag *currentTag;
+    State *currentState;
+    int i = 10;
+    for (it = Tag::all.begin(); it != Tag::all.end(); ++it) {
+        // Current tag and first state of it:
+        currentTag = *it;
+        currentState = currentTag-&gt;states().first();
 
-	    QKeySequence sequence;
-		if (!currentTag-&gt;shortcut().isEmpty())
-			sequence = currentTag-&gt;shortcut().primary();
+        QKeySequence sequence;
+        if (!currentTag-&gt;shortcut().isEmpty())
+            sequence = currentTag-&gt;shortcut().primary();
 
-	    StateAction *mi = new StateAction(currentState, KShortcut(sequence), this, true);
+        StateAction *mi = new StateAction(currentState, KShortcut(sequence), this, true);
 
-		// The previously set ID will be set in the actions themselves as data.
-		mi-&gt;setData(i);
+        // The previously set ID will be set in the actions themselves as data.
+        mi-&gt;setData(i);
 
-		if (referenceNote &amp;&amp; referenceNote-&gt;hasTag(currentTag))
-			mi-&gt;setChecked(true);
+        if (referenceNote &amp;&amp; referenceNote-&gt;hasTag(currentTag))
+            mi-&gt;setChecked(true);
 
-	    menu.addAction(mi);
+        menu.addAction(mi);
 
-	    if (!currentTag-&gt;shortcut().isEmpty())
-			mi-&gt;setShortcut(sequence);
+        if (!currentTag-&gt;shortcut().isEmpty())
+            mi-&gt;setShortcut(sequence);
 
-		mi-&gt;setEnabled(enable);
-	    ++i;
-	}
+        mi-&gt;setEnabled(enable);
+        ++i;
+    }
 
-	menu.addSeparator();
+    menu.addSeparator();
 
-	// I don't like how this is implemented; but I can't think of a better way
-	// to do this, so I will have to leave it for now
-	KAction *act =  new KAction(i18n(&quot;&amp;Assign new Tag...&quot;), &amp;menu);
-	act-&gt;setData(1);
-	menu.addAction(act);
+    // I don't like how this is implemented; but I can't think of a better way
+    // to do this, so I will have to leave it for now
+    KAction *act =  new KAction(i18n(&quot;&amp;Assign new Tag...&quot;), &amp;menu);
+    act-&gt;setData(1);
+    menu.addAction(act);
 
-	act = new KAction(KIcon(&quot;edit-delete&quot;), i18n(&quot;&amp;Remove All&quot;), &amp;menu);
-	act-&gt;setData(2);
-	menu.addAction(act);
+    act = new KAction(KIcon(&quot;edit-delete&quot;), i18n(&quot;&amp;Remove All&quot;), &amp;menu);
+    act-&gt;setData(2);
+    menu.addAction(act);
 
-	act = new KAction(KIcon(&quot;configure&quot;), i18n(&quot;&amp;Customize...&quot;), &amp;menu);
-	act-&gt;setData(3);
-	menu.addAction(act);
+    act = new KAction(KIcon(&quot;configure&quot;), i18n(&quot;&amp;Customize...&quot;), &amp;menu);
+    act-&gt;setData(3);
+    menu.addAction(act);
 
-	act-&gt;setEnabled(enable);
-	if (!currentBasket()-&gt;selectedNotesHaveTags())
-		act-&gt;setEnabled(false);
+    act-&gt;setEnabled(enable);
+    if (!currentBasket()-&gt;selectedNotesHaveTags())
+        act-&gt;setEnabled(false);
 
-	connect( &amp;menu, SIGNAL(triggered(QAction *)), currentBasket(), SLOT(toggledTagInMenu(QAction *)) );
-	connect( &amp;menu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(unlockHovering())      );
-	connect( &amp;menu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(disableNextClick())    );
+    connect(&amp;menu, SIGNAL(triggered(QAction *)), currentBasket(), SLOT(toggledTagInMenu(QAction *)));
+    connect(&amp;menu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(unlockHovering()));
+    connect(&amp;menu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(disableNextClick()));
 }
 
 void BNPView::connectTagsMenu()
 {
-	connect( popupMenu(&quot;tags&quot;), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu())   );
-	connect( popupMenu(&quot;tags&quot;), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
+    connect(popupMenu(&quot;tags&quot;), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu()));
+    connect(popupMenu(&quot;tags&quot;), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()));
 }
 
 /*
@@ -2704,37 +2784,37 @@ void BNPView::connectTagsMenu()
 
 void BNPView::showEvent(QShowEvent*)
 {
-	if (isPart())
-		QTimer::singleShot( 0, this, SLOT(connectTagsMenu()) );
+    if (isPart())
+        QTimer::singleShot(0, this, SLOT(connectTagsMenu()));
 
-	if (m_firstShow) {
-		m_firstShow = false;
-		onFirstShow();
-	}
-	if (isPart()/*TODO: &amp;&amp; !LikeBack::enabledBar()*/) {
-		Global::likeBack-&gt;enableBar();
-	}
+    if (m_firstShow) {
+        m_firstShow = false;
+        onFirstShow();
+    }
+    if (isPart()/*TODO: &amp;&amp; !LikeBack::enabledBar()*/) {
+        Global::likeBack-&gt;enableBar();
+    }
 }
 
 void BNPView::hideEvent(QHideEvent*)
 {
-	if (isPart()) {
-		disconnect( popupMenu(&quot;tags&quot;), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu())   );
-		disconnect( popupMenu(&quot;tags&quot;), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
-	}
+    if (isPart()) {
+        disconnect(popupMenu(&quot;tags&quot;), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu()));
+        disconnect(popupMenu(&quot;tags&quot;), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()));
+    }
 
-	if (isPart())
-		Global::likeBack-&gt;disableBar();
+    if (isPart())
+        Global::likeBack-&gt;disableBar();
 }
 
 void BNPView::disconnectTagsMenu()
 {
-	QTimer::singleShot( 0, this, SLOT(disconnectTagsMenuDelayed()) );
+    QTimer::singleShot(0, this, SLOT(disconnectTagsMenuDelayed()));
 }
 
 void BNPView::disconnectTagsMenuDelayed()
 {
-	disconnect( m_lastOpenedTagsMenu, SIGNAL(triggered(QAction *)), currentBasket(), SLOT(toggledTagInMenu(QAction *)) );
-	disconnect( m_lastOpenedTagsMenu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(unlockHovering())      );
-	disconnect( m_lastOpenedTagsMenu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(disableNextClick())    );
+    disconnect(m_lastOpenedTagsMenu, SIGNAL(triggered(QAction *)), currentBasket(), SLOT(toggledTagInMenu(QAction *)));
+    disconnect(m_lastOpenedTagsMenu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(unlockHovering()));
+    disconnect(m_lastOpenedTagsMenu, SIGNAL(aboutToHide()),  currentBasket(), SLOT(disableNextClick()));
 }</diff>
      <filename>src/bnpview.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@
 #include &quot;basket_export.h&quot;
 #include &quot;basketlistview.h&quot;
 
- /// NEW:
+/// NEW:
 
 class QStackedWidget;
 class QDomDocument;
@@ -63,305 +63,307 @@ class Note;
 
 class BASKET_EXPORT BNPView : public QSplitter
 {
-	Q_OBJECT
-	  Q_CLASSINFO(&quot;D Bus Interface&quot;, &quot;org.basket.dbus&quot;);
-	public:
-	/// CONSTRUCTOR AND DESTRUCTOR:
-		BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
-				KActionCollection *actionCollection, BasketStatusBar *bar);
-		~BNPView();
-	/// MANAGE CONFIGURATION EVENTS!:
-		void setTreePlacement(bool onLeft);
-		void relayoutAllBaskets();
-		void recomputeAllStyles();
-		void removedStates(const QList&lt;State*&gt; &amp;deletedStates);
-		void linkLookChanged();
-		void filterPlacementChanged(bool onTop);
-	/// MANAGE BASKETS:
-		BasketListViewItem* listViewItemForBasket(Basket *basket);
-		Basket* currentBasket();
-		Basket* parentBasketOf(Basket *basket);
-		void setCurrentBasket(Basket *basket);
-		void removeBasket(Basket *basket);
-	/// For NewBasketDialog (and later some other classes):
-		int topLevelItemCount();
-		///
-		BasketListViewItem* topLevelItem(int i);
-		int basketCount(QTreeWidgetItem *parent = 0);
-		bool canFold();
-		bool canExpand();
-		void enableActions();
+    Q_OBJECT
+    Q_CLASSINFO(&quot;D Bus Interface&quot;, &quot;org.basket.dbus&quot;);
+public:
+    /// CONSTRUCTOR AND DESTRUCTOR:
+    BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
+            KActionCollection *actionCollection, BasketStatusBar *bar);
+    ~BNPView();
+    /// MANAGE CONFIGURATION EVENTS!:
+    void setTreePlacement(bool onLeft);
+    void relayoutAllBaskets();
+    void recomputeAllStyles();
+    void removedStates(const QList&lt;State*&gt; &amp;deletedStates);
+    void linkLookChanged();
+    void filterPlacementChanged(bool onTop);
+    /// MANAGE BASKETS:
+    BasketListViewItem* listViewItemForBasket(Basket *basket);
+    Basket* currentBasket();
+    Basket* parentBasketOf(Basket *basket);
+    void setCurrentBasket(Basket *basket);
+    void removeBasket(Basket *basket);
+    /// For NewBasketDialog (and later some other classes):
+    int topLevelItemCount();
+    ///
+    BasketListViewItem* topLevelItem(int i);
+    int basketCount(QTreeWidgetItem *parent = 0);
+    bool canFold();
+    bool canExpand();
+    void enableActions();
 
-	private:
-		QDomElement basketElement(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement);
-	public slots:
-		void countsChanged(Basket *basket);
-		void notesStateChanged();
-		bool convertTexts();
+private:
+    QDomElement basketElement(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement);
+public slots:
+    void countsChanged(Basket *basket);
+    void notesStateChanged();
+    bool convertTexts();
 
-		void updateBasketListViewItem(Basket *basket);
-		void save();
-		void save(QTreeWidget* listView, QTreeWidgetItem *firstItem, QDomDocument &amp;document, QDomElement &amp;parentElement);
-		void saveSubHierarchy(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement, bool recursive);
-		void load();
-		void load(QTreeWidget *listView, QTreeWidgetItem *item, const QDomElement &amp;baskets);
-		void loadNewBasket(const QString &amp;folderName, const QDomElement &amp;properties, Basket *parent);
-		void goToPreviousBasket();
-		void goToNextBasket();
-		void foldBasket();
-		void expandBasket();
-		void closeAllEditors();
-		///
-		void toggleFilterAllBaskets(bool doFilter);
-		void newFilter();
-		void newFilterFromFilterBar();
-		bool isFilteringAllBaskets();
-		// From main window
-		void importKNotes();
-		void importKJots();
-		void importKnowIt();
-		void importTuxCards();
-		void importStickyNotes();
-		void importTomboy();
-		void importTextFile();
-		void backupRestore();
+    void updateBasketListViewItem(Basket *basket);
+    void save();
+    void save(QTreeWidget* listView, QTreeWidgetItem *firstItem, QDomDocument &amp;document, QDomElement &amp;parentElement);
+    void saveSubHierarchy(QTreeWidgetItem *item, QDomDocument &amp;document, QDomElement &amp;parentElement, bool recursive);
+    void load();
+    void load(QTreeWidget *listView, QTreeWidgetItem *item, const QDomElement &amp;baskets);
+    void loadNewBasket(const QString &amp;folderName, const QDomElement &amp;properties, Basket *parent);
+    void goToPreviousBasket();
+    void goToNextBasket();
+    void foldBasket();
+    void expandBasket();
+    void closeAllEditors();
+    ///
+    void toggleFilterAllBaskets(bool doFilter);
+    void newFilter();
+    void newFilterFromFilterBar();
+    bool isFilteringAllBaskets();
+    // From main window
+    void importKNotes();
+    void importKJots();
+    void importKnowIt();
+    void importTuxCards();
+    void importStickyNotes();
+    void importTomboy();
+    void importTextFile();
+    void backupRestore();
 
-		/** Note */
-		void activatedTagShortcut();
-		void exportToHTML();
-		void editNote();
-		void cutNote();
-		void copyNote();
-		void delNote();
-		void openNote();
-		void openNoteWith();
-		void saveNoteAs();
-		void noteGroup();
-		void noteUngroup();
-		void moveOnTop();
-		void moveOnBottom();
-		void moveNoteUp();
-		void moveNoteDown();
-		void slotSelectAll();
-		void slotUnselectAll();
-		void slotInvertSelection();
-		void slotResetFilter();
+    /** Note */
+    void activatedTagShortcut();
+    void exportToHTML();
+    void editNote();
+    void cutNote();
+    void copyNote();
+    void delNote();
+    void openNote();
+    void openNoteWith();
+    void saveNoteAs();
+    void noteGroup();
+    void noteUngroup();
+    void moveOnTop();
+    void moveOnBottom();
+    void moveNoteUp();
+    void moveNoteDown();
+    void slotSelectAll();
+    void slotUnselectAll();
+    void slotInvertSelection();
+    void slotResetFilter();
 
-		void slotColorFromScreen(bool global = false);
-		void slotColorFromScreenGlobal();
-		void colorPicked(const QColor &amp;color);
-		void colorPickingCanceled();
-		void slotConvertTexts();
+    void slotColorFromScreen(bool global = false);
+    void slotColorFromScreenGlobal();
+    void colorPicked(const QColor &amp;color);
+    void colorPickingCanceled();
+    void slotConvertTexts();
 
-		/** Global shortcuts */
-		void addNoteText();
-		void addNoteHtml();
-		void addNoteImage();
-		void addNoteLink();
-		void addNoteColor();
-		/** Passive Popups for Global Actions */
-		void showPassiveDropped(const QString &amp;title);
-		void showPassiveDroppedDelayed(); // Do showPassiveDropped(), but delayed
-		void showPassiveContent(bool forceShow = false);
-		void showPassiveContentForced();
-		void showPassiveImpossible(const QString &amp;message);
-		void showPassiveLoading(Basket *basket);
-		// For GUI :
-		void setFiltering(bool filtering);
-		/** Edit */
-		void undo();
-		void redo();
-		void globalPasteInCurrentBasket();
-		void pasteInCurrentBasket();
-		void pasteSelInCurrentBasket();
-		void pasteToBasket(int index, QClipboard::Mode mode = QClipboard::Clipboard);
-		void showHideFilterBar(bool show, bool switchFocus = true);
-		/** Insert **/
-		void insertEmpty(int type);
-		void insertWizard(int type);
-		void grabScreenshot(bool global = false);
-		void grabScreenshotGlobal();
-		void screenshotGrabbed(const QPixmap &amp;pixmap);
-		/** Basket */
-		void askNewBasket();
-		void askNewBasket(Basket *parent, Basket *pickProperties);
-		void askNewSubBasket();
-		void askNewSiblingBasket();
-		void aboutToHideNewBasketPopup();
-		void setNewBasketPopup();
-		void cancelNewBasketPopup();
-		void propBasket();
-		void delBasket();
-		void doBasketDeletion(Basket *basket);
-		void password();
-		void saveAsArchive();
-		void openArchive();
-		void delayedOpenArchive();
-		void lockBasket();
-		void hideOnEscape();
+    /** Global shortcuts */
+    void addNoteText();
+    void addNoteHtml();
+    void addNoteImage();
+    void addNoteLink();
+    void addNoteColor();
+    /** Passive Popups for Global Actions */
+    void showPassiveDropped(const QString &amp;title);
+    void showPassiveDroppedDelayed(); // Do showPassiveDropped(), but delayed
+    void showPassiveContent(bool forceShow = false);
+    void showPassiveContentForced();
+    void showPassiveImpossible(const QString &amp;message);
+    void showPassiveLoading(Basket *basket);
+    // For GUI :
+    void setFiltering(bool filtering);
+    /** Edit */
+    void undo();
+    void redo();
+    void globalPasteInCurrentBasket();
+    void pasteInCurrentBasket();
+    void pasteSelInCurrentBasket();
+    void pasteToBasket(int index, QClipboard::Mode mode = QClipboard::Clipboard);
+    void showHideFilterBar(bool show, bool switchFocus = true);
+    /** Insert **/
+    void insertEmpty(int type);
+    void insertWizard(int type);
+    void grabScreenshot(bool global = false);
+    void grabScreenshotGlobal();
+    void screenshotGrabbed(const QPixmap &amp;pixmap);
+    /** Basket */
+    void askNewBasket();
+    void askNewBasket(Basket *parent, Basket *pickProperties);
+    void askNewSubBasket();
+    void askNewSiblingBasket();
+    void aboutToHideNewBasketPopup();
+    void setNewBasketPopup();
+    void cancelNewBasketPopup();
+    void propBasket();
+    void delBasket();
+    void doBasketDeletion(Basket *basket);
+    void password();
+    void saveAsArchive();
+    void openArchive();
+    void delayedOpenArchive();
+    void lockBasket();
+    void hideOnEscape();
 
-		void changedSelectedNotes();
-		void timeoutTryHide();
-		void timeoutHide();
+    void changedSelectedNotes();
+    void timeoutTryHide();
+    void timeoutHide();
 
-	public:
-		static QString s_fileToOpen;
+public:
+    static QString s_fileToOpen;
 
-	public slots:
-		void addWelcomeBaskets();
-	private slots:
-		void updateNotesActions();
-		void slotBasketNumberChanged(int number);
-		void slotBasketChanged();
-		void currentBasketChanged();
-		void isLockedChanged();
-		void lateInit();
-		void onFirstShow();
+public slots:
+    void addWelcomeBaskets();
+private slots:
+    void updateNotesActions();
+    void slotBasketNumberChanged(int number);
+    void slotBasketChanged();
+    void currentBasketChanged();
+    void isLockedChanged();
+    void lateInit();
+    void onFirstShow();
 
-	public:
-		KAction       *m_actEditNote;
-		KAction       *m_actOpenNote;
-		KAction       *m_actPaste;
-		KAction       *m_actGrabScreenshot;
-		KAction       *m_actColorPicker;
-		KAction       *m_actLockBasket;
-		KAction       *m_actPassBasket;
-		KAction       *actNewBasket;
-		KAction       *actNewSubBasket;
-		KAction       *actNewSiblingBasket;
-		KAction       *m_actHideWindow;
-		KAction       *m_actExportToHtml;
-		KAction       *m_actPropBasket;
-		KAction       *m_actDelBasket;
-		KToggleAction *m_actFilterAllBaskets;
+public:
+    KAction       *m_actEditNote;
+    KAction       *m_actOpenNote;
+    KAction       *m_actPaste;
+    KAction       *m_actGrabScreenshot;
+    KAction       *m_actColorPicker;
+    KAction       *m_actLockBasket;
+    KAction       *m_actPassBasket;
+    KAction       *actNewBasket;
+    KAction       *actNewSubBasket;
+    KAction       *actNewSiblingBasket;
+    KAction       *m_actHideWindow;
+    KAction       *m_actExportToHtml;
+    KAction       *m_actPropBasket;
+    KAction       *m_actDelBasket;
+    KToggleAction *m_actFilterAllBaskets;
 
-	private:
-		// Basket actions:
-		KAction       *m_actSaveAsArchive;
-		KAction       *m_actOpenArchive;
-		// Notes actions :
-		KAction       *m_actOpenNoteWith;
-		KAction       *m_actSaveNoteAs;
-		KAction       *m_actGroup;
-		KAction       *m_actUngroup;
-		KAction       *m_actMoveOnTop;
-		KAction       *m_actMoveNoteUp;
-		KAction       *m_actMoveNoteDown;
-		KAction       *m_actMoveOnBottom;
-		// Edit actions :
-		KAction       *m_actUndo;
-		KAction       *m_actRedo;
-		KAction       *m_actCutNote;
-		KAction       *m_actCopyNote;
-		KAction       *m_actDelNote;
-		KAction       *m_actSelectAll;
-		KAction       *m_actUnselectAll;
-		KAction       *m_actInvertSelection;
-		// Insert actions :
-//		KAction       *m_actInsertText;
-		KAction       *m_actInsertHtml;
-		KAction       *m_actInsertLink;
-		KAction       *m_actInsertImage;
-		KAction       *m_actInsertColor;
-		KAction       *m_actImportKMenu;
-		KAction       *m_actInsertLauncher;
-		KAction       *m_actImportIcon;
-		KAction       *m_actLoadFile;
-		QList&lt;KAction*&gt; m_insertActions;
-		// Basket actions :
-		KToggleAction *m_actShowFilter;
-		KAction       *m_actResetFilter;
-		// Go actions :
-		KAction       *m_actPreviousBasket;
-		KAction       *m_actNextBasket;
-		KAction       *m_actFoldBasket;
-		KAction       *m_actExpandBasket;
-//		KAction       *m_convertTexts; // FOR_BETA_PURPOSE
+private:
+    // Basket actions:
+    KAction       *m_actSaveAsArchive;
+    KAction       *m_actOpenArchive;
+    // Notes actions :
+    KAction       *m_actOpenNoteWith;
+    KAction       *m_actSaveNoteAs;
+    KAction       *m_actGroup;
+    KAction       *m_actUngroup;
+    KAction       *m_actMoveOnTop;
+    KAction       *m_actMoveNoteUp;
+    KAction       *m_actMoveNoteDown;
+    KAction       *m_actMoveOnBottom;
+    // Edit actions :
+    KAction       *m_actUndo;
+    KAction       *m_actRedo;
+    KAction       *m_actCutNote;
+    KAction       *m_actCopyNote;
+    KAction       *m_actDelNote;
+    KAction       *m_actSelectAll;
+    KAction       *m_actUnselectAll;
+    KAction       *m_actInvertSelection;
+    // Insert actions :
+//      KAction       *m_actInsertText;
+    KAction       *m_actInsertHtml;
+    KAction       *m_actInsertLink;
+    KAction       *m_actInsertImage;
+    KAction       *m_actInsertColor;
+    KAction       *m_actImportKMenu;
+    KAction       *m_actInsertLauncher;
+    KAction       *m_actImportIcon;
+    KAction       *m_actLoadFile;
+    QList&lt;KAction*&gt; m_insertActions;
+    // Basket actions :
+    KToggleAction *m_actShowFilter;
+    KAction       *m_actResetFilter;
+    // Go actions :
+    KAction       *m_actPreviousBasket;
+    KAction       *m_actNextBasket;
+    KAction       *m_actFoldBasket;
+    KAction       *m_actExpandBasket;
+//      KAction       *m_convertTexts; // FOR_BETA_PURPOSE
 
-		void setupActions();
-		void setupGlobalShortcuts();
-		DecoratedBasket* currentDecoratedBasket();
+    void setupActions();
+    void setupGlobalShortcuts();
+    DecoratedBasket* currentDecoratedBasket();
 
-	public:
-		Basket* loadBasket(const QString &amp;folderName); // Public only for class Archive
-		BasketListViewItem* appendBasket(Basket *basket, QTreeWidgetItem *parentItem); // Public only for class Archive
+public:
+    Basket* loadBasket(const QString &amp;folderName); // Public only for class Archive
+    BasketListViewItem* appendBasket(Basket *basket, QTreeWidgetItem *parentItem); // Public only for class Archive
 
-		Basket* basketForFolderName(const QString &amp;folderName);
-		Note* noteForFileName(const QString &amp;fileName, Basket &amp;basket, Note* note = 0);
-		KMenu* popupMenu(const QString &amp;menuName);
-		bool isPart();
-		bool isMainWindowActive();
-		void showMainWindow();
+    Basket* basketForFolderName(const QString &amp;folderName);
+    Note* noteForFileName(const QString &amp;fileName, Basket &amp;basket, Note* note = 0);
+    KMenu* popupMenu(const QString &amp;menuName);
+    bool isPart();
+    bool isMainWindowActive();
+    void showMainWindow();
 
-		// TODO: dcop calls -- dbus these
-		public Q_SLOTS:
-		Q_SCRIPTABLE void newBasket();
-		Q_SCRIPTABLE void handleCommandLine();
-		Q_SCRIPTABLE void reloadBasket(const QString &amp;folderName);
-		Q_SCRIPTABLE bool createNoteHtml(const QString content, const QString basket);
-		Q_SCRIPTABLE QStringList listBaskets();
-		Q_SCRIPTABLE bool createNoteFromFile(const QString url, const QString basket);
-		Q_SCRIPTABLE bool changeNoteHtml(const QString content, const QString basket, const QString noteName);
+    // TODO: dcop calls -- dbus these
+public Q_SLOTS:
+    Q_SCRIPTABLE void newBasket();
+    Q_SCRIPTABLE void handleCommandLine();
+    Q_SCRIPTABLE void reloadBasket(const QString &amp;folderName);
+    Q_SCRIPTABLE bool createNoteHtml(const QString content, const QString basket);
+    Q_SCRIPTABLE QStringList listBaskets();
+    Q_SCRIPTABLE bool createNoteFromFile(const QString url, const QString basket);
+    Q_SCRIPTABLE bool changeNoteHtml(const QString content, const QString basket, const QString noteName);
 
-	public slots:
-		void setCaption(QString s);
-		void updateStatusBarHint();
-		void setSelectionStatus(QString s);
-		void setLockStatus(bool isLocked);
-		void postStatusbarMessage(const QString&amp;);
-		void setStatusBarHint(const QString&amp;);
-		void setUnsavedStatus(bool isUnsaved);
-		void setActive(bool active = true);
-		KActionCollection *actionCollection() { return m_actionCollection; };
+public slots:
+    void setCaption(QString s);
+    void updateStatusBarHint();
+    void setSelectionStatus(QString s);
+    void setLockStatus(bool isLocked);
+    void postStatusbarMessage(const QString&amp;);
+    void setStatusBarHint(const QString&amp;);
+    void setUnsavedStatus(bool isUnsaved);
+    void setActive(bool active = true);
+    KActionCollection *actionCollection() {
+        return m_actionCollection;
+    };
 
-		void populateTagsMenu();
-		void populateTagsMenu(KMenu &amp;menu, Note *referenceNote);
-		void connectTagsMenu();
-		void disconnectTagsMenu();
-		void disconnectTagsMenuDelayed();
-	protected:
-		void showEvent(QShowEvent*);
-		void hideEvent(QHideEvent*);
-	private:
-		KMenu *m_lastOpenedTagsMenu;
+    void populateTagsMenu();
+    void populateTagsMenu(KMenu &amp;menu, Note *referenceNote);
+    void connectTagsMenu();
+    void disconnectTagsMenu();
+    void disconnectTagsMenuDelayed();
+protected:
+    void showEvent(QShowEvent*);
+    void hideEvent(QHideEvent*);
+private:
+    KMenu *m_lastOpenedTagsMenu;
 
-	private slots:
-		void slotPressed(QTreeWidgetItem *item, int column);
-		void needSave(QTreeWidgetItem*);
-		void slotContextMenu(const QPoint &amp;pos);
-		void slotMouseButtonPressed(int button, QTreeWidgetItem *item, const QPoint &amp;pos, int column);
-		void slotShowProperties(QTreeWidgetItem *item);
-		void initialize();
+private slots:
+    void slotPressed(QTreeWidgetItem *item, int column);
+    void needSave(QTreeWidgetItem*);
+    void slotContextMenu(const QPoint &amp;pos);
+    void slotMouseButtonPressed(int button, QTreeWidgetItem *item, const QPoint &amp;pos, int column);
+    void slotShowProperties(QTreeWidgetItem *item);
+    void initialize();
 
-	signals:
-		void basketNumberChanged(int number);
-		void basketChanged();
-		void setWindowCaption(const QString &amp;s);
-		void showPart();
+signals:
+    void basketNumberChanged(int number);
+    void basketChanged();
+    void setWindowCaption(const QString &amp;s);
+    void showPart();
 
-	protected:
-		void enterEvent(QEvent*);
-		void leaveEvent(QEvent*);
+protected:
+    void enterEvent(QEvent*);
+    void leaveEvent(QEvent*);
 
-	private:
-		BasketTreeListView *m_tree;
-		QStackedWidget *m_stack;
-		bool          m_loading;
-		bool          m_newBasketPopup;
-		bool          m_firstShow;
-		DesktopColorPicker *m_colorPicker;
-		bool                m_colorPickWasShown;
-		bool                m_colorPickWasGlobal;
-		RegionGrabber      *m_regionGrabber;
-		QString m_passiveDroppedTitle;
-		NoteSelection *m_passiveDroppedSelection;
-		KPassivePopup *m_passivePopup;
-		static const int c_delayTooltipTime;
-		KActionCollection *m_actionCollection;
-		KXMLGUIClient *m_guiClient;
-		BasketStatusBar *m_statusbar;
-		QTimer             *m_tryHideTimer;
-		QTimer             *m_hideTimer;
+private:
+    BasketTreeListView *m_tree;
+    QStackedWidget *m_stack;
+    bool          m_loading;
+    bool          m_newBasketPopup;
+    bool          m_firstShow;
+    DesktopColorPicker *m_colorPicker;
+    bool                m_colorPickWasShown;
+    bool                m_colorPickWasGlobal;
+    RegionGrabber      *m_regionGrabber;
+    QString m_passiveDroppedTitle;
+    NoteSelection *m_passiveDroppedSelection;
+    KPassivePopup *m_passivePopup;
+    static const int c_delayTooltipTime;
+    KActionCollection *m_actionCollection;
+    KXMLGUIClient *m_guiClient;
+    BasketStatusBar *m_statusbar;
+    QTimer             *m_tryHideTimer;
+    QTimer             *m_hideTimer;
 };
 
 #endif // BNPVIEW_H</diff>
      <filename>src/bnpview.h</filename>
    </modified>
    <modified>
      <diff>@@ -38,10 +38,10 @@
  */
 
 DesktopColorPicker::DesktopColorPicker()
- : QDesktopWidget()
+        : QDesktopWidget()
 {
-	setObjectName(&quot;DesktopColorPicker&quot;);
-	m_gettingColorFromScreen = false;
+    setObjectName(&quot;DesktopColorPicker&quot;);
+    m_gettingColorFromScreen = false;
 }
 
 DesktopColorPicker::~DesktopColorPicker()
@@ -50,9 +50,9 @@ DesktopColorPicker::~DesktopColorPicker()
 
 void DesktopColorPicker::pickColor()
 {
-	m_gettingColorFromScreen = true;
-//	Global::mainContainer-&gt;setActive(false);
-	QTimer::singleShot( 50, this, SLOT(slotDelayedPick()) );
+    m_gettingColorFromScreen = true;
+//  Global::mainContainer-&gt;setActive(false);
+    QTimer::singleShot(50, this, SLOT(slotDelayedPick()));
 }
 
 /* When firered from basket context menu, and not from menu, grabMouse doesn't work!
@@ -64,35 +64,35 @@ void DesktopColorPicker::pickColor()
  */
 void DesktopColorPicker::slotDelayedPick()
 {
-	grabKeyboard();
-	grabMouse(Qt::CrossCursor);
+    grabKeyboard();
+    grabMouse(Qt::CrossCursor);
 }
 
 /* Validate the color
  */
 void DesktopColorPicker::mouseReleaseEvent(QMouseEvent *event)
 {
-	if (m_gettingColorFromScreen) {
-		m_gettingColorFromScreen = false;
-		releaseMouse();
-		releaseKeyboard();
-		QColor color = KColorDialog::grabColor(event-&gt;globalPos());
-		emit pickedColor(color);
-	} else
-		QDesktopWidget::mouseReleaseEvent(event);
+    if (m_gettingColorFromScreen) {
+        m_gettingColorFromScreen = false;
+        releaseMouse();
+        releaseKeyboard();
+        QColor color = KColorDialog::grabColor(event-&gt;globalPos());
+        emit pickedColor(color);
+    } else
+        QDesktopWidget::mouseReleaseEvent(event);
 }
 
 /* Cancel the mode
  */
 void DesktopColorPicker::keyPressEvent(QKeyEvent *event)
 {
-	if (m_gettingColorFromScreen)
-		if (event-&gt;key() == Qt::Key_Escape) {
-			m_gettingColorFromScreen = false;
-			releaseMouse();
-			releaseKeyboard();
-			emit canceledPick();
-		}
-	QDesktopWidget::keyPressEvent(event);
+    if (m_gettingColorFromScreen)
+        if (event-&gt;key() == Qt::Key_Escape) {
+            m_gettingColorFromScreen = false;
+            releaseMouse();
+            releaseKeyboard();
+            emit canceledPick();
+        }
+    QDesktopWidget::keyPressEvent(event);
 }
 </diff>
      <filename>src/colorpicker.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -31,30 +31,30 @@
   */
 class DesktopColorPicker : public QDesktopWidget
 {
-  Q_OBJECT
-  public:
-	/** Construtor, initializer and destructor */
-	DesktopColorPicker();
-	~DesktopColorPicker();
-  public slots:
-	/** Begin color picking.
-	  * This function returns immediatly, and pickedColor() is emitted if user has
-	  * choosen a color, and not canceled the process (by pressing Escape).
-	  */
-	void pickColor();
-  signals:
-	/** When user picked a color, this signal is emitted.
-	  */
-	void pickedColor(const QColor &amp;color);
-	/** When user cancel a picking (by pressing Escape), this signal is emitted.
-	  */
-	void canceledPick();
-  protected slots:
-	void slotDelayedPick();
-  protected:
-	void mouseReleaseEvent(QMouseEvent *event);
-	void keyPressEvent(QKeyEvent *event);
-	bool m_gettingColorFromScreen;
+    Q_OBJECT
+public:
+    /** Construtor, initializer and destructor */
+    DesktopColorPicker();
+    ~DesktopColorPicker();
+public slots:
+    /** Begin color picking.
+      * This function returns immediatly, and pickedColor() is emitted if user has
+      * choosen a color, and not canceled the process (by pressing Escape).
+      */
+    void pickColor();
+signals:
+    /** When user picked a color, this signal is emitted.
+      */
+    void pickedColor(const QColor &amp;color);
+    /** When user cancel a picking (by pressing Escape), this signal is emitted.
+      */
+    void canceledPick();
+protected slots:
+    void slotDelayedPick();
+protected:
+    void mouseReleaseEvent(QMouseEvent *event);
+    void keyPressEvent(QKeyEvent *event);
+    bool m_gettingColorFromScreen;
 };
 
 #endif // COLORPICKER_H</diff>
      <filename>src/colorpicker.h</filename>
    </modified>
    <modified>
      <diff>@@ -43,76 +43,76 @@
 //#endif
 
 
-    #if 0
-    class CrashHandlerWidget : public KDialog {
-    public:
-        CrashHandlerWidget();
-    };
-    #endif
-
-    static QString
-    runCommand( const QByteArray &amp;command )
-    {
-        static const uint SIZE = 40960; //40 KiB
-        static char stdoutBuf[ SIZE ];
+#if 0
+class CrashHandlerWidget : public KDialog
+{
+public:
+    CrashHandlerWidget();
+};
+#endif
+
+static QString
+runCommand(const QByteArray &amp;command)
+{
+    static const uint SIZE = 40960; //40 KiB
+    static char stdoutBuf[ SIZE ];
 
 //        debug() &lt;&lt; &quot;Running: &quot; &lt;&lt; command &lt;&lt; endl;
 
-        FILE *process = ::popen( command, &quot;r&quot; );
-        stdoutBuf[ std::fread( static_cast&lt;void*&gt;( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0';
-        ::pclose( process );
+    FILE *process = ::popen(command, &quot;r&quot;);
+    stdoutBuf[ std::fread(static_cast&lt;void*&gt;(stdoutBuf), sizeof(char), SIZE-1, process)] = '\0';
+    ::pclose(process);
 
-        return QString::fromLocal8Bit( stdoutBuf );
-    }
+    return QString::fromLocal8Bit(stdoutBuf);
+}
 
-    void
-    Crash::crashHandler( int /*signal*/ )
-    {
-        // we need to fork to be able to get a
-        // semi-decent bt - I dunno why
-        const pid_t pid = ::fork();
+void
+Crash::crashHandler(int /*signal*/)
+{
+    // we need to fork to be able to get a
+    // semi-decent bt - I dunno why
+    const pid_t pid = ::fork();
 
-        if( pid &lt;= 0 )
-        {
-            // we are the child process (the result of the fork)
+    if (pid &lt;= 0) {
+        // we are the child process (the result of the fork)
 //            debug() &lt;&lt; &quot;amaroK is crashing...\n&quot;;
 
-            QString subject = &quot;[basket-crash] &quot; VERSION &quot; &quot;;
-            QString body = i18n(
-                    &quot;%1 has crashed! We're sorry about this.\n&quot;
-                    &quot;\n&quot;
-                    &quot;But, all is not lost! You could potentially help us fix the crash. &quot;
-                    &quot;Information describing the crash is below, so just click send, &quot;
-                    &quot;or if you have time, write a brief description of how the crash happened first.\n\n&quot;
-                    &quot;Many thanks.&quot;, KGlobal::mainComponent().aboutData()-&gt;programName()) + &quot;\n\n&quot;;
-            body += &quot;\n\n\n\n\n\n&quot; + i18n(
+        QString subject = &quot;[basket-crash] &quot; VERSION &quot; &quot;;
+        QString body = i18n(
+                           &quot;%1 has crashed! We're sorry about this.\n&quot;
+                           &quot;\n&quot;
+                           &quot;But, all is not lost! You could potentially help us fix the crash. &quot;
+                           &quot;Information describing the crash is below, so just click send, &quot;
+                           &quot;or if you have time, write a brief description of how the crash happened first.\n\n&quot;
+                           &quot;Many thanks.&quot;, KGlobal::mainComponent().aboutData()-&gt;programName()) + &quot;\n\n&quot;;
+        body += &quot;\n\n\n\n\n\n&quot; + i18n(
                     &quot;The information below is to help the developers identify the problem, &quot;
-                    &quot;please do not modify it.&quot; ) + &quot;\n\n\n\n&quot;;
+                    &quot;please do not modify it.&quot;) + &quot;\n\n\n\n&quot;;
 
 
-            body += &quot;======== DEBUG INFORMATION  =======\n&quot;
-                    &quot;Version:    &quot; VERSION &quot;\n&quot;
-                    &quot;Build date: &quot; __DATE__ &quot;\n&quot;
-                    &quot;CC version: &quot; __VERSION__ &quot;\n&quot; //assuming we're using GCC
-                    &quot;KDElibs:    &quot; KDE_VERSION_STRING &quot;\n&quot;
-;//                    &quot;TagLib:     %2.%3.%4\n&quot;;
+        body += &quot;======== DEBUG INFORMATION  =======\n&quot;
+                &quot;Version:    &quot; VERSION &quot;\n&quot;
+                &quot;Build date: &quot; __DATE__ &quot;\n&quot;
+                &quot;CC version: &quot; __VERSION__ &quot;\n&quot; //assuming we're using GCC
+                &quot;KDElibs:    &quot; KDE_VERSION_STRING &quot;\n&quot;
+                ;//                    &quot;TagLib:     %2.%3.%4\n&quot;;
 
-/*            body = body
-                    .arg( TAGLIB_MAJOR_VERSION )
-                    .arg( TAGLIB_MINOR_VERSION )
-                    .arg( TAGLIB_PATCH_VERSION );*/
+        /*            body = body
+                            .arg( TAGLIB_MAJOR_VERSION )
+                            .arg( TAGLIB_MINOR_VERSION )
+                            .arg( TAGLIB_PATCH_VERSION );*/
 
-            #ifdef NDEBUG
-            body += &quot;NDEBUG:     true&quot;;
-            #endif
-            body += &quot;\n&quot;;
+#ifdef NDEBUG
+        body += &quot;NDEBUG:     true&quot;;
+#endif
+        body += &quot;\n&quot;;
 
-            /// obtain the backtrace with gdb
+        /// obtain the backtrace with gdb
 
-            KTemporaryFile temp;
-            temp.setAutoRemove( true );
+        KTemporaryFile temp;
+        temp.setAutoRemove(true);
 
-            const int handle = temp.handle();
+        const int handle = temp.handle();
 
 //             QCString gdb_command_string =
 //                     &quot;file amarokapp\n&quot;
@@ -120,109 +120,107 @@
 //                     &quot;bt\n&quot; &quot;echo \\n\n&quot;
 //                     &quot;thread apply all bt\n&quot;;
 
-            const QByteArray gdb_batch =
-                    &quot;bt\n&quot;
-                    &quot;echo \\n\\n\n&quot;
-                    &quot;bt full\n&quot;
-                    &quot;echo \\n\\n\n&quot;
-                    &quot;echo ==== (gdb) thread apply all bt ====\\n\n&quot;
-                    &quot;thread apply all bt\n&quot;;
-
-            ::write( handle, gdb_batch, gdb_batch.length() );
-            ::fsync( handle );
-
-            // so we can read stderr too
-            ::dup2( fileno( stdout ), fileno( stderr ) );
-
-
-            QByteArray gdb;
-            gdb  = &quot;gdb --nw -n --batch -x &quot;;
-            gdb += temp.fileName().toLatin1();
-            gdb += &quot; basket &quot;;
-            gdb += QByteArray().setNum( ::getppid() );
-
-            QString bt = runCommand( gdb );
-
-            /// clean up
-            bt.remove( &quot;(no debugging symbols found)...&quot; );
-            bt.remove( &quot;(no debugging symbols found)\n&quot; );
-            bt.replace( QRegExp(&quot;\n{2,}&quot;), &quot;\n&quot; ); //clean up multiple \n characters
-            bt.trimmed();
-
-            /// analyze usefulness
-            bool useful = true;
-            const QString fileCommandOutput = runCommand( &quot;file `which basket`&quot; );
-
-            if( fileCommandOutput.indexOf(&quot;not stripped&quot;) == -1 )
-                subject += &quot;[___stripped]&quot;; //same length as below
-            else
-                subject += &quot;[NOTstripped]&quot;;
-
-            if( !bt.isEmpty() ) {
-                const int invalidFrames = bt.count( QRegExp(&quot;\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?&quot;) );
-                const int validFrames = bt.count( QRegExp(&quot;\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]&quot;) );
-                const int totalFrames = invalidFrames + validFrames;
-
-                if( totalFrames &gt; 0 ) {
-                    const double validity = double(validFrames) / totalFrames;
-                    subject += QString(&quot;[validity: %1]&quot;).arg( validity, 0, 'f', 2 );
-                    if( validity &lt;= 0.5 ) useful = false;
-                }
-                subject += QString(&quot;[frames: %1]&quot;).arg( totalFrames, 3 /*padding*/ );
-
-                if( bt.indexOf( QRegExp(&quot; at \\w*\\.cpp:\\d+\n&quot;) ) != -1 )
-                    subject += &quot;[line numbers]&quot;;
+        const QByteArray gdb_batch =
+            &quot;bt\n&quot;
+            &quot;echo \\n\\n\n&quot;
+            &quot;bt full\n&quot;
+            &quot;echo \\n\\n\n&quot;
+            &quot;echo ==== (gdb) thread apply all bt ====\\n\n&quot;
+            &quot;thread apply all bt\n&quot;;
+
+        ::write(handle, gdb_batch, gdb_batch.length());
+        ::fsync(handle);
+
+        // so we can read stderr too
+        ::dup2(fileno(stdout), fileno(stderr));
+
+
+        QByteArray gdb;
+        gdb  = &quot;gdb --nw -n --batch -x &quot;;
+        gdb += temp.fileName().toLatin1();
+        gdb += &quot; basket &quot;;
+        gdb += QByteArray().setNum(::getppid());
+
+        QString bt = runCommand(gdb);
+
+        /// clean up
+        bt.remove(&quot;(no debugging symbols found)...&quot;);
+        bt.remove(&quot;(no debugging symbols found)\n&quot;);
+        bt.replace(QRegExp(&quot;\n{2,}&quot;), &quot;\n&quot;);   //clean up multiple \n characters
+        bt.trimmed();
+
+        /// analyze usefulness
+        bool useful = true;
+        const QString fileCommandOutput = runCommand(&quot;file `which basket`&quot;);
+
+        if (fileCommandOutput.indexOf(&quot;not stripped&quot;) == -1)
+            subject += &quot;[___stripped]&quot;; //same length as below
+        else
+            subject += &quot;[NOTstripped]&quot;;
+
+        if (!bt.isEmpty()) {
+            const int invalidFrames = bt.count(QRegExp(&quot;\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?&quot;));
+            const int validFrames = bt.count(QRegExp(&quot;\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]&quot;));
+            const int totalFrames = invalidFrames + validFrames;
+
+            if (totalFrames &gt; 0) {
+                const double validity = double(validFrames) / totalFrames;
+                subject += QString(&quot;[validity: %1]&quot;).arg(validity, 0, 'f', 2);
+                if (validity &lt;= 0.5) useful = false;
             }
-            else
-                useful = false;
+            subject += QString(&quot;[frames: %1]&quot;).arg(totalFrames, 3 /*padding*/);
+
+            if (bt.indexOf(QRegExp(&quot; at \\w*\\.cpp:\\d+\n&quot;)) != -1)
+                subject += &quot;[line numbers]&quot;;
+        } else
+            useful = false;
 
 //            subject += QString(&quot;[%1]&quot;).arg( AmarokConfig::soundSystem().remove( QRegExp(&quot;-?engine&quot;) ) );
 
 //            debug() &lt;&lt; subject &lt;&lt; endl;
 
 
-            //TODO -fomit-frame-pointer buggers up the backtrace, so detect it
-            //TODO -O optimization can rearrange execution and stuff so show a warning for the developer
-            //TODO pass the CXXFLAGS used with the email
+        //TODO -fomit-frame-pointer buggers up the backtrace, so detect it
+        //TODO -O optimization can rearrange execution and stuff so show a warning for the developer
+        //TODO pass the CXXFLAGS used with the email
 
-            if( useful ) {
-                body += &quot;==== file `which basket` ==========\n&quot;;
-                body += fileCommandOutput + &quot;\n&quot;;
-                body += &quot;==== (gdb) bt =====================\n&quot;;
-				body += bt;//+ &quot;\n\n&quot;;
+        if (useful) {
+            body += &quot;==== file `which basket` ==========\n&quot;;
+            body += fileCommandOutput + &quot;\n&quot;;
+            body += &quot;==== (gdb) bt =====================\n&quot;;
+            body += bt;//+ &quot;\n\n&quot;;
 //                body += &quot;==== kBacktrace() ================\n&quot;;
 //                body += kBacktrace();
 
-                //TODO startup notification
-                KToolInvocation::invokeMailer(
-                        /*to*/          &quot;kelvie@ieee.org&quot;,
-                        /*cc*/          QString(),
-                        /*bcc*/         QString(),
-                        /*subject*/     subject,
-                        /*body*/        body,
-                        /*messageFile*/ QString(),
-                        /*attachURLs*/  QStringList(),
-                        /*startup_id*/  &quot;&quot; );
-            }
-            else {
-				kDebug() &lt;&lt; &quot;\n&quot; + i18n( &quot;%1 has crashed! We're sorry about this.\n\n&quot;
-                                          &quot;But, all is not lost! Perhaps an upgrade is already available &quot;
-                                          &quot;which fixes the problem. Please check your distribution's software repository.&quot;,
-						KGlobal::mainComponent().aboutData()-&gt;programName());
-            }
-
-            //_exit() exits immediately, otherwise this
-            //function is called repeatedly ad finitum
-            ::_exit( 255 );
+            //TODO startup notification
+            KToolInvocation::invokeMailer(
+                /*to*/          &quot;kelvie@ieee.org&quot;,
+                /*cc*/          QString(),
+                /*bcc*/         QString(),
+                /*subject*/     subject,
+                /*body*/        body,
+                /*messageFile*/ QString(),
+                /*attachURLs*/  QStringList(),
+                /*startup_id*/  &quot;&quot;);
+        } else {
+            kDebug() &lt;&lt; &quot;\n&quot; + i18n(&quot;%1 has crashed! We're sorry about this.\n\n&quot;
+                                    &quot;But, all is not lost! Perhaps an upgrade is already available &quot;
+                                    &quot;which fixes the problem. Please check your distribution's software repository.&quot;,
+                                    KGlobal::mainComponent().aboutData()-&gt;programName());
         }
 
-        else {
-            // we are the process that crashed
+        //_exit() exits immediately, otherwise this
+        //function is called repeatedly ad finitum
+        ::_exit(255);
+    }
+
+    else {
+        // we are the process that crashed
 
-            ::alarm( 0 );
+        ::alarm(0);
 
-            // wait for child to exit
-            ::waitpid( pid, NULL, 0 );
-            ::_exit( 253 );
-        }
+        // wait for child to exit
+        ::waitpid(pid, NULL, 0);
+        ::_exit(253);
     }
+}</diff>
      <filename>src/crashhandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -15,17 +15,17 @@
 
 #include &lt;kcrash.h&gt; //for main.cpp
 
-    /**
-     * @author Max Howell
-     * @short The amaroK crash-handler
-     *
-     * I'm not entirely sure why this had to be inside a class, but it
-     * wouldn't work otherwise *shrug*
-     */
-    class Crash
-    {
-    public:
-        static void crashHandler( int signal );
-    };
+/**
+ * @author Max Howell
+ * @short The amaroK crash-handler
+ *
+ * I'm not entirely sure why this had to be inside a class, but it
+ * wouldn't work otherwise *shrug*
+ */
+class Crash
+{
+public:
+    static void crashHandler(int signal);
+};
 
 #endif</diff>
      <filename>src/crashhandler.h</filename>
    </modified>
    <modified>
      <diff>@@ -31,45 +31,45 @@
 #include &quot;debugwindow.h&quot;
 
 DebugWindow::DebugWindow(QWidget *parent)
- : QWidget(parent)
+        : QWidget(parent)
 {
-	Global::debugWindow = this;
-	setWindowTitle(i18n(&quot;Debug Window&quot;));
+    Global::debugWindow = this;
+    setWindowTitle(i18n(&quot;Debug Window&quot;));
 
-	layout      = new QVBoxLayout(this);
-	textBrowser = new QTextBrowser(this);
+    layout      = new QVBoxLayout(this);
+    textBrowser = new QTextBrowser(this);
 
-	textBrowser-&gt;setWordWrapMode(QTextOption::NoWrap);
+    textBrowser-&gt;setWordWrapMode(QTextOption::NoWrap);
 
-	layout-&gt;addWidget(textBrowser);
-	textBrowser-&gt;show();
+    layout-&gt;addWidget(textBrowser);
+    textBrowser-&gt;show();
 }
 
 DebugWindow::~DebugWindow()
 {
-	delete textBrowser;
-	delete layout;
+    delete textBrowser;
+    delete layout;
 }
 
 void DebugWindow::postMessage(const QString msg)
 {
-	textBrowser-&gt;append(msg);
+    textBrowser-&gt;append(msg);
 }
 
 DebugWindow&amp; DebugWindow::operator&lt;&lt;(const QString msg)
 {
-	textBrowser-&gt;append(msg);
-	return *this;
+    textBrowser-&gt;append(msg);
+    return *this;
 }
 
 void DebugWindow::insertHLine()
 {
-	textBrowser-&gt;append(&quot;&lt;hr&gt;&quot;);
+    textBrowser-&gt;append(&quot;&lt;hr&gt;&quot;);
 }
 
 void DebugWindow::closeEvent(QCloseEvent *event)
 {
-	Global::debugWindow = 0L;
-	QWidget::closeEvent(event);
+    Global::debugWindow = 0L;
+    QWidget::closeEvent(event);
 }
 </diff>
      <filename>src/debugwindow.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -35,21 +35,22 @@ class QCloseEvent;
   *@author S&#233;bastien Lao&#251;t
   */
 
-class DebugWindow : public QWidget  {
-  Q_OBJECT
-  public:
-	/** Construtor and destructor */
-	DebugWindow(QWidget *parent = 0);
-	~DebugWindow();
-	/** Methods to post a message to the debug window */
-	void postMessage(const QString msg);
-	DebugWindow&amp; operator&lt;&lt;(const QString msg);
-	void insertHLine();
-  protected:
-	virtual void closeEvent(QCloseEvent *event);
-  private:
-	QVBoxLayout  *layout;
-	QTextBrowser *textBrowser;
+class DebugWindow : public QWidget
+{
+    Q_OBJECT
+public:
+    /** Construtor and destructor */
+    DebugWindow(QWidget *parent = 0);
+    ~DebugWindow();
+    /** Methods to post a message to the debug window */
+    void postMessage(const QString msg);
+    DebugWindow&amp; operator&lt;&lt;(const QString msg);
+    void insertHLine();
+protected:
+    virtual void closeEvent(QCloseEvent *event);
+private:
+    QVBoxLayout  *layout;
+    QTextBrowser *textBrowser;
 };
 
 #define DEBUG_WIN if (Global::debugWindow) *Global::debugWindow</diff>
      <filename>src/debugwindow.h</filename>
    </modified>
    <modified>
      <diff>@@ -37,55 +37,55 @@
 #include &quot;global.h&quot;
 
 ExporterDialog::ExporterDialog(Basket *basket, QWidget *parent, const char *name)
-     : KDialog(parent)
-     , m_basket(basket)
+        : KDialog(parent)
+        , m_basket(basket)
 {
-	// Dialog options
-	setObjectName(name);
-	setModal(true);
-	setCaption(i18n(&quot;Export Basket to HTML&quot;));
-	setButtons(Ok | Cancel);
-	setDefaultButton(Ok);
-	showButtonSeparator(true);
-	connect(this, SIGNAL(okClicked()), SLOT(save()));
-
-	KVBox *page  = new KVBox(this);
-	QWidget     *wid  = new QWidget(page);
+    // Dialog options
+    setObjectName(name);
+    setModal(true);
+    setCaption(i18n(&quot;Export Basket to HTML&quot;));
+    setButtons(Ok | Cancel);
+    setDefaultButton(Ok);
+    showButtonSeparator(true);
+    connect(this, SIGNAL(okClicked()), SLOT(save()));
+
+    KVBox *page  = new KVBox(this);
+    QWidget     *wid  = new QWidget(page);
     setMainWidget(wid);
-	//QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
-	QHBoxLayout *hLay = new QHBoxLayout(wid);
-	m_url = new KUrlRequester(KUrl(&quot;&quot;), wid);
-	m_url-&gt;setWindowTitle(i18n(&quot;HTML Page Filename&quot;));
-	m_url-&gt;setFilter(&quot;text/html&quot;);
-	m_url-&gt;fileDialog()-&gt;setOperationMode(KFileDialog::Saving);
-	QLabel *fileLabel = new QLabel(wid);
-	fileLabel-&gt;setText(i18n(&quot;&amp;Filename:&quot;));
-	fileLabel-&gt;setBuddy(m_url);
-	hLay-&gt;addWidget( fileLabel );
-	hLay-&gt;addWidget( m_url );
-
-	m_embedLinkedFiles    = new QCheckBox(i18n(&quot;&amp;Embed linked local files&quot;),              page);
-	m_embedLinkedFolders  = new QCheckBox(i18n(&quot;Embed &amp;linked local folders&quot;),            page);
-	m_erasePreviousFiles  = new QCheckBox(i18n(&quot;Erase &amp;previous files in target folder&quot;), page);
-	m_formatForImpression = new QCheckBox(i18n(&quot;For&amp;mat for impression&quot;),                 page);
-	m_formatForImpression-&gt;hide();
-
-	load();
-	m_url-&gt;lineEdit()-&gt;setFocus();
-
-	//showTile(true);
-	// Add a stretch at the bottom:
-	// Duplicated code from AddBasketWizard::addStretch(QWidget *parent):
-	(new QWidget(page))-&gt;setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-
-	// Double the width, because the filename should be visible
-	QSize size(sizeHint());
-	resize(QSize(size.width() * 2, size.height()));
-/*
-==========================
-+ [00000000000          ] Progress bar!
-+ newBasket -&gt; name folder as the basket
-*/
+    //QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
+    QHBoxLayout *hLay = new QHBoxLayout(wid);
+    m_url = new KUrlRequester(KUrl(&quot;&quot;), wid);
+    m_url-&gt;setWindowTitle(i18n(&quot;HTML Page Filename&quot;));
+    m_url-&gt;setFilter(&quot;text/html&quot;);
+    m_url-&gt;fileDialog()-&gt;setOperationMode(KFileDialog::Saving);
+    QLabel *fileLabel = new QLabel(wid);
+    fileLabel-&gt;setText(i18n(&quot;&amp;Filename:&quot;));
+    fileLabel-&gt;setBuddy(m_url);
+    hLay-&gt;addWidget(fileLabel);
+    hLay-&gt;addWidget(m_url);
+
+    m_embedLinkedFiles    = new QCheckBox(i18n(&quot;&amp;Embed linked local files&quot;),              page);
+    m_embedLinkedFolders  = new QCheckBox(i18n(&quot;Embed &amp;linked local folders&quot;),            page);
+    m_erasePreviousFiles  = new QCheckBox(i18n(&quot;Erase &amp;previous files in target folder&quot;), page);
+    m_formatForImpression = new QCheckBox(i18n(&quot;For&amp;mat for impression&quot;),                 page);
+    m_formatForImpression-&gt;hide();
+
+    load();
+    m_url-&gt;lineEdit()-&gt;setFocus();
+
+    //showTile(true);
+    // Add a stretch at the bottom:
+    // Duplicated code from AddBasketWizard::addStretch(QWidget *parent):
+    (new QWidget(page))-&gt;setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+    // Double the width, because the filename should be visible
+    QSize size(sizeHint());
+    resize(QSize(size.width() * 2, size.height()));
+    /*
+    ==========================
+    + [00000000000          ] Progress bar!
+    + newBasket -&gt; name folder as the basket
+    */
 }
 
 ExporterDialog::~ExporterDialog()
@@ -94,66 +94,66 @@ ExporterDialog::~ExporterDialog()
 
 void ExporterDialog::show()
 {
-	KDialog::show();
+    KDialog::show();
 
-	QString lineEditText = m_url-&gt;lineEdit()-&gt;text();
-	int selectionStart = lineEditText.lastIndexOf(&quot;/&quot;) + 1;
-	m_url-&gt;lineEdit()-&gt;setSelection(selectionStart, lineEditText.length() - selectionStart - QString(&quot;.html&quot;).length());
+    QString lineEditText = m_url-&gt;lineEdit()-&gt;text();
+    int selectionStart = lineEditText.lastIndexOf(&quot;/&quot;) + 1;
+    m_url-&gt;lineEdit()-&gt;setSelection(selectionStart, lineEditText.length() - selectionStart - QString(&quot;.html&quot;).length());
 }
 
 void ExporterDialog::load()
 {
     KConfigGroup config = Global::config()-&gt;group(&quot;HTML Export&quot;);
 
-	QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
-	QString url = folder + QString(m_basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.html&quot;;
-	m_url-&gt;setUrl(KUrl(url));
+    QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
+    QString url = folder + QString(m_basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.html&quot;;
+    m_url-&gt;setUrl(KUrl(url));
 
-	m_embedLinkedFiles-&gt;setChecked(    config.readEntry(&quot;embedLinkedFiles&quot;,    true)                      );
-	m_embedLinkedFolders-&gt;setChecked(  config.readEntry(&quot;embedLinkedFolders&quot;,  false)                     );
-	m_erasePreviousFiles-&gt;setChecked(  config.readEntry(&quot;erasePreviousFiles&quot;,  true)                      );
-	m_formatForImpression-&gt;setChecked( config.readEntry(&quot;formatForImpression&quot;, false)                     );
+    m_embedLinkedFiles-&gt;setChecked(config.readEntry(&quot;embedLinkedFiles&quot;,    true));
+    m_embedLinkedFolders-&gt;setChecked(config.readEntry(&quot;embedLinkedFolders&quot;,  false));
+    m_erasePreviousFiles-&gt;setChecked(config.readEntry(&quot;erasePreviousFiles&quot;,  true));
+    m_formatForImpression-&gt;setChecked(config.readEntry(&quot;formatForImpression&quot;, false));
 }
 
 void ExporterDialog::save()
 {
     KConfigGroup config = Global::config()-&gt;group(&quot;HTML Export&quot;);
 
-	QString folder = KUrl(m_url-&gt;url()).directory();
-	config.writeEntry( &quot;lastFolder&quot;,          folder                             );
-	config.writeEntry( &quot;embedLinkedFiles&quot;,    m_embedLinkedFiles-&gt;isChecked()    );
-	config.writeEntry( &quot;embedLinkedFolders&quot;,  m_embedLinkedFolders-&gt;isChecked()  );
-	config.writeEntry( &quot;erasePreviousFiles&quot;,  m_erasePreviousFiles-&gt;isChecked()  );
-	config.writeEntry( &quot;formatForImpression&quot;, m_formatForImpression-&gt;isChecked() );
+    QString folder = KUrl(m_url-&gt;url()).directory();
+    config.writeEntry(&quot;lastFolder&quot;,          folder);
+    config.writeEntry(&quot;embedLinkedFiles&quot;,    m_embedLinkedFiles-&gt;isChecked());
+    config.writeEntry(&quot;embedLinkedFolders&quot;,  m_embedLinkedFolders-&gt;isChecked());
+    config.writeEntry(&quot;erasePreviousFiles&quot;,  m_erasePreviousFiles-&gt;isChecked());
+    config.writeEntry(&quot;formatForImpression&quot;, m_formatForImpression-&gt;isChecked());
 }
 
 void ExporterDialog::accept()
 {
-	save();
+    save();
 }
 
 QString ExporterDialog::filePath()
 {
-	return m_url-&gt;url().url();
+    return m_url-&gt;url().url();
 }
 
 bool ExporterDialog::embedLinkedFiles()
 {
-	return m_embedLinkedFiles-&gt;isChecked();
+    return m_embedLinkedFiles-&gt;isChecked();
 }
 
 bool ExporterDialog::embedLinkedFolders()
 {
-	return m_embedLinkedFolders-&gt;isChecked();
+    return m_embedLinkedFolders-&gt;isChecked();
 }
 
 bool ExporterDialog::erasePreviousFiles()
 {
-	return m_erasePreviousFiles-&gt;isChecked();
+    return m_erasePreviousFiles-&gt;isChecked();
 }
 
 bool ExporterDialog::formatForImpression()
 {
-	return m_formatForImpression-&gt;isChecked();
+    return m_formatForImpression-&gt;isChecked();
 }
 </diff>
      <filename>src/exporterdialog.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -34,28 +34,28 @@ class Basket;
   */
 class ExporterDialog : public KDialog
 {
-  Q_OBJECT
-  public:
-	ExporterDialog(Basket *basket, QWidget *parent = 0, const char *name = 0);
-	~ExporterDialog();
-	QString filePath();
-	bool    embedLinkedFiles();
-	bool    embedLinkedFolders();
-	bool    erasePreviousFiles();
-	bool    formatForImpression();
-	void show();
+    Q_OBJECT
+public:
+    ExporterDialog(Basket *basket, QWidget *parent = 0, const char *name = 0);
+    ~ExporterDialog();
+    QString filePath();
+    bool    embedLinkedFiles();
+    bool    embedLinkedFolders();
+    bool    erasePreviousFiles();
+    bool    formatForImpression();
+    void show();
 
-  protected slots:
-	void load();
-	void save();
+protected slots:
+    void load();
+    void save();
     void accept();
-  private:
-	Basket        *m_basket;
-	KUrlRequester *m_url;
-	QCheckBox     *m_embedLinkedFiles;
-	QCheckBox     *m_embedLinkedFolders;
-	QCheckBox     *m_erasePreviousFiles;
-	QCheckBox     *m_formatForImpression;
+private:
+    Basket        *m_basket;
+    KUrlRequester *m_url;
+    QCheckBox     *m_embedLinkedFiles;
+    QCheckBox     *m_embedLinkedFolders;
+    QCheckBox     *m_erasePreviousFiles;
+    QCheckBox     *m_formatForImpression;
 };
 
 #endif // EXPORTERDIALOG_H</diff>
      <filename>src/exporterdialog.h</filename>
    </modified>
    <modified>
      <diff>@@ -48,72 +48,72 @@
 /** FilterBar */
 
 FilterBar::FilterBar(QWidget *parent)
- : QWidget(parent)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
+        : QWidget(parent)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
 {
-	QHBoxLayout *hBox  = new QHBoxLayout(this);
-
-	// Create every widgets:
-	// (Aaron Seigo says we don't need to worry about the 
-	//	&quot;Toolbar group&quot; stuff anymore.)
-	
-	QIcon resetIcon = KIcon(&quot;dialog-close&quot;, KIconLoader::global());
-	QIcon inAllIcon = KIcon(&quot;edit-find&quot;, KIconLoader::global());
-
-	m_resetButton        = new QToolButton(this);
-	m_resetButton-&gt;setIcon(resetIcon);
-	m_resetButton-&gt;setText(i18n(&quot;Reset Filter&quot;));//, /*groupText=*/&quot;&quot;, this, SLOT(reset()), 0);
-	m_resetButton-&gt;setAutoRaise(true);
-			//new KToolBarButton(&quot;locationbar_erase&quot;, /*id=*/1230, this, /*name=*/0, i18n(&quot;Reset Filter&quot;));
-	m_lineEdit = new KLineEdit(this);
-	QLabel *label = new QLabel(this);
-	label-&gt;setText(i18n(&quot;&amp;Filter: &quot;));
-	label-&gt;setBuddy(m_lineEdit);
-	m_tagsBox = new KComboBox(this);
-	QLabel *label2 = new QLabel(this);
-	label2-&gt;setText(i18n(&quot;T&amp;ag: &quot;));
-	label2-&gt;setBuddy(m_tagsBox);
-	m_inAllBasketsButton = new QToolButton(this);
-	m_inAllBasketsButton-&gt;setIcon(inAllIcon);
-	m_inAllBasketsButton-&gt;setText(i18n(&quot;Filter All Baskets&quot;));//, /*groupText=*/&quot;&quot;, this, SLOT(inAllBaskets()), 0);
-	m_inAllBasketsButton-&gt;setAutoRaise(true);
-
-	// Configure the Tags combobox:
-	repopulateTagsCombo();
-
-	// Configure the Search in all Baskets button:
-	m_inAllBasketsButton-&gt;setCheckable(true);
-//	m_inAllBasketsButton-&gt;setChecked(true);
-//	Global::bnpView-&gt;toggleFilterAllBaskets(true);
-
-//	m_lineEdit-&gt;setMaximumWidth(150);
-	m_lineEdit-&gt;setClearButtonShown(true);
-
-	// Layout all those widgets:
-//	hBox-&gt;addStretch();
-	hBox-&gt;addWidget(m_resetButton);
-	hBox-&gt;addSpacing(KDialog::spacingHint());
-	hBox-&gt;addWidget(label);
-	hBox-&gt;addWidget(m_lineEdit);
-	hBox-&gt;addSpacing(KDialog::spacingHint());
-	hBox-&gt;addWidget(label2);
-	hBox-&gt;addWidget(m_tagsBox);
-	hBox-&gt;addSpacing(KDialog::spacingHint());
-	hBox-&gt;addWidget(m_inAllBasketsButton);
-
-	m_data = new FilterData(); // TODO: Not a pointer! and return a const &amp;  !!
-
-//	connect( &amp;m_blinkTimer,         SIGNAL(timeout()),                   this, SLOT(blinkBar())                  );
-	connect(  m_resetButton,        SIGNAL(clicked()),                   this, SLOT(reset())                     );
-	connect(  m_lineEdit,           SIGNAL(textChanged(const QString&amp;)), this, SLOT(changeFilter()) );
-	connect(  m_tagsBox,            SIGNAL(activated(int)),              this, SLOT(tagChanged(int))             );
-
-//	connect(  m_inAllBasketsButton, SIGNAL(clicked()),                   this, SLOT(inAllBaskets())              );
-	connect(  m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)) );
-
-	FocusWidgetFilter *lineEditF = new FocusWidgetFilter(m_lineEdit);
-	m_tagsBox-&gt;installEventFilter(lineEditF);
-	connect(lineEditF, SIGNAL(escapePressed()), SLOT(reset()));
-	connect(lineEditF, SIGNAL(returnPressed()), SLOT(changeFilter()));
+    QHBoxLayout *hBox  = new QHBoxLayout(this);
+
+    // Create every widgets:
+    // (Aaron Seigo says we don't need to worry about the
+    //  &quot;Toolbar group&quot; stuff anymore.)
+
+    QIcon resetIcon = KIcon(&quot;dialog-close&quot;, KIconLoader::global());
+    QIcon inAllIcon = KIcon(&quot;edit-find&quot;, KIconLoader::global());
+
+    m_resetButton        = new QToolButton(this);
+    m_resetButton-&gt;setIcon(resetIcon);
+    m_resetButton-&gt;setText(i18n(&quot;Reset Filter&quot;));//, /*groupText=*/&quot;&quot;, this, SLOT(reset()), 0);
+    m_resetButton-&gt;setAutoRaise(true);
+    //new KToolBarButton(&quot;locationbar_erase&quot;, /*id=*/1230, this, /*name=*/0, i18n(&quot;Reset Filter&quot;));
+    m_lineEdit = new KLineEdit(this);
+    QLabel *label = new QLabel(this);
+    label-&gt;setText(i18n(&quot;&amp;Filter: &quot;));
+    label-&gt;setBuddy(m_lineEdit);
+    m_tagsBox = new KComboBox(this);
+    QLabel *label2 = new QLabel(this);
+    label2-&gt;setText(i18n(&quot;T&amp;ag: &quot;));
+    label2-&gt;setBuddy(m_tagsBox);
+    m_inAllBasketsButton = new QToolButton(this);
+    m_inAllBasketsButton-&gt;setIcon(inAllIcon);
+    m_inAllBasketsButton-&gt;setText(i18n(&quot;Filter All Baskets&quot;));//, /*groupText=*/&quot;&quot;, this, SLOT(inAllBaskets()), 0);
+    m_inAllBasketsButton-&gt;setAutoRaise(true);
+
+    // Configure the Tags combobox:
+    repopulateTagsCombo();
+
+    // Configure the Search in all Baskets button:
+    m_inAllBasketsButton-&gt;setCheckable(true);
+//  m_inAllBasketsButton-&gt;setChecked(true);
+//  Global::bnpView-&gt;toggleFilterAllBaskets(true);
+
+//  m_lineEdit-&gt;setMaximumWidth(150);
+    m_lineEdit-&gt;setClearButtonShown(true);
+
+    // Layout all those widgets:
+//  hBox-&gt;addStretch();
+    hBox-&gt;addWidget(m_resetButton);
+    hBox-&gt;addSpacing(KDialog::spacingHint());
+    hBox-&gt;addWidget(label);
+    hBox-&gt;addWidget(m_lineEdit);
+    hBox-&gt;addSpacing(KDialog::spacingHint());
+    hBox-&gt;addWidget(label2);
+    hBox-&gt;addWidget(m_tagsBox);
+    hBox-&gt;addSpacing(KDialog::spacingHint());
+    hBox-&gt;addWidget(m_inAllBasketsButton);
+
+    m_data = new FilterData(); // TODO: Not a pointer! and return a const &amp;  !!
+
+//  connect( &amp;m_blinkTimer,         SIGNAL(timeout()),                   this, SLOT(blinkBar())                  );
+    connect(m_resetButton,        SIGNAL(clicked()),                   this, SLOT(reset()));
+    connect(m_lineEdit,           SIGNAL(textChanged(const QString&amp;)), this, SLOT(changeFilter()));
+    connect(m_tagsBox,            SIGNAL(activated(int)),              this, SLOT(tagChanged(int)));
+
+//  connect(  m_inAllBasketsButton, SIGNAL(clicked()),                   this, SLOT(inAllBaskets())              );
+    connect(m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)));
+
+    FocusWidgetFilter *lineEditF = new FocusWidgetFilter(m_lineEdit);
+    m_tagsBox-&gt;installEventFilter(lineEditF);
+    connect(lineEditF, SIGNAL(escapePressed()), SLOT(reset()));
+    connect(lineEditF, SIGNAL(returnPressed()), SLOT(changeFilter()));
 }
 
 FilterBar::~FilterBar()
@@ -122,204 +122,204 @@ FilterBar::~FilterBar()
 
 void FilterBar::setFilterAll(bool filterAll)
 {
-	m_inAllBasketsButton-&gt;setChecked(filterAll);
+    m_inAllBasketsButton-&gt;setChecked(filterAll);
 }
 
 void FilterBar::setFilterData(const FilterData &amp;data)
 {
-	m_lineEdit-&gt;setText(data.string);
-
-	int index = 0;
-	switch (data.tagFilterType) {
-		default:
-		case FilterData::DontCareTagsFilter: index = 0; break;
-		case FilterData::NotTaggedFilter:    index = 1; break;
-		case FilterData::TaggedFilter:       index = 2; break;
-		case FilterData::TagFilter:          filterTag(data.tag);     return;
-		case FilterData::StateFilter:        filterState(data.state); return;
-	}
-
-	if (m_tagsBox-&gt;currentIndex() != index) {
-		m_tagsBox-&gt;setCurrentIndex(index);
-		tagChanged(index);
-	}
+    m_lineEdit-&gt;setText(data.string);
+
+    int index = 0;
+    switch (data.tagFilterType) {
+    default:
+    case FilterData::DontCareTagsFilter: index = 0; break;
+    case FilterData::NotTaggedFilter:    index = 1; break;
+    case FilterData::TaggedFilter:       index = 2; break;
+    case FilterData::TagFilter:          filterTag(data.tag);     return;
+    case FilterData::StateFilter:        filterState(data.state); return;
+    }
+
+    if (m_tagsBox-&gt;currentIndex() != index) {
+        m_tagsBox-&gt;setCurrentIndex(index);
+        tagChanged(index);
+    }
 }
 
 void FilterBar::repopulateTagsCombo()
 {
-	static const int ICON_SIZE = 16;
-
-	m_tagsBox-&gt;clear();
-	m_tagsMap.clear();
-	m_statesMap.clear();
-
-	m_tagsBox-&gt;addItem(&quot;&quot;);
-	m_tagsBox-&gt;addItem(i18n(&quot;(Not tagged)&quot;));
-	m_tagsBox-&gt;addItem(i18n(&quot;(Tagged)&quot;));
-
-	int index = 3;
-	Tag     *tag;
-	State   *state;
-	QString  icon;
-	QString  text;
-	QPixmap  emblem;
-	for (Tag::List::iterator it = Tag::all.begin(); it != Tag::all.end(); ++it) {
-		tag   = *it;
-		state = tag-&gt;states().first();
-		// Insert the tag in the combo-box:
-		if (tag-&gt;countStates() &gt; 1) {
-			text = tag-&gt;name();
-			icon = &quot;&quot;;
-		} else {
-			text = state-&gt;name();
-			icon = state-&gt;emblem();
-		}
-		emblem = KIconLoader::global()-&gt;loadIcon(
-            icon, KIconLoader::Desktop, ICON_SIZE, KIconLoader::DefaultState,
-            QStringList(), 0L, /*canReturnNull=*/true
-            );
-		m_tagsBox-&gt;insertItem(index, emblem, text);
-		// Update the mapping:
-		m_tagsMap.insert(index, tag);
-		++index;
-		// Insert sub-states, if needed:
-		if (tag-&gt;countStates() &gt; 1) {
-			for (State::List::iterator it2 = tag-&gt;states().begin(); it2 != tag-&gt;states().end(); ++it2) {
-				state = *it2;
-				// Insert the state:
-				text = state-&gt;name();
-				icon = state-&gt;emblem();
-				emblem = KIconLoader::global()-&gt;loadIcon(
-                    icon, KIconLoader::Desktop, ICON_SIZE,
-                    KIconLoader::DefaultState, QStringList(), 0L,
-                    /*canReturnNull=*/true
-                    );
-				// Indent the emblem to show the hierarchy relation:
-				if (!emblem.isNull())
-					emblem = Tools::indentPixmap(emblem, /*depth=*/1, /*deltaX=*/2 * ICON_SIZE / 3);
-				m_tagsBox-&gt;insertItem(index, emblem, text);
-				// Update the mapping:
-				m_statesMap.insert(index, state);
-				++index;
-			}
-		}
-	}
+    static const int ICON_SIZE = 16;
+
+    m_tagsBox-&gt;clear();
+    m_tagsMap.clear();
+    m_statesMap.clear();
+
+    m_tagsBox-&gt;addItem(&quot;&quot;);
+    m_tagsBox-&gt;addItem(i18n(&quot;(Not tagged)&quot;));
+    m_tagsBox-&gt;addItem(i18n(&quot;(Tagged)&quot;));
+
+    int index = 3;
+    Tag     *tag;
+    State   *state;
+    QString  icon;
+    QString  text;
+    QPixmap  emblem;
+    for (Tag::List::iterator it = Tag::all.begin(); it != Tag::all.end(); ++it) {
+        tag   = *it;
+        state = tag-&gt;states().first();
+        // Insert the tag in the combo-box:
+        if (tag-&gt;countStates() &gt; 1) {
+            text = tag-&gt;name();
+            icon = &quot;&quot;;
+        } else {
+            text = state-&gt;name();
+            icon = state-&gt;emblem();
+        }
+        emblem = KIconLoader::global()-&gt;loadIcon(
+                     icon, KIconLoader::Desktop, ICON_SIZE, KIconLoader::DefaultState,
+                     QStringList(), 0L, /*canReturnNull=*/true
+                 );
+        m_tagsBox-&gt;insertItem(index, emblem, text);
+        // Update the mapping:
+        m_tagsMap.insert(index, tag);
+        ++index;
+        // Insert sub-states, if needed:
+        if (tag-&gt;countStates() &gt; 1) {
+            for (State::List::iterator it2 = tag-&gt;states().begin(); it2 != tag-&gt;states().end(); ++it2) {
+                state = *it2;
+                // Insert the state:
+                text = state-&gt;name();
+                icon = state-&gt;emblem();
+                emblem = KIconLoader::global()-&gt;loadIcon(
+                             icon, KIconLoader::Desktop, ICON_SIZE,
+                             KIconLoader::DefaultState, QStringList(), 0L,
+                             /*canReturnNull=*/true
+                         );
+                // Indent the emblem to show the hierarchy relation:
+                if (!emblem.isNull())
+                    emblem = Tools::indentPixmap(emblem, /*depth=*/1, /*deltaX=*/2 * ICON_SIZE / 3);
+                m_tagsBox-&gt;insertItem(index, emblem, text);
+                // Update the mapping:
+                m_statesMap.insert(index, state);
+                ++index;
+            }
+        }
+    }
 }
 
 void FilterBar::reset()
 {
-	m_lineEdit-&gt;setText(&quot;&quot;); // m_data-&gt;isFiltering will be set to false;
-	m_lineEdit-&gt;clearFocus();
-	changeFilter();
-	if (m_tagsBox-&gt;currentIndex() != 0) {
-		m_tagsBox-&gt;setCurrentIndex(0);
-		tagChanged(0);
-	}
-	hide();
-	emit newFilter(*m_data);
+    m_lineEdit-&gt;setText(&quot;&quot;); // m_data-&gt;isFiltering will be set to false;
+    m_lineEdit-&gt;clearFocus();
+    changeFilter();
+    if (m_tagsBox-&gt;currentIndex() != 0) {
+        m_tagsBox-&gt;setCurrentIndex(0);
+        tagChanged(0);
+    }
+    hide();
+    emit newFilter(*m_data);
 }
 
 void FilterBar::filterTag(Tag *tag)
 {
-	int index = 0;
-
-	for (QMap&lt;int, Tag*&gt;::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it)
-		if (it.value() == tag) {
-			index = it.key();
-			break;
-		}
-	if (index &lt;= 0)
-		return;
-
-	if (m_tagsBox-&gt;currentIndex() != index) {
-		m_tagsBox-&gt;setCurrentIndex(index);
-		tagChanged(index);
-	}
+    int index = 0;
+
+    for (QMap&lt;int, Tag*&gt;::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it)
+        if (it.value() == tag) {
+            index = it.key();
+            break;
+        }
+    if (index &lt;= 0)
+        return;
+
+    if (m_tagsBox-&gt;currentIndex() != index) {
+        m_tagsBox-&gt;setCurrentIndex(index);
+        tagChanged(index);
+    }
 }
 
 void FilterBar::filterState(State *state)
 {
-	int index = 0;
-
-	for (QMap&lt;int, State*&gt;::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it)
-		if (it.value() == state) {
-			index = it.key();
-			break;
-		}
-	if (index &lt;= 0)
-		return;
-
-	if (m_tagsBox-&gt;currentIndex() != index) {
-		m_tagsBox-&gt;setCurrentIndex(index);
-		tagChanged(index);
-	}
+    int index = 0;
+
+    for (QMap&lt;int, State*&gt;::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it)
+        if (it.value() == state) {
+            index = it.key();
+            break;
+        }
+    if (index &lt;= 0)
+        return;
+
+    if (m_tagsBox-&gt;currentIndex() != index) {
+        m_tagsBox-&gt;setCurrentIndex(index);
+        tagChanged(index);
+    }
 }
 
 void FilterBar::inAllBaskets()
 {
-	// TODO!
+    // TODO!
 }
 
 void FilterBar::setEditFocus()
 {
-	m_lineEdit-&gt;setFocus();
+    m_lineEdit-&gt;setFocus();
 }
 
 bool FilterBar::hasEditFocus()
 {
-	return m_lineEdit-&gt;hasFocus() || m_tagsBox-&gt;hasFocus();
+    return m_lineEdit-&gt;hasFocus() || m_tagsBox-&gt;hasFocus();
 }
 
 const FilterData&amp; FilterBar::filterData()
 {
-	return *m_data;
+    return *m_data;
 }
 
 void FilterBar::changeFilter()
 {
-	m_data-&gt;string = m_lineEdit-&gt;text();
-	m_data-&gt;isFiltering = (!m_data-&gt;string.isEmpty() || m_data-&gt;tagFilterType != FilterData::DontCareTagsFilter);
-	if (hasEditFocus())
-		m_data-&gt;isFiltering = true;
-	emit newFilter(*m_data);
+    m_data-&gt;string = m_lineEdit-&gt;text();
+    m_data-&gt;isFiltering = (!m_data-&gt;string.isEmpty() || m_data-&gt;tagFilterType != FilterData::DontCareTagsFilter);
+    if (hasEditFocus())
+        m_data-&gt;isFiltering = true;
+    emit newFilter(*m_data);
 }
 
 void FilterBar::tagChanged(int index)
 {
-	m_data-&gt;tag   = 0;
-	m_data-&gt;state = 0;
-	switch (index) {
-		case 0:
-			m_data-&gt;tagFilterType = FilterData::DontCareTagsFilter;
-			break;
-		case 1:
-			m_data-&gt;tagFilterType = FilterData::NotTaggedFilter;
-			break;
-		case 2:
-			m_data-&gt;tagFilterType = FilterData::TaggedFilter;
-			break;
-		default:
-			// Try to find if we are filtering a tag:
-			QMap&lt;int, Tag*&gt;::iterator it = m_tagsMap.find(index);
-			if (it != m_tagsMap.end()) {
-				m_data-&gt;tagFilterType = FilterData::TagFilter;
-				m_data-&gt;tag           = *it;
-			} else {
-				// If not, try to find if we are filtering a state:
-				QMap&lt;int, State*&gt;::iterator it2 = m_statesMap.find(index);
-				if (it2 != m_statesMap.end()) {
-					m_data-&gt;tagFilterType = FilterData::StateFilter;
-					m_data-&gt;state         = *it2;
-				} else {
-					// If not (should never happens), do as if the tags filter was reseted:
-					m_data-&gt;tagFilterType = FilterData::DontCareTagsFilter;
-				}
-			}
-			break;
-	}
-	m_data-&gt;isFiltering = (!m_data-&gt;string.isEmpty() || m_data-&gt;tagFilterType != FilterData::DontCareTagsFilter);
-	if (hasEditFocus())
-		m_data-&gt;isFiltering = true;
-	emit newFilter(*m_data);
+    m_data-&gt;tag   = 0;
+    m_data-&gt;state = 0;
+    switch (index) {
+    case 0:
+        m_data-&gt;tagFilterType = FilterData::DontCareTagsFilter;
+        break;
+    case 1:
+        m_data-&gt;tagFilterType = FilterData::NotTaggedFilter;
+        break;
+    case 2:
+        m_data-&gt;tagFilterType = FilterData::TaggedFilter;
+        break;
+    default:
+        // Try to find if we are filtering a tag:
+        QMap&lt;int, Tag*&gt;::iterator it = m_tagsMap.find(index);
+        if (it != m_tagsMap.end()) {
+            m_data-&gt;tagFilterType = FilterData::TagFilter;
+            m_data-&gt;tag           = *it;
+        } else {
+            // If not, try to find if we are filtering a state:
+            QMap&lt;int, State*&gt;::iterator it2 = m_statesMap.find(index);
+            if (it2 != m_statesMap.end()) {
+                m_data-&gt;tagFilterType = FilterData::StateFilter;
+                m_data-&gt;state         = *it2;
+            } else {
+                // If not (should never happens), do as if the tags filter was reseted:
+                m_data-&gt;tagFilterType = FilterData::DontCareTagsFilter;
+            }
+        }
+        break;
+    }
+    m_data-&gt;isFiltering = (!m_data-&gt;string.isEmpty() || m_data-&gt;tagFilterType != FilterData::DontCareTagsFilter);
+    if (hasEditFocus())
+        m_data-&gt;isFiltering = true;
+    emit newFilter(*m_data);
 }
 </diff>
      <filename>src/filter.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -36,18 +36,20 @@ class State;
   */
 class FilterData
 {
-  public:
-	// Useful Enum for tagFilterType:
-	enum TagFilterType { DontCareTagsFilter = 0, NotTaggedFilter, TaggedFilter, TagFilter, StateFilter };
-	// Constructor and Destructor:
-	FilterData()  { isFiltering = false; tagFilterType = DontCareTagsFilter; tag = 0; state = 0; }
-	~FilterData() {}
-	// Filter data:
-	QString  string;
-	int      tagFilterType;
-	Tag     *tag;
-	State   *state;
-	bool     isFiltering;
+public:
+    // Useful Enum for tagFilterType:
+    enum TagFilterType { DontCareTagsFilter = 0, NotTaggedFilter, TaggedFilter, TagFilter, StateFilter };
+    // Constructor and Destructor:
+    FilterData()  {
+        isFiltering = false; tagFilterType = DontCareTagsFilter; tag = 0; state = 0;
+    }
+    ~FilterData() {}
+    // Filter data:
+    QString  string;
+    int      tagFilterType;
+    Tag     *tag;
+    State   *state;
+    bool     isFiltering;
 };
 
 /** A QWidget that allow user to enter terms to filter in a Basket.
@@ -55,37 +57,39 @@ class FilterData
   */
 class FilterBar : public QWidget
 {
-  Q_OBJECT
-  public:
-	FilterBar(QWidget *parent = 0);
-	~FilterBar();
-	const FilterData&amp; filterData();
-  signals:
-	void newFilter(const FilterData &amp;data);
-  public slots:
-	void repopulateTagsCombo();
-	void reset();
-	void inAllBaskets();
-	void setEditFocus();
-	void filterTag(Tag *tag);
-	void filterState(State *state);
-	void setFilterAll(bool filterAll);
-	void setFilterData(const FilterData &amp;data);
-  public:
-	bool hasEditFocus();
-	KLineEdit* lineEdit() { return m_lineEdit; }
-  private slots:
-	void changeFilter();
-	void tagChanged(int index);
-  private:
-	FilterData      *m_data;
-	KLineEdit *m_lineEdit;
-	QToolButton     *m_resetButton;
-	KComboBox *m_tagsBox;
-	QToolButton     *m_inAllBasketsButton;
+    Q_OBJECT
+public:
+    FilterBar(QWidget *parent = 0);
+    ~FilterBar();
+    const FilterData&amp; filterData();
+signals:
+    void newFilter(const FilterData &amp;data);
+public slots:
+    void repopulateTagsCombo();
+    void reset();
+    void inAllBaskets();
+    void setEditFocus();
+    void filterTag(Tag *tag);
+    void filterState(State *state);
+    void setFilterAll(bool filterAll);
+    void setFilterData(const FilterData &amp;data);
+public:
+    bool hasEditFocus();
+    KLineEdit* lineEdit() {
+        return m_lineEdit;
+    }
+private slots:
+    void changeFilter();
+    void tagChanged(int index);
+private:
+    FilterData      *m_data;
+    KLineEdit *m_lineEdit;
+    QToolButton     *m_resetButton;
+    KComboBox *m_tagsBox;
+    QToolButton     *m_inAllBasketsButton;
 
-	QMap&lt;int, Tag*&gt;   m_tagsMap;
-	QMap&lt;int, State*&gt; m_statesMap;
+    QMap&lt;int, Tag*&gt;   m_tagsMap;
+    QMap&lt;int, State*&gt; m_statesMap;
 };
 
 #endif // FILTER_H</diff>
      <filename>src/filter.h</filename>
    </modified>
    <modified>
      <diff>@@ -36,8 +36,8 @@
 
 FocusedTextEdit::FocusedTextEdit(bool disableUpdatesOnKeyPress,
                                  QWidget *parent)
- : KTextEdit(parent),
-   m_disableUpdatesOnKeyPress(disableUpdatesOnKeyPress)
+        : KTextEdit(parent),
+        m_disableUpdatesOnKeyPress(disableUpdatesOnKeyPress)
 {
     // pass
 }
@@ -60,9 +60,9 @@ void FocusedTextEdit::keyPressEvent(QKeyEvent *event)
 
     // Workaround (for ensuring the cursor to be visible): signal not emited when pressing those keys:
     if (event-&gt;key() == Qt::Key_Home
-        || event-&gt;key() == Qt::Key_End
-        || event-&gt;key() == Qt::Key_PageUp
-        || event-&gt;key() == Qt::Key_PageDown)
+            || event-&gt;key() == Qt::Key_End
+            || event-&gt;key() == Qt::Key_PageUp
+            || event-&gt;key() == Qt::Key_PageDown)
         emit cursorPositionChanged();
 
 
@@ -79,7 +79,7 @@ void FocusedTextEdit::wheelEvent(QWheelEvent *event)
     // wheel event onto the basket.
     QScrollBar *sb = verticalScrollBar();
     if ((event-&gt;delta() &gt; 0 &amp;&amp; sb-&gt;value() &gt; sb-&gt;minimum())
-        || (event-&gt;delta() &lt; 0 &amp;&amp; sb-&gt;value() &lt; sb-&gt;maximum()))
+            || (event-&gt;delta() &lt; 0 &amp;&amp; sb-&gt;value() &lt; sb-&gt;maximum()))
         KTextEdit::wheelEvent(event);
     else
         Global::bnpView-&gt;currentBasket()-&gt;wheelEvent(event);
@@ -87,23 +87,22 @@ void FocusedTextEdit::wheelEvent(QWheelEvent *event)
 
 void FocusedTextEdit::enterEvent(QEvent *event)
 {
-	emit mouseEntered();
-	KTextEdit::enterEvent(event);
+    emit mouseEntered();
+    KTextEdit::enterEvent(event);
 }
 
 /** class FocusWidgetFilter */
 FocusWidgetFilter::FocusWidgetFilter(QWidget *parent)
-  : QObject(parent)
+        : QObject(parent)
 {
     if (parent)
-	parent-&gt;installEventFilter(this);
+        parent-&gt;installEventFilter(this);
 }
 
 bool FocusWidgetFilter::eventFilter(QObject *, QEvent *e)
 {
     switch (e-&gt;type()) {
-    case QEvent::KeyPress:
-    {
+    case QEvent::KeyPress: {
         QKeyEvent *ke = static_cast&lt;QKeyEvent*&gt;(e);
         switch (ke-&gt;key()) {
         case Qt::Key_Return:
@@ -117,9 +116,9 @@ bool FocusWidgetFilter::eventFilter(QObject *, QEvent *e)
         };
     }
     case QEvent::Enter:
-	emit mouseEntered();
-	// pass through
+        emit mouseEntered();
+        // pass through
     default:
-	return false;
+        return false;
     };
 }</diff>
      <filename>src/focusedwidgets.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -37,19 +37,19 @@ class KMenu;
 
 class FocusedTextEdit : public KTextEdit
 {
-  Q_OBJECT
-  public:
-	FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent = 0);
-	~FocusedTextEdit();
-  protected:
-	void keyPressEvent(QKeyEvent *event);
-	void wheelEvent(QWheelEvent *event);
-	void enterEvent(QEvent *event);
-  signals:
-	void escapePressed();
-	void mouseEntered();
-  private:
-	bool m_disableUpdatesOnKeyPress;
+    Q_OBJECT
+public:
+    FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent = 0);
+    ~FocusedTextEdit();
+protected:
+    void keyPressEvent(QKeyEvent *event);
+    void wheelEvent(QWheelEvent *event);
+    void enterEvent(QEvent *event);
+signals:
+    void escapePressed();
+    void mouseEntered();
+private:
+    bool m_disableUpdatesOnKeyPress;
 };
 
 
@@ -73,7 +73,7 @@ public:
     /** Constructor
      * @param watched The widget to install the event filter on; also becomes
      * the parent of this object. */
-    FocusWidgetFilter(QWidget *watched=0);
+    FocusWidgetFilter(QWidget *watched = 0);
     ~FocusWidgetFilter() {}
 
 protected:</diff>
      <filename>src/focusedwidgets.h</filename>
    </modified>
    <modified>
      <diff>@@ -44,267 +44,267 @@
 
 bool FormatImporter::shouldImportBaskets()
 {
-	// We should import if the application have not successfully loaded any basket...
-	if (Global::bnpView-&gt;topLevelItemCount()&gt;=0)
-		return false;
+    // We should import if the application have not successfully loaded any basket...
+    if (Global::bnpView-&gt;topLevelItemCount() &gt;= 0)
+        return false;
 
-	// ... And there is at least one folder in the save folder, with a &quot;.basket&quot; file inside that folder.
-	QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
-	QStringList list = dir.entryList();
-	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
-		if (*it != &quot;.&quot; &amp;&amp; *it != &quot;..&quot; &amp;&amp; dir.exists(Global::savesFolder() + *it + &quot;/.basket&quot;))
-			return true;
+    // ... And there is at least one folder in the save folder, with a &quot;.basket&quot; file inside that folder.
+    QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
+    QStringList list = dir.entryList();
+    for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+        if (*it != &quot;.&quot; &amp;&amp; *it != &quot;..&quot; &amp;&amp; dir.exists(Global::savesFolder() + *it + &quot;/.basket&quot;))
+            return true;
 
-	return false;
+    return false;
 }
 
 void FormatImporter::copyFolder(const QString &amp;folder, const QString &amp;newFolder)
 {
-	copyFinished = false;
-	KIO::CopyJob *copyJob = KIO::copyAs(KUrl(folder), KUrl(newFolder), /*showProgressInfo=*/false);
-	connect(copyJob,  SIGNAL(copyingDone(KIO::Job *, KUrl, KUrl, time_t, bool, bool)),
-		this, SLOT(slotCopyingDone(KIO::Job*)));
-	while (!copyFinished)
-		kapp-&gt;processEvents();
+    copyFinished = false;
+    KIO::CopyJob *copyJob = KIO::copyAs(KUrl(folder), KUrl(newFolder), /*showProgressInfo=*/false);
+    connect(copyJob,  SIGNAL(copyingDone(KIO::Job *, KUrl, KUrl, time_t, bool, bool)),
+            this, SLOT(slotCopyingDone(KIO::Job*)));
+    while (!copyFinished)
+        kapp-&gt;processEvents();
 }
 
 void FormatImporter::moveFolder(const QString &amp;folder, const QString &amp;newFolder)
 {
-	copyFinished = false;
-	KIO::CopyJob *copyJob = KIO::moveAs(KUrl(folder), KUrl(newFolder), /*showProgressInfo=*/false);
-	connect(copyJob,  SIGNAL(copyingDone(KIO::Job *, KUrl, KUrl, time_t, bool, bool)),
-		this, SLOT(slotCopyingDone(KIO::Job*)));
-	while (!copyFinished)
-		kapp-&gt;processEvents();
+    copyFinished = false;
+    KIO::CopyJob *copyJob = KIO::moveAs(KUrl(folder), KUrl(newFolder), /*showProgressInfo=*/false);
+    connect(copyJob,  SIGNAL(copyingDone(KIO::Job *, KUrl, KUrl, time_t, bool, bool)),
+            this, SLOT(slotCopyingDone(KIO::Job*)));
+    while (!copyFinished)
+        kapp-&gt;processEvents();
 }
 
 void FormatImporter::slotCopyingDone(KIO::Job *)
 {
-//	kDebug() &lt;&lt; &quot;Copy finished of &quot; + from.path() + &quot; to &quot; + to.path();
-	copyFinished = true;
+//  kDebug() &lt;&lt; &quot;Copy finished of &quot; + from.path() + &quot; to &quot; + to.path();
+    copyFinished = true;
 }
 
 void FormatImporter::importBaskets()
 {
-	kDebug() &lt;&lt; &quot;Import Baskets: Preparing...&quot;;
+    kDebug() &lt;&lt; &quot;Import Baskets: Preparing...&quot;;
 
-	// Some preliminary preparations (create the destination folders and the basket tree file):
-	QDir dirPrep;
-	dirPrep.mkdir(Global::savesFolder());
-	dirPrep.mkdir(Global::basketsFolder());
-	QDomDocument document(&quot;basketTree&quot;);
-	QDomElement root = document.createElement(&quot;basketTree&quot;);
-	document.appendChild(root);
+    // Some preliminary preparations (create the destination folders and the basket tree file):
+    QDir dirPrep;
+    dirPrep.mkdir(Global::savesFolder());
+    dirPrep.mkdir(Global::basketsFolder());
+    QDomDocument document(&quot;basketTree&quot;);
+    QDomElement root = document.createElement(&quot;basketTree&quot;);
+    document.appendChild(root);
 
-	// First up, establish a list of every baskets, ensure the old order (if any), and count them.
-	QStringList baskets;
+    // First up, establish a list of every baskets, ensure the old order (if any), and count them.
+    QStringList baskets;
 
-	// Read the 0.5.0 baskets order:
-	QDomDocument *doc = XMLWork::openFile(&quot;container&quot;, Global::savesFolder() + &quot;container.baskets&quot;);
-	if (doc != 0) {
-		QDomElement docElem = doc-&gt;documentElement();
-		QDomElement basketsElem = XMLWork::getElement(docElem, &quot;baskets&quot;);
-		QDomNode n = basketsElem.firstChild();
-		while (!n.isNull()) {
-			QDomElement e = n.toElement();
-			if ((!e.isNull()) &amp;&amp; e.tagName() == &quot;basket&quot;)
-				baskets.append(e.text());
-			n = n.nextSibling();
-		}
-	}
+    // Read the 0.5.0 baskets order:
+    QDomDocument *doc = XMLWork::openFile(&quot;container&quot;, Global::savesFolder() + &quot;container.baskets&quot;);
+    if (doc != 0) {
+        QDomElement docElem = doc-&gt;documentElement();
+        QDomElement basketsElem = XMLWork::getElement(docElem, &quot;baskets&quot;);
+        QDomNode n = basketsElem.firstChild();
+        while (!n.isNull()) {
+            QDomElement e = n.toElement();
+            if ((!e.isNull()) &amp;&amp; e.tagName() == &quot;basket&quot;)
+                baskets.append(e.text());
+            n = n.nextSibling();
+        }
+    }
 
-	// Then load the baskets that weren't loaded (import &lt; 0.5.0 ones):
-	QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
-	QStringList list = dir.entryList();
-	if (list.count() &gt; 2) // Pass &quot;.&quot; and &quot;..&quot;
-		for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder
-			if (*it != &quot;.&quot; &amp;&amp; *it != &quot;..&quot; &amp;&amp; dir.exists(Global::savesFolder() + *it + &quot;/.basket&quot;)) // If it can be a basket folder
-				if (! (baskets.contains((*it) + &quot;/&quot;)) &amp;&amp; baskets.contains(*it) ) // And if it is not already in the imported baskets list
-					baskets.append(*it);
+    // Then load the baskets that weren't loaded (import &lt; 0.5.0 ones):
+    QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
+    QStringList list = dir.entryList();
+    if (list.count() &gt; 2) // Pass &quot;.&quot; and &quot;..&quot;
+        for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder
+            if (*it != &quot;.&quot; &amp;&amp; *it != &quot;..&quot; &amp;&amp; dir.exists(Global::savesFolder() + *it + &quot;/.basket&quot;)) // If it can be a basket folder
+                if (!(baskets.contains((*it) + &quot;/&quot;)) &amp;&amp; baskets.contains(*it))   // And if it is not already in the imported baskets list
+                    baskets.append(*it);
 
-	kDebug() &lt;&lt; &quot;Import Baskets: Found &quot; &lt;&lt; baskets.count() &lt;&lt; &quot; baskets to import.&quot;;
+    kDebug() &lt;&lt; &quot;Import Baskets: Found &quot; &lt;&lt; baskets.count() &lt;&lt; &quot; baskets to import.&quot;;
 
-	// Import every baskets:
-	int i = 0;
-	for (QStringList::iterator it = baskets.begin(); it != baskets.end(); ++it) {
-		++i;
-		kDebug() &lt;&lt; &quot;Import Baskets: Importing basket &quot; &lt;&lt; i &lt;&lt; &quot; of &quot; &lt;&lt; baskets.count() &lt;&lt; &quot;...&quot;;
+    // Import every baskets:
+    int i = 0;
+    for (QStringList::iterator it = baskets.begin(); it != baskets.end(); ++it) {
+        ++i;
+        kDebug() &lt;&lt; &quot;Import Baskets: Importing basket &quot; &lt;&lt; i &lt;&lt; &quot; of &quot; &lt;&lt; baskets.count() &lt;&lt; &quot;...&quot;;
 
-		// Move the folder to the new repository (normal basket) or copy the folder (mirorred folder):
-		QString folderName = *it;
-		if (folderName.startsWith(&quot;/&quot;)) { // It was a folder mirror:
-			KMessageBox::information(0, i18n(&quot;&lt;p&gt;Folder mirroring is not possible anymore (see &lt;a href='http://basket.kde.org/'&gt;basket.kde.org&lt;/a&gt; for more information).&lt;/p&gt;&quot;
-				&quot;&lt;p&gt;The folder &lt;b&gt;%1&lt;/b&gt; has been copied for the basket needs. You can either delete this folder or delete the basket, or use both. But remember that &quot;
-				&quot;modifying one will not modify the other anymore as they are now separate entities.&lt;/p&gt;&quot;, folderName), i18n(&quot;Folder Mirror Import&quot;),
-				&quot;&quot;, KMessageBox::AllowLink);
-			// Also modify folderName to be only the folder name and not the full path anymore:
-			QString newFolderName = folderName;
-			if (newFolderName.endsWith(&quot;/&quot;))
-				newFolderName = newFolderName.left(newFolderName.length() - 1);
-			newFolderName = newFolderName.mid(newFolderName.lastIndexOf('/') + 1);
-			newFolderName = Tools::fileNameForNewFile(newFolderName, Global::basketsFolder());
-			FormatImporter f;
-			f.copyFolder(folderName, Global::basketsFolder() + newFolderName);
-			folderName = newFolderName;
-		} else
-			dir.rename(Global::savesFolder() + folderName, Global::basketsFolder() + folderName); // Move the folder
+        // Move the folder to the new repository (normal basket) or copy the folder (mirorred folder):
+        QString folderName = *it;
+        if (folderName.startsWith(&quot;/&quot;)) { // It was a folder mirror:
+            KMessageBox::information(0, i18n(&quot;&lt;p&gt;Folder mirroring is not possible anymore (see &lt;a href='http://basket.kde.org/'&gt;basket.kde.org&lt;/a&gt; for more information).&lt;/p&gt;&quot;
+                                             &quot;&lt;p&gt;The folder &lt;b&gt;%1&lt;/b&gt; has been copied for the basket needs. You can either delete this folder or delete the basket, or use both. But remember that &quot;
+                                             &quot;modifying one will not modify the other anymore as they are now separate entities.&lt;/p&gt;&quot;, folderName), i18n(&quot;Folder Mirror Import&quot;),
+                                     &quot;&quot;, KMessageBox::AllowLink);
+            // Also modify folderName to be only the folder name and not the full path anymore:
+            QString newFolderName = folderName;
+            if (newFolderName.endsWith(&quot;/&quot;))
+                newFolderName = newFolderName.left(newFolderName.length() - 1);
+            newFolderName = newFolderName.mid(newFolderName.lastIndexOf('/') + 1);
+            newFolderName = Tools::fileNameForNewFile(newFolderName, Global::basketsFolder());
+            FormatImporter f;
+            f.copyFolder(folderName, Global::basketsFolder() + newFolderName);
+            folderName = newFolderName;
+        } else
+            dir.rename(Global::savesFolder() + folderName, Global::basketsFolder() + folderName); // Move the folder
 
-		// Import the basket structure file and get the properties (to add them in the tree basket-properties cache):
-		QDomElement properties = importBasket(folderName);
+        // Import the basket structure file and get the properties (to add them in the tree basket-properties cache):
+        QDomElement properties = importBasket(folderName);
 
-		// Add it to the XML document:
-		QDomElement basketElement = document.createElement(&quot;basket&quot;);
-		root.appendChild(basketElement);
-		basketElement.setAttribute(&quot;folderName&quot;, folderName);
-		basketElement.appendChild(properties);
-	}
+        // Add it to the XML document:
+        QDomElement basketElement = document.createElement(&quot;basket&quot;);
+        root.appendChild(basketElement);
+        basketElement.setAttribute(&quot;folderName&quot;, folderName);
+        basketElement.appendChild(properties);
+    }
 
-	// Finalize (write to disk and delete now useless files):
-	kDebug() &lt;&lt; &quot;Import Baskets: Finalizing...&quot;;
+    // Finalize (write to disk and delete now useless files):
+    kDebug() &lt;&lt; &quot;Import Baskets: Finalizing...&quot;;
 
-	QFile file(Global::basketsFolder() + &quot;baskets.xml&quot;);
-	if (file.open(QIODevice::WriteOnly)) {
-		QTextStream stream(&amp;file);
-		stream.setCodec(&quot;UTF-8&quot;);
-		QString xml = document.toString();
-		stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
-		stream &lt;&lt; xml;
-		file.close();
-	}
+    QFile file(Global::basketsFolder() + &quot;baskets.xml&quot;);
+    if (file.open(QIODevice::WriteOnly)) {
+        QTextStream stream(&amp;file);
+        stream.setCodec(&quot;UTF-8&quot;);
+        QString xml = document.toString();
+        stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
+        stream &lt;&lt; xml;
+        file.close();
+    }
 
-	Tools::deleteRecursively(Global::savesFolder() + &quot;.tmp&quot;);
-	dir.remove(Global::savesFolder() + &quot;container.baskets&quot;);
+    Tools::deleteRecursively(Global::savesFolder() + &quot;.tmp&quot;);
+    dir.remove(Global::savesFolder() + &quot;container.baskets&quot;);
 
-	kDebug() &lt;&lt; &quot;Import Baskets: Finished.&quot;;
+    kDebug() &lt;&lt; &quot;Import Baskets: Finished.&quot;;
 }
 
 QDomElement FormatImporter::importBasket(const QString &amp;folderName)
 {
-	// Load the XML file:
-	QDomDocument *document = XMLWork::openFile(&quot;basket&quot;, Global::basketsFolder() + folderName + &quot;/.basket&quot;);
-	if (!document) {
-		kDebug() &lt;&lt; &quot;Import Baskets: Failed to read the basket file!&quot;;
-		return QDomElement();
-	}
-	QDomElement docElem = document-&gt;documentElement();
+    // Load the XML file:
+    QDomDocument *document = XMLWork::openFile(&quot;basket&quot;, Global::basketsFolder() + folderName + &quot;/.basket&quot;);
+    if (!document) {
+        kDebug() &lt;&lt; &quot;Import Baskets: Failed to read the basket file!&quot;;
+        return QDomElement();
+    }
+    QDomElement docElem = document-&gt;documentElement();
 
-	// Import properties (change &lt;background color=&quot;&quot;&gt; to &lt;appearance backgroundColor=&quot;&quot;&gt;, and figure out if is a checklist or not):
-	QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
-	QDomElement background = XMLWork::getElement(properties, &quot;background&quot;);
-	QColor backgroundColor = QColor(background.attribute(&quot;color&quot;));
-	if (backgroundColor.isValid() &amp;&amp; (backgroundColor != kapp-&gt;palette().color(QPalette::Base))) { // Use the default color if it was already that color:
-		QDomElement appearance = document-&gt;createElement(&quot;appearance&quot;);
-		appearance.setAttribute(&quot;backgroundColor&quot;, backgroundColor.name());
-		properties.appendChild(appearance);
-	}
-	QDomElement disposition = document-&gt;createElement(&quot;disposition&quot;);
-	disposition.setAttribute(&quot;mindMap&quot;,     &quot;false&quot;);
-	disposition.setAttribute(&quot;columnCount&quot;, &quot;1&quot;);
-	disposition.setAttribute(&quot;free&quot;,        &quot;false&quot;);
-	bool isCheckList = XMLWork::trueOrFalse( XMLWork::getElementText(properties, &quot;showCheckBoxes&quot;, false) );
+    // Import properties (change &lt;background color=&quot;&quot;&gt; to &lt;appearance backgroundColor=&quot;&quot;&gt;, and figure out if is a checklist or not):
+    QDomElement properties = XMLWork::getElement(docElem, &quot;properties&quot;);
+    QDomElement background = XMLWork::getElement(properties, &quot;background&quot;);
+    QColor backgroundColor = QColor(background.attribute(&quot;color&quot;));
+    if (backgroundColor.isValid() &amp;&amp; (backgroundColor != kapp-&gt;palette().color(QPalette::Base))) { // Use the default color if it was already that color:
+        QDomElement appearance = document-&gt;createElement(&quot;appearance&quot;);
+        appearance.setAttribute(&quot;backgroundColor&quot;, backgroundColor.name());
+        properties.appendChild(appearance);
+    }
+    QDomElement disposition = document-&gt;createElement(&quot;disposition&quot;);
+    disposition.setAttribute(&quot;mindMap&quot;,     &quot;false&quot;);
+    disposition.setAttribute(&quot;columnCount&quot;, &quot;1&quot;);
+    disposition.setAttribute(&quot;free&quot;,        &quot;false&quot;);
+    bool isCheckList = XMLWork::trueOrFalse(XMLWork::getElementText(properties, &quot;showCheckBoxes&quot;, false));
 
-	// Insert all notes in a group (column): 1/ rename &quot;items&quot; to &quot;group&quot;, 2/ add &quot;notes&quot; to root, 3/ move &quot;group&quot; into &quot;notes&quot;
-	QDomElement column = XMLWork::getElement(docElem, &quot;items&quot;);
-	column.setTagName(&quot;group&quot;);
-	QDomElement notes = document-&gt;createElement(&quot;notes&quot;);
-	notes.appendChild(column);
-	docElem.appendChild(notes);
+    // Insert all notes in a group (column): 1/ rename &quot;items&quot; to &quot;group&quot;, 2/ add &quot;notes&quot; to root, 3/ move &quot;group&quot; into &quot;notes&quot;
+    QDomElement column = XMLWork::getElement(docElem, &quot;items&quot;);
+    column.setTagName(&quot;group&quot;);
+    QDomElement notes = document-&gt;createElement(&quot;notes&quot;);
+    notes.appendChild(column);
+    docElem.appendChild(notes);
 
-	// Import notes from older representations:
-	QDomNode n = column.firstChild();
-	while ( ! n.isNull() ) {
-		QDomElement e = n.toElement();
-		if (!e.isNull()) {
-			e.setTagName(&quot;note&quot;);
-			QDomElement content = XMLWork::getElement(e, &quot;content&quot;);
-			// Add Check tag:
-			if (isCheckList) {
-				bool isChecked = XMLWork::trueOrFalse(e.attribute(&quot;checked&quot;, &quot;false&quot;));
-				XMLWork::addElement(*document, e, &quot;tags&quot;, (isChecked ? &quot;todo_done&quot; : &quot;todo_unchecked&quot;));
-			}
-			// Import annotations as folded groups:
-			QDomElement parentE = column;
-			QString annotations = XMLWork::getElementText(e, &quot;annotations&quot;, &quot;&quot;);
-			if (!annotations.isEmpty()) {
-				QDomElement annotGroup = document-&gt;createElement(&quot;group&quot;);
-				column.insertBefore(annotGroup, e);
-				annotGroup.setAttribute(&quot;folded&quot;, &quot;true&quot;);
-				annotGroup.appendChild(e);
-				parentE = annotGroup;
-				// Create the text note and add it to the DOM tree:
-				QDomElement annotNote = document-&gt;createElement(&quot;note&quot;);
-				annotNote.setAttribute(&quot;type&quot;, &quot;text&quot;);
-				annotGroup.appendChild(annotNote);
-				QString annotFileName = Tools::fileNameForNewFile(&quot;annotations1.txt&quot;, Basket::fullPathForFolderName(folderName));
-				QString annotFullPath = Basket::fullPathForFolderName(folderName) + &quot;/&quot; + annotFileName;
-				QFile file(annotFullPath);
-				if (file.open(QIODevice::WriteOnly)) {
-					QTextStream stream(&amp;file);
-					stream &lt;&lt; annotations;
-					file.close();
-				}
-				XMLWork::addElement(*document, annotNote, &quot;content&quot;, annotFileName);
-				n = annotGroup;
-			}
-			// Import Launchers from 0.3.x, 0.4.0 and 0.5.0-alphas:
-			QString runCommand = e.attribute(&quot;runcommand&quot;); // Keep compatibility with 0.4.0 and 0.5.0-alphas versions
-			runCommand = XMLWork::getElementText(e, &quot;action&quot;, runCommand); // Keep compatibility with 0.3.x versions
-			if ( ! runCommand.isEmpty() ) { // An import should be done
-				// Prepare the launcher note:
-				QString title = content.attribute(&quot;title&quot;, &quot;&quot;);
-				QString icon  = content.attribute(&quot;icon&quot;,  &quot;&quot;);
-				if (title.isEmpty()) title = runCommand;
-				if (icon.isEmpty())  icon  = NoteFactory::iconForCommand(runCommand);
-				// Import the launcher note:
-				// Adapted version of &quot;QString launcherName = NoteFactory::createNoteLauncherFile(runCommand, title, icon, this)&quot;:
-				QString launcherContent = QString(
-					&quot;[Desktop Entry]\n&quot;
-					&quot;Exec=%1\n&quot;
-					&quot;Name=%2\n&quot;
-					&quot;Icon=%3\n&quot;
-					&quot;Encoding=UTF-8\n&quot;
-					&quot;Type=Application\n&quot;).arg(runCommand, title, icon.isEmpty() ? QString(&quot;exec&quot;) : icon);
-				QString launcherFileName = Tools::fileNameForNewFile(&quot;launcher.desktop&quot;, Global::basketsFolder() + folderName /*+ &quot;/&quot;*/);
-				QString launcherFullPath = Global::basketsFolder() + folderName /*+ &quot;/&quot;*/ + launcherFileName;
-				QFile file(launcherFullPath);
-				if (file.open(QIODevice::WriteOnly)) {
-					QTextStream stream(&amp;file);
-					stream.setCodec(&quot;UTF-8&quot;);
-					stream &lt;&lt; launcherContent;
-					file.close();
-				}
-				// Add the element to the DOM:
-				QDomElement launcherElem = document-&gt;createElement(&quot;note&quot;);
-				parentE.insertBefore(launcherElem, e);
-				launcherElem.setAttribute(&quot;type&quot;, &quot;launcher&quot;);
-				XMLWork::addElement(*document, launcherElem, &quot;content&quot;, launcherFileName);
-			}
-			// Import unknown ns to 0.6.0:
-			if (e.attribute(&quot;type&quot;) == &quot;unknow&quot;)
-				e.setAttribute(&quot;type&quot;, &quot;unknown&quot;);
-			// Import links from version &lt; 0.5.0:
-			if (!content.attribute(&quot;autotitle&quot;).isEmpty() &amp;&amp; content.attribute(&quot;autoTitle&quot;).isEmpty())
-				content.setAttribute(&quot;autoTitle&quot;, content.attribute(&quot;autotitle&quot;));
-			if (!content.attribute(&quot;autoicon&quot;).isEmpty() &amp;&amp; content.attribute(&quot;autoIcon&quot;).isEmpty())
-				content.setAttribute(&quot;autoIcon&quot;, content.attribute(&quot;autoicon&quot;));
-		}
-		n = n.nextSibling();
-	}
+    // Import notes from older representations:
+    QDomNode n = column.firstChild();
+    while (! n.isNull()) {
+        QDomElement e = n.toElement();
+        if (!e.isNull()) {
+            e.setTagName(&quot;note&quot;);
+            QDomElement content = XMLWork::getElement(e, &quot;content&quot;);
+            // Add Check tag:
+            if (isCheckList) {
+                bool isChecked = XMLWork::trueOrFalse(e.attribute(&quot;checked&quot;, &quot;false&quot;));
+                XMLWork::addElement(*document, e, &quot;tags&quot;, (isChecked ? &quot;todo_done&quot; : &quot;todo_unchecked&quot;));
+            }
+            // Import annotations as folded groups:
+            QDomElement parentE = column;
+            QString annotations = XMLWork::getElementText(e, &quot;annotations&quot;, &quot;&quot;);
+            if (!annotations.isEmpty()) {
+                QDomElement annotGroup = document-&gt;createElement(&quot;group&quot;);
+                column.insertBefore(annotGroup, e);
+                annotGroup.setAttribute(&quot;folded&quot;, &quot;true&quot;);
+                annotGroup.appendChild(e);
+                parentE = annotGroup;
+                // Create the text note and add it to the DOM tree:
+                QDomElement annotNote = document-&gt;createElement(&quot;note&quot;);
+                annotNote.setAttribute(&quot;type&quot;, &quot;text&quot;);
+                annotGroup.appendChild(annotNote);
+                QString annotFileName = Tools::fileNameForNewFile(&quot;annotations1.txt&quot;, Basket::fullPathForFolderName(folderName));
+                QString annotFullPath = Basket::fullPathForFolderName(folderName) + &quot;/&quot; + annotFileName;
+                QFile file(annotFullPath);
+                if (file.open(QIODevice::WriteOnly)) {
+                    QTextStream stream(&amp;file);
+                    stream &lt;&lt; annotations;
+                    file.close();
+                }
+                XMLWork::addElement(*document, annotNote, &quot;content&quot;, annotFileName);
+                n = annotGroup;
+            }
+            // Import Launchers from 0.3.x, 0.4.0 and 0.5.0-alphas:
+            QString runCommand = e.attribute(&quot;runcommand&quot;); // Keep compatibility with 0.4.0 and 0.5.0-alphas versions
+            runCommand = XMLWork::getElementText(e, &quot;action&quot;, runCommand); // Keep compatibility with 0.3.x versions
+            if (! runCommand.isEmpty()) {   // An import should be done
+                // Prepare the launcher note:
+                QString title = content.attribute(&quot;title&quot;, &quot;&quot;);
+                QString icon  = content.attribute(&quot;icon&quot;,  &quot;&quot;);
+                if (title.isEmpty()) title = runCommand;
+                if (icon.isEmpty())  icon  = NoteFactory::iconForCommand(runCommand);
+                // Import the launcher note:
+                // Adapted version of &quot;QString launcherName = NoteFactory::createNoteLauncherFile(runCommand, title, icon, this)&quot;:
+                QString launcherContent = QString(
+                                              &quot;[Desktop Entry]\n&quot;
+                                              &quot;Exec=%1\n&quot;
+                                              &quot;Name=%2\n&quot;
+                                              &quot;Icon=%3\n&quot;
+                                              &quot;Encoding=UTF-8\n&quot;
+                                              &quot;Type=Application\n&quot;).arg(runCommand, title, icon.isEmpty() ? QString(&quot;exec&quot;) : icon);
+                QString launcherFileName = Tools::fileNameForNewFile(&quot;launcher.desktop&quot;, Global::basketsFolder() + folderName /*+ &quot;/&quot;*/);
+                QString launcherFullPath = Global::basketsFolder() + folderName /*+ &quot;/&quot;*/ + launcherFileName;
+                QFile file(launcherFullPath);
+                if (file.open(QIODevice::WriteOnly)) {
+                    QTextStream stream(&amp;file);
+                    stream.setCodec(&quot;UTF-8&quot;);
+                    stream &lt;&lt; launcherContent;
+                    file.close();
+                }
+                // Add the element to the DOM:
+                QDomElement launcherElem = document-&gt;createElement(&quot;note&quot;);
+                parentE.insertBefore(launcherElem, e);
+                launcherElem.setAttribute(&quot;type&quot;, &quot;launcher&quot;);
+                XMLWork::addElement(*document, launcherElem, &quot;content&quot;, launcherFileName);
+            }
+            // Import unknown ns to 0.6.0:
+            if (e.attribute(&quot;type&quot;) == &quot;unknow&quot;)
+                e.setAttribute(&quot;type&quot;, &quot;unknown&quot;);
+            // Import links from version &lt; 0.5.0:
+            if (!content.attribute(&quot;autotitle&quot;).isEmpty() &amp;&amp; content.attribute(&quot;autoTitle&quot;).isEmpty())
+                content.setAttribute(&quot;autoTitle&quot;, content.attribute(&quot;autotitle&quot;));
+            if (!content.attribute(&quot;autoicon&quot;).isEmpty() &amp;&amp; content.attribute(&quot;autoIcon&quot;).isEmpty())
+                content.setAttribute(&quot;autoIcon&quot;, content.attribute(&quot;autoicon&quot;));
+        }
+        n = n.nextSibling();
+    }
 
-	// Save the resulting XML file:
-	QFile file(Global::basketsFolder() + folderName + &quot;/.basket&quot;);
-	if (file.open(QIODevice::WriteOnly)) {
-		QTextStream stream(&amp;file);
-		stream.setCodec(&quot;UTF-8&quot;);
-//		QString xml = document-&gt;toString();
-//		stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
-//		stream &lt;&lt; xml;
-		stream &lt;&lt; document-&gt;toString(); // Document is ALREADY using UTF-8
-		file.close();
-	} else
-		kDebug() &lt;&lt; &quot;Import Baskets: Failed to save the basket file!&quot;;
+    // Save the resulting XML file:
+    QFile file(Global::basketsFolder() + folderName + &quot;/.basket&quot;);
+    if (file.open(QIODevice::WriteOnly)) {
+        QTextStream stream(&amp;file);
+        stream.setCodec(&quot;UTF-8&quot;);
+//      QString xml = document-&gt;toString();
+//      stream &lt;&lt; &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;\n&quot;;
+//      stream &lt;&lt; xml;
+        stream &lt;&lt; document-&gt;toString(); // Document is ALREADY using UTF-8
+        file.close();
+    } else
+        kDebug() &lt;&lt; &quot;Import Baskets: Failed to save the basket file!&quot;;
 
-	// Return the newly created properties (to put in the basket tree):
-	return properties;
+    // Return the newly created properties (to put in the basket tree):
+    return properties;
 }
 </diff>
      <filename>src/formatimporter.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -25,8 +25,9 @@
 //#include &lt;qwidget.h&gt;
 #include &lt;qdom.h&gt;
 
-namespace KIO {
-	class Job;
+namespace KIO
+{
+class Job;
 }
 
 /**
@@ -34,18 +35,18 @@ namespace KIO {
   */
 class FormatImporter : QObject
 {
-  Q_OBJECT
-  public:
-	static bool shouldImportBaskets();
-	static void importBaskets();
-	static QDomElement importBasket(const QString &amp;folderName);
+    Q_OBJECT
+public:
+    static bool shouldImportBaskets();
+    static void importBaskets();
+    static QDomElement importBasket(const QString &amp;folderName);
 
-	void copyFolder(const QString &amp;folder, const QString &amp;newFolder);
-	void moveFolder(const QString &amp;folder, const QString &amp;newFolder);
-  private slots:
-	void slotCopyingDone(KIO::Job*);
-  private:
-	bool copyFinished;
+    void copyFolder(const QString &amp;folder, const QString &amp;newFolder);
+    void moveFolder(const QString &amp;folder, const QString &amp;newFolder);
+private slots:
+    void slotCopyingDone(KIO::Job*);
+private:
+    bool copyFinished;
 };
 
 #endif // FORMATIMPORTER_H</diff>
      <filename>src/formatimporter.h</filename>
    </modified>
    <modified>
      <diff>@@ -45,53 +45,64 @@ AboutData          Global::basketAbout;
 
 void Global::setCustomSavesFolder(const QString &amp;folder)
 {
-	s_customSavesFolder = folder;
+    s_customSavesFolder = folder;
 }
 
 QString Global::savesFolder()
 {
-	static QString *folder = 0L; // Memorize the folder to do not have to re-compute it each time it's needed
+    static QString *folder = 0L; // Memorize the folder to do not have to re-compute it each time it's needed
 
-	if (folder == 0L) {          // Initialize it if not yet done
-		if (!s_customSavesFolder.isEmpty()) { // Passed by command line (for development &amp; debug purpose)
-			QDir dir;
-			dir.mkdir(s_customSavesFolder);
-			folder = new QString(s_customSavesFolder.endsWith(&quot;/&quot;) ? s_customSavesFolder : s_customSavesFolder + &quot;/&quot;);
-		} else if (!Settings::dataFolder().isEmpty()) { // Set by config option (in Basket -&gt; Backup &amp; Restore)
-			QDir dir;
-			dir.mkdir(s_customSavesFolder);
-			folder = new QString(Settings::dataFolder().endsWith(&quot;/&quot;) ? Settings::dataFolder() : Settings::dataFolder() + &quot;/&quot;);
-		} else { // The default path (should be that for most computers)
-			folder = new QString(KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/&quot;));
-		}
-	}
+    if (folder == 0L) {          // Initialize it if not yet done
+        if (!s_customSavesFolder.isEmpty()) { // Passed by command line (for development &amp; debug purpose)
+            QDir dir;
+            dir.mkdir(s_customSavesFolder);
+            folder = new QString(s_customSavesFolder.endsWith(&quot;/&quot;) ? s_customSavesFolder : s_customSavesFolder + &quot;/&quot;);
+        } else if (!Settings::dataFolder().isEmpty()) { // Set by config option (in Basket -&gt; Backup &amp; Restore)
+            QDir dir;
+            dir.mkdir(s_customSavesFolder);
+            folder = new QString(Settings::dataFolder().endsWith(&quot;/&quot;) ? Settings::dataFolder() : Settings::dataFolder() + &quot;/&quot;);
+        } else { // The default path (should be that for most computers)
+            folder = new QString(KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, &quot;basket/&quot;));
+        }
+    }
 
-	return *folder;
+    return *folder;
 }
 
-QString Global::basketsFolder()     { return savesFolder() + &quot;baskets/&quot;;     }
-QString Global::backgroundsFolder() { return savesFolder() + &quot;backgrounds/&quot;; }
-QString Global::templatesFolder()   { return savesFolder() + &quot;templates/&quot;;   }
-QString Global::tempCutFolder()     { return savesFolder() + &quot;temp-cut/&quot;;    }
+QString Global::basketsFolder()
+{
+    return savesFolder() + &quot;baskets/&quot;;
+}
+QString Global::backgroundsFolder()
+{
+    return savesFolder() + &quot;backgrounds/&quot;;
+}
+QString Global::templatesFolder()
+{
+    return savesFolder() + &quot;templates/&quot;;
+}
+QString Global::tempCutFolder()
+{
+    return savesFolder() + &quot;temp-cut/&quot;;
+}
 
 QString Global::openNoteIcon() // FIXME: Now an edit icon
 {
-	return QVariant(Global::bnpView-&gt;m_actEditNote-&gt;icon()).toString();
+    return QVariant(Global::bnpView-&gt;m_actEditNote-&gt;icon()).toString();
 }
 
 KMainWindow* Global::mainWindow()
 {
-	QWidget* res = kapp-&gt;activeWindow();
+    QWidget* res = kapp-&gt;activeWindow();
 
-	if(res &amp;&amp; res-&gt;inherits(&quot;KMainWindow&quot;))
-	{
-		return static_cast&lt;KMainWindow*&gt;(res);
-	}
-	return 0;
+    if (res &amp;&amp; res-&gt;inherits(&quot;KMainWindow&quot;)) {
+        return static_cast&lt;KMainWindow*&gt;(res);
+    }
+    return 0;
 }
 
 KConfig* Global::config()
 {
     //The correct solution is to go and replace all KConfig* with KSharedConfig::Ptr, but that seems awfully annoying to do right now
-	return Global::basketConfig.data();
+    return Global::basketConfig.data();
 }</diff>
      <filename>src/global.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -41,31 +41,33 @@ class KAboutData;
   */
 class BASKET_EXPORT Global
 {
-  private:
-	static QString s_customSavesFolder;
-  public:
-	// Global Variables:
-	static LikeBack          *likeBack;
-	static DebugWindow       *debugWindow;
-	static BackgroundManager *backgroundManager;
-	static SystemTray        *systemTray;
-	static BNPView           *bnpView;
-	static KSharedConfig::Ptr basketConfig;
-	static AboutData          basketAbout;
+private:
+    static QString s_customSavesFolder;
+public:
+    // Global Variables:
+    static LikeBack          *likeBack;
+    static DebugWindow       *debugWindow;
+    static BackgroundManager *backgroundManager;
+    static SystemTray        *systemTray;
+    static BNPView           *bnpView;
+    static KSharedConfig::Ptr basketConfig;
+    static AboutData          basketAbout;
 
-	// Application Folders:
-	static void setCustomSavesFolder(const QString &amp;folder);
-	static QString savesFolder();       /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/&quot;.
-	static QString basketsFolder();     /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/baskets/&quot;.
-	static QString backgroundsFolder(); /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/backgrounds/&quot;.
-	static QString templatesFolder();   /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/templates/&quot;.
-	static QString tempCutFolder();     /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/temp-cut/&quot;.   (was &quot;.tmp/&quot;)
+    // Application Folders:
+    static void setCustomSavesFolder(const QString &amp;folder);
+    static QString savesFolder();       /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/&quot;.
+    static QString basketsFolder();     /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/baskets/&quot;.
+    static QString backgroundsFolder(); /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/backgrounds/&quot;.
+    static QString templatesFolder();   /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/templates/&quot;.
+    static QString tempCutFolder();     /// &lt;&lt; @return e.g. &quot;/home/username/.kde/share/apps/basket/temp-cut/&quot;.   (was &quot;.tmp/&quot;)
 
-	// Various Things:
-	static QString openNoteIcon();      /// &lt;&lt; @return the icon used for the &quot;Open&quot; action on notes.
-	static KMainWindow* mainWindow();
-	static KConfig* config();
-	static KAboutData* about() { return &amp;basketAbout; };
+    // Various Things:
+    static QString openNoteIcon();      /// &lt;&lt; @return the icon used for the &quot;Open&quot; action on notes.
+    static KMainWindow* mainWindow();
+    static KConfig* config();
+    static KAboutData* about() {
+        return &amp;basketAbout;
+    };
 };
 
 #endif // GLOBAL_H</diff>
      <filename>src/global.h</filename>
    </modified>
    <modified>
      <diff>@@ -49,54 +49,54 @@
 
 HTMLExporter::HTMLExporter(Basket *basket)
 {
-	QDir dir;
-
-	// Compute a default file name &amp; path:
-	KConfigGroup config = Global::config()-&gt;group(&quot;Export to HTML&quot;);
-	QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
-	QString url = folder + QString(basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.html&quot;;
-
-	// Ask a file name &amp; path to the user:
-	QString filter = &quot;*.html *.htm|&quot; + i18n(&quot;HTML Documents&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
-	QString destination = url;
-	for (bool askAgain = true; askAgain; ) {
-		// Ask:
-		destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n(&quot;Export to HTML&quot;));
-		// User canceled?
-		if (destination.isEmpty())
-			return;
-		// File already existing? Ask for overriding:
-		if (dir.exists(destination)) {
-			int result = KMessageBox::questionYesNoCancel(
-				0,
-				&quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
-                    KUrl(destination).fileName()),
-				i18n(&quot;Override File?&quot;),
-				KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
-			);
-			if (result == KMessageBox::Cancel)
-				return;
-			else if (result == KMessageBox::Yes)
-				askAgain = false;
-		} else
-			askAgain = false;
-	}
-
-	// Create the progress dialog that will always be shown during the export:
-	KProgressDialog dialog(0, i18n(&quot;Export to HTML&quot;), i18n(&quot;Exporting to HTML. Please wait...&quot;), /*Not modal, for password dialogs!*/false);
-	dialog.showCancelButton(false);
-	dialog.setAutoClose(true);
-	dialog.show();
-	progress = dialog.progressBar();
-
-	// Remember the last folder used for HTML exporation:
-	config.writeEntry(&quot;lastFolder&quot;, KUrl(destination).directory());
-	config.sync();
-
-	prepareExport(basket, destination);
-	exportBasket(basket, /*isSubBasket*/false);
-
-    progress-&gt;setValue(progress-&gt;value()+1); // Finishing finished
+    QDir dir;
+
+    // Compute a default file name &amp; path:
+    KConfigGroup config = Global::config()-&gt;group(&quot;Export to HTML&quot;);
+    QString folder = config.readEntry(&quot;lastFolder&quot;, QDir::homePath()) + &quot;/&quot;;
+    QString url = folder + QString(basket-&gt;basketName()).replace(&quot;/&quot;, &quot;_&quot;) + &quot;.html&quot;;
+
+    // Ask a file name &amp; path to the user:
+    QString filter = &quot;*.html *.htm|&quot; + i18n(&quot;HTML Documents&quot;) + &quot;\n*|&quot; + i18n(&quot;All Files&quot;);
+    QString destination = url;
+    for (bool askAgain = true; askAgain;) {
+        // Ask:
+        destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n(&quot;Export to HTML&quot;));
+        // User canceled?
+        if (destination.isEmpty())
+            return;
+        // File already existing? Ask for overriding:
+        if (dir.exists(destination)) {
+            int result = KMessageBox::questionYesNoCancel(
+                             0,
+                             &quot;&lt;qt&gt;&quot; + i18n(&quot;The file &lt;b&gt;%1&lt;/b&gt; already exists. Do you really want to override it?&quot;,
+                                           KUrl(destination).fileName()),
+                             i18n(&quot;Override File?&quot;),
+                             KGuiItem(i18n(&quot;&amp;Override&quot;), &quot;document-save&quot;)
+                         );
+            if (result == KMessageBox::Cancel)
+                return;
+            else if (result == KMessageBox::Yes)
+                askAgain = false;
+        } else
+            askAgain = false;
+    }
+
+    // Create the progress dialog that will always be shown during the export:
+    KProgressDialog dialog(0, i18n(&quot;Export to HTML&quot;), i18n(&quot;Exporting to HTML. Please wait...&quot;), /*Not modal, for password dialogs!*/false);
+    dialog.showCancelButton(false);
+    dialog.setAutoClose(true);
+    dialog.show();
+    progress = dialog.progressBar();
+
+    // Remember the last folder used for HTML exporation:
+    config.writeEntry(&quot;lastFolder&quot;, KUrl(destination).directory());
+    config.sync();
+
+    prepareExport(basket, destination);
+    exportBasket(basket, /*isSubBasket*/false);
+
+    progress-&gt;setValue(progress-&gt;value() + 1); // Finishing finished
 }
 
 HTMLExporter::~HTMLExporter()
@@ -105,416 +105,417 @@ HTMLExporter::~HTMLExporter()
 
 void HTMLExporter::prepareExport(Basket *basket, const QString &amp;fullPath)
 {
-	progress-&gt;setRange(0,/*Preparation:*/1 + /*Finishing:*/1 + /*Basket:*/1 + /*SubBaskets:*/Global::bnpView-&gt;basketCount(Global::bnpView-&gt;listViewItemForBasket(basket)));
-	progress-&gt;setValue(0);
-	kapp-&gt;processEvents();
-
-	// Remember the file path choosen by the user:
-	filePath = fullPath;
-	fileName = KUrl(fullPath).fileName();
-	exportedBasket = basket;
-
-	BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
-	withBasketTree = (item-&gt;childCount() &gt;= 0);
-
-	// Create and empty the files folder:
-	QString filesFolderPath = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, filePath) + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/&quot;
-	Tools::deleteRecursively(filesFolderPath);
-	QDir dir;
-	dir.mkdir(filesFolderPath);
-
-	// Create sub-folders:
-	iconsFolderPath   = filesFolderPath + i18nc(&quot;HTML export folder (icons)&quot;,   &quot;icons&quot;)   + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/icons/&quot;
-	imagesFolderPath  = filesFolderPath + i18nc(&quot;HTML export folder (images)&quot;,  &quot;images&quot;)  + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/images/&quot;
-	basketsFolderPath = filesFolderPath + i18nc(&quot;HTML export folder (baskets)&quot;, &quot;baskets&quot;) + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/baskets/&quot;
-	dir.mkdir(iconsFolderPath);
-	dir.mkdir(imagesFolderPath);
-	dir.mkdir(basketsFolderPath);
-
-	progress-&gt;setValue(progress-&gt;value()+1); // Preparation finished
+    progress-&gt;setRange(0,/*Preparation:*/1 + /*Finishing:*/1 + /*Basket:*/1 + /*SubBaskets:*/Global::bnpView-&gt;basketCount(Global::bnpView-&gt;listViewItemForBasket(basket)));
+    progress-&gt;setValue(0);
+    kapp-&gt;processEvents();
+
+    // Remember the file path choosen by the user:
+    filePath = fullPath;
+    fileName = KUrl(fullPath).fileName();
+    exportedBasket = basket;
+
+    BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
+    withBasketTree = (item-&gt;childCount() &gt;= 0);
+
+    // Create and empty the files folder:
+    QString filesFolderPath = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, filePath) + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/&quot;
+    Tools::deleteRecursively(filesFolderPath);
+    QDir dir;
+    dir.mkdir(filesFolderPath);
+
+    // Create sub-folders:
+    iconsFolderPath   = filesFolderPath + i18nc(&quot;HTML export folder (icons)&quot;,   &quot;icons&quot;)   + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/icons/&quot;
+    imagesFolderPath  = filesFolderPath + i18nc(&quot;HTML export folder (images)&quot;,  &quot;images&quot;)  + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/images/&quot;
+    basketsFolderPath = filesFolderPath + i18nc(&quot;HTML export folder (baskets)&quot;, &quot;baskets&quot;) + &quot;/&quot;; // eg.: &quot;/home/seb/foo.html_files/baskets/&quot;
+    dir.mkdir(iconsFolderPath);
+    dir.mkdir(imagesFolderPath);
+    dir.mkdir(basketsFolderPath);
+
+    progress-&gt;setValue(progress-&gt;value() + 1); // Preparation finished
 }
 
 void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
 {
-	if (!basket-&gt;isLoaded()) {
-		basket-&gt;load();
-	}
-
-	// Compute the absolute &amp; relative paths for this basket:
-	filesFolderPath   = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, filePath) + &quot;/&quot;;
-	if (isSubBasket) {
-		basketFilePath    = basketsFolderPath + basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
-		filesFolderName   = &quot;../&quot;;
-		dataFolderName    = basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;-&quot; + i18nc(&quot;HTML export folder (data)&quot;, &quot;data&quot;) + &quot;/&quot;;
-		dataFolderPath    = basketsFolderPath + dataFolderName;
-		basketsFolderName = &quot;&quot;;
-	} else {
-		basketFilePath    = filePath;
-		filesFolderName   = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, KUrl(filePath).fileName()) + &quot;/&quot;;
-		dataFolderName    = filesFolderName + i18nc(&quot;HTML export folder (data)&quot;,    &quot;data&quot;)  + &quot;/&quot;;
-		dataFolderPath    = filesFolderPath + i18nc(&quot;HTML export folder (data)&quot;,    &quot;data&quot;)  + &quot;/&quot;;
-		basketsFolderName = filesFolderName + i18nc(&quot;HTML export folder (baskets)&quot;, &quot;baskets&quot;)  + &quot;/&quot;;
-	}
-	iconsFolderName   = (isSubBasket ? &quot;../&quot; : filesFolderName) + i18nc(&quot;HTML export folder (icons)&quot;,   &quot;icons&quot;)   + &quot;/&quot;; // eg.: &quot;foo.html_files/icons/&quot;   or &quot;../icons/&quot;
-	imagesFolderName  = (isSubBasket ? &quot;../&quot; : filesFolderName) + i18nc(&quot;HTML export folder (images)&quot;,  &quot;images&quot;)  + &quot;/&quot;; // eg.: &quot;foo.html_files/images/&quot;  or &quot;../images/&quot;
-
-	kDebug() &lt;&lt; &quot;Exporting ================================================&quot;;
-	kDebug() &lt;&lt; &quot;  filePath:&quot; &lt;&lt; filePath;
-	kDebug() &lt;&lt; &quot;  basketFilePath:&quot; &lt;&lt; basketFilePath;
-	kDebug() &lt;&lt; &quot;  filesFolderPath:&quot; &lt;&lt; filesFolderPath;
-	kDebug() &lt;&lt; &quot;  filesFolderName:&quot; &lt;&lt; filesFolderName;
-	kDebug() &lt;&lt; &quot;  iconsFolderPath:&quot; &lt;&lt; iconsFolderPath;
-	kDebug() &lt;&lt; &quot;  iconsFolderName:&quot; &lt;&lt; iconsFolderName;
-	kDebug() &lt;&lt; &quot;  imagesFolderPath:&quot; &lt;&lt; imagesFolderPath;
-	kDebug() &lt;&lt; &quot;  imagesFolderName:&quot; &lt;&lt; imagesFolderName;
-	kDebug() &lt;&lt; &quot;  dataFolderPath:&quot; &lt;&lt; dataFolderPath;
-	kDebug() &lt;&lt; &quot;  dataFolderName:&quot; &lt;&lt; dataFolderName;
-	kDebug() &lt;&lt; &quot;  basketsFolderPath:&quot; &lt;&lt; basketsFolderPath;
-	kDebug() &lt;&lt; &quot;  basketsFolderName:&quot; &lt;&lt; basketsFolderName;
-
-	// Create the data folder for this basket:
-	QDir dir;
-	dir.mkdir(dataFolderPath);
-
-	backgroundColorName = basket-&gt;backgroundColor().name().toLower().mid(1);
-
-	// Generate basket icons:
-	QString basketIcon16 = iconsFolderName + copyIcon(basket-&gt;icon(), 16);
-	QString basketIcon32 = iconsFolderName + copyIcon(basket-&gt;icon(), 32);
-
-	// Generate the [+] image for groups:
-	QPixmap expandGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
-	expandGroup.fill(basket-&gt;backgroundColor());
-	QPainter painter(&amp;expandGroup);
-	Note::drawExpander(&amp;painter, 0, 0, basket-&gt;backgroundColor(), /*expand=*/true, basket);
-	painter.end();
-	expandGroup.save(imagesFolderPath + &quot;expand_group_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
-
-	// Generate the [-] image for groups:
-	QPixmap foldGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
-	foldGroup.fill(basket-&gt;backgroundColor());
-	painter.begin(&amp;foldGroup);
-	Note::drawExpander(&amp;painter, 0, 0, basket-&gt;backgroundColor(), /*expand=*/false, basket);
-	painter.end();
-	foldGroup.save(imagesFolderPath + &quot;fold_group_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
-
-	// Open the file to write:
-	QFile file(basketFilePath);
-	if (!file.open(QIODevice::WriteOnly))
-		return;
-	stream.setDevice(&amp;file);
-	stream.setCodec(&quot;UTF-8&quot;);
-
-	// Compute the colors to draw dragient for notes:
-	QColor topBgColor;
-	QColor bottomBgColor;
-	Note::getGradientColors(basket-&gt;backgroundColor(), &amp;topBgColor, &amp;bottomBgColor);
-	// Compute the gradient image for notes:
-	QString gradientImageFileName = Basket::saveGradientBackground(basket-&gt;backgroundColor(), basket-&gt;Q3ScrollView::font(), imagesFolderPath);
-
-	// Output the header:
-	QString borderColor = Tools::mixColor(basket-&gt;backgroundColor(), basket-&gt;textColor()).name();
-	stream &lt;&lt;
-		&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot; \&quot;http://www.w3.org/TR/html4/strict.dtd\&quot;&gt;\n&quot;
-		&quot;&lt;html&gt;\n&quot;
-		&quot; &lt;head&gt;\n&quot;
-		&quot;  &lt;meta http-equiv=\&quot;Content-Type\&quot; content=\&quot;text/html; charset=UTF-8\&quot;&gt;\n&quot;
-		&quot;  &lt;meta name=\&quot;Generator\&quot; content=\&quot;&quot; &lt;&lt; KGlobal::mainComponent().aboutData()-&gt;programName() &lt;&lt; &quot; &quot; &lt;&lt; VERSION &lt;&lt; &quot; http://basket.kde.org/\&quot;&gt;\n&quot;
-		&quot;  &lt;style type=\&quot;text/css\&quot;&gt;\n&quot;
-//		&quot;   @media print {\n&quot;
-//		&quot;    span.printable { display: inline; }\n&quot;
-//		&quot;   }\n&quot;
-		&quot;   body { margin: 10px; font: 11px sans-serif; }\n&quot; // TODO: Use user font
-		&quot;   h1 { text-align: center; }\n&quot;
-		&quot;   img { border: none; vertical-align: middle; }\n&quot;;
-	if (withBasketTree) {
-		stream &lt;&lt;
-			&quot;   .tree { margin: 0; padding: 1px 0 1px 1px; width: 150px; _width: 149px; overflow: hidden; float: left; }\n&quot;
-			&quot;   .tree ul { margin: 0 0 0 10px; padding: 0; }\n&quot;
-			&quot;   .tree li { padding: 0; margin: 0; list-style: none; }\n&quot;
-			&quot;   .tree a { display: block; padding: 1px; height: 16px; text-decoration: none;\n&quot;
-			&quot;             white-space: nowrap; word-wrap: normal; text-wrap: suppress; color: black; }\n&quot;
-			&quot;   .tree span { -moz-border-radius: 6px; display: block; float: left;\n&quot;
-			&quot;                line-height: 16px; height: 16px; vertical-align: middle; padding: 0 1px; }\n&quot;
-			&quot;   .tree img { vertical-align: top; padding-right: 1px; }\n&quot;
-			&quot;   .tree .current { background-color: &quot; &lt;&lt; kapp-&gt;palette().color(QPalette::Highlight).name() &lt;&lt; &quot;; &quot;
-			                    &quot;-moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; color: &quot; &lt;&lt; kapp-&gt;palette().color(QPalette::Highlight).name() &lt;&lt; &quot;; }\n&quot;
-			&quot;   .basketSurrounder { margin-left: 152px; _margin: 0; _float: right; }\n&quot;;
-	}
-	stream &lt;&lt;
-		&quot;   .basket { background-color: &quot; &lt;&lt; basket-&gt;backgroundColor().name() &lt;&lt; &quot;; border: solid &quot; &lt;&lt; borderColor &lt;&lt; &quot; 1px; &quot;
-		             &quot;font: &quot; &lt;&lt; Tools::cssFontDefinition(basket-&gt;Q3ScrollView::font()) &lt;&lt; &quot;; color: &quot; &lt;&lt; basket-&gt;textColor().name() &lt;&lt; &quot;; padding: 1px; width: 100%; }\n&quot;
-		&quot;   table.basket { border-collapse: collapse; }\n&quot;
-		&quot;   .basket * { padding: 0; margin: 0; }\n&quot;
-		&quot;   .basket table { width: 100%; border-spacing: 0; _border-collapse: collapse; }\n&quot;
-		&quot;   .column { vertical-align: top; }\n&quot;
-		&quot;   .columnHandle { width: &quot; &lt;&lt; Note::RESIZER_WIDTH &lt;&lt; &quot;px; background: transparent url('&quot; &lt;&lt; imagesFolderName &lt;&lt; &quot;column_handle_&quot; &lt;&lt; backgroundColorName &lt;&lt; &quot;.png') repeat-y; }\n&quot;
-		&quot;   .group { margin: 0; padding: 0; border-collapse: collapse; width: 100% }\n&quot;
-		&quot;   .groupHandle { margin: 0; width: &quot; &lt;&lt; Note::GROUP_WIDTH &lt;&lt; &quot;px; text-align: center; }\n&quot;
-		&quot;   .note { padding: 1px 2px; background: &quot; &lt;&lt; bottomBgColor.name() &lt;&lt; &quot; url('&quot; &lt;&lt; imagesFolderName &lt;&lt; gradientImageFileName &lt;&lt; &quot;')&quot;
-		          &quot; repeat-x; border-top: solid &quot; &lt;&lt; topBgColor.name() &lt;&lt;
-		          &quot; 1px; border-bottom: solid &quot; &lt;&lt; Tools::mixColor(topBgColor, bottomBgColor).name() &lt;&lt;
-		          &quot; 1px; width: 100%; }\n&quot;
-		&quot;   .tags { width: 1px; white-space: nowrap; }\n&quot;
-		&quot;   .tags img { padding-right: 2px; }\n&quot;
-		&lt;&lt; LinkLook::soundLook-&gt;toCSS(&quot;sound&quot;, basket-&gt;textColor())
-		&lt;&lt; LinkLook::fileLook-&gt;toCSS(&quot;file&quot;, basket-&gt;textColor())
-		&lt;&lt; LinkLook::localLinkLook-&gt;toCSS(&quot;local&quot;, basket-&gt;textColor())
-		&lt;&lt; LinkLook::networkLinkLook-&gt;toCSS(&quot;network&quot;, basket-&gt;textColor())
-		&lt;&lt; LinkLook::launcherLook-&gt;toCSS(&quot;launcher&quot;, basket-&gt;textColor())
-		&lt;&lt;
-		&quot;   .unknown { margin: 1px 2px; border: 1px solid &quot; &lt;&lt; borderColor &lt;&lt; &quot;; -moz-border-radius: 4px; }\n&quot;;
-	QList&lt;State*&gt; states = basket-&gt;usedStates();
-	QString statesCss;
-	for (State::List::Iterator it = states.begin(); it != states.end(); ++it)
-		statesCss += (*it)-&gt;toCSS(imagesFolderPath, imagesFolderName, basket-&gt;Q3ScrollView::font());
-	stream &lt;&lt;
-		statesCss &lt;&lt;
-		&quot;   .credits { text-align: right; margin: 3px 0 0 0; _margin-top: -17px; font-size: 80%; color: &quot; &lt;&lt; borderColor &lt;&lt; &quot;; }\n&quot;
-		&quot;  &lt;/style&gt;\n&quot;
-		&quot;  &lt;title&gt;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/title&gt;\n&quot;
-		&quot;  &lt;link rel=\&quot;shortcut icon\&quot; type=\&quot;image/png\&quot; href=\&quot;&quot; &lt;&lt; basketIcon16 &lt;&lt; &quot;\&quot;&gt;\n&quot;;
-	// Create the column handle image:
-	QPixmap columnHandle(Note::RESIZER_WIDTH, 50);
-	painter.begin(&amp;columnHandle);
-	Note::drawInactiveResizer(&amp;painter, 0, 0, columnHandle.height(), basket-&gt;backgroundColor(), /*column=*/true);
-	painter.end();
-	columnHandle.save(imagesFolderPath + &quot;column_handle_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
-
-	stream &lt;&lt;
-		&quot; &lt;/head&gt;\n&quot;
-		&quot; &lt;body&gt;\n&quot;
-		&quot;  &lt;h1&gt;&lt;img src=\&quot;&quot; &lt;&lt; basketIcon32 &lt;&lt; &quot;\&quot; width=\&quot;32\&quot; height=\&quot;32\&quot; alt=\&quot;\&quot;&gt; &quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/h1&gt;\n&quot;;
-
-	if (withBasketTree)
-		writeBasketTree(basket);
-
-	// If filtering, only export filtered notes, inform to the user:
-	// TODO: Filtering tags too!!
-	// TODO: Make sure only filtered notes are exported!
-//	if (decoration()-&gt;filterData().isFiltering)
-//		stream &lt;&lt;
-//			&quot;  &lt;p&gt;&quot; &lt;&lt; i18n(&quot;Notes matching the filter &amp;quot;%1&amp;quot;:&quot;).arg(Tools::textToHTMLWithoutP(decoration()-&gt;filterData().string)) &lt;&lt; &quot;&lt;/p&gt;\n&quot;;
-
-	stream &lt;&lt;
-		&quot;  &lt;div class=\&quot;basketSurrounder\&quot;&gt;\n&quot;;
-
-	if (basket-&gt;isColumnsLayout())
-		stream &lt;&lt;
-			&quot;   &lt;table class=\&quot;basket\&quot;&gt;\n&quot;
-			&quot;    &lt;tr&gt;\n&quot;;
-	else
-		stream &lt;&lt;
-			&quot;   &lt;div class=\&quot;basket\&quot; style=\&quot;position: relative; height: &quot; &lt;&lt; basket-&gt;contentsHeight() &lt;&lt; &quot;px; width: &quot; &lt;&lt; basket-&gt;contentsWidth() &lt;&lt; &quot;px; min-width: 100%;\&quot;&gt;\n&quot;;
-
-	for (Note *note = basket-&gt;firstNote(); note; note = note-&gt;next())
-		exportNote(note, /*indent=*/(basket-&gt;isFreeLayout() ? 4 : 5));
-
-	// Output the footer:
-	if (basket-&gt;isColumnsLayout())
-		stream &lt;&lt;
-			&quot;    &lt;/tr&gt;\n&quot;
-			&quot;   &lt;/table&gt;\n&quot;;
-	else
-		stream &lt;&lt;
-			&quot;   &lt;/div&gt;\n&quot;;
-	stream &lt;&lt; QString(
-		&quot;  &lt;/div&gt;\n&quot;
-		&quot;  &lt;p class=\&quot;credits\&quot;&gt;%1&lt;/p&gt;\n&quot;).arg(
-			i18n(&quot;Made with &lt;a href=\&quot;http://basket.kde.org/\&quot;&gt;%1&lt;/a&gt; %2, a KDE tool to take notes and keep information at hand.&quot;,
-				KGlobal::mainComponent().aboutData()-&gt;programName(), VERSION));
-
-	// Copy a transparent GIF image in the folder, needed for the JavaScript hack:
-	QString gifFileName = &quot;spacer.gif&quot;;
-	QFile transGIF(imagesFolderPath + gifFileName);
-	if (!transGIF.exists() &amp;&amp; transGIF.open(QIODevice::WriteOnly)) {
-		QDataStream streamGIF(&amp;transGIF);
-		// This is a 1px*1px transparent GIF image:
-		const char blankGIF[] = {
-			0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0a, 0x00, 0x0a, 0x00,
-			0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x21,
-			0xfe, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,
-			0x77, 0x69, 0x74, 0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47,
-			0x49, 0x4d, 0x50, 0x00, 0x21, 0xf9, 0x04, 0x01, 0x0a, 0x00,
-			0x01, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a,
-			0x00, 0x00, 0x02, 0x08, 0x8c, 0x8f, 0xa9, 0xcb, 0xed, 0x0f,
-			0x63, 0x2b, 0x00, 0x3b };
-		streamGIF.writeRawData(blankGIF, 74);
-		transGIF.close();
-	}
-	stream &lt;&lt;
-		&quot;  &lt;!--[if lt IE 7]&gt;\n&quot;
-		&quot;   &lt;script&gt;\n&quot;
-		&quot;    function fixPng(img) {\n&quot;
-		&quot;     if (!img.style.filter) {\n&quot;
-		&quot;      img.style.filter = \&quot;progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\&quot; + img.src + \&quot;')\&quot;;\n&quot;
-		&quot;      img.src = \&quot;&quot; &lt;&lt; imagesFolderName &lt;&lt; gifFileName &lt;&lt; &quot;\&quot;;\n&quot;
-		&quot;     }\n&quot;
-		&quot;    }\n&quot;
-		&quot;    for (i = document.images.length - 1; i &gt;= 0; i -= 1) {\n&quot;
-		&quot;     var img = document.images[i];\n&quot;
-		&quot;     if (img.src.substr(img.src.length - 4) == \&quot;.png\&quot;)\n&quot;
-		&quot;      if (img.complete)\n&quot;
-		&quot;       fixPng(img);\n&quot;
-		&quot;      else\n&quot;
-		&quot;       img.attachEvent(\&quot;onload\&quot;, function() { fixPng(window.event.srcElement); });\n&quot;
-		&quot;    }\n&quot;
-		&quot;   &lt;/script&gt;\n&quot;
-		&quot;  &lt;![endif]--&gt;\n&quot;
-		&quot; &lt;/body&gt;\n&quot;
-		&quot;&lt;/html&gt;\n&quot;;
-
-	file.close();
-	stream.setDevice(0);
-	progress-&gt;setValue(progress-&gt;value()+1); // Basket exportation finished
-
-	// Recursively export child baskets:
-	BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
-	if (item-&gt;childCount() &gt;=0) {
-		for (int i=0; i &lt; item-&gt;childCount(); i++){
-			exportBasket(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), /*isSubBasket=*/true);
-		}
-	}
+    if (!basket-&gt;isLoaded()) {
+        basket-&gt;load();
+    }
+
+    // Compute the absolute &amp; relative paths for this basket:
+    filesFolderPath   = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, filePath) + &quot;/&quot;;
+    if (isSubBasket) {
+        basketFilePath    = basketsFolderPath + basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
+        filesFolderName   = &quot;../&quot;;
+        dataFolderName    = basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;-&quot; + i18nc(&quot;HTML export folder (data)&quot;, &quot;data&quot;) + &quot;/&quot;;
+        dataFolderPath    = basketsFolderPath + dataFolderName;
+        basketsFolderName = &quot;&quot;;
+    } else {
+        basketFilePath    = filePath;
+        filesFolderName   = i18nc(&quot;HTML export folder (files)&quot;, &quot;%1_files&quot;, KUrl(filePath).fileName()) + &quot;/&quot;;
+        dataFolderName    = filesFolderName + i18nc(&quot;HTML export folder (data)&quot;,    &quot;data&quot;)  + &quot;/&quot;;
+        dataFolderPath    = filesFolderPath + i18nc(&quot;HTML export folder (data)&quot;,    &quot;data&quot;)  + &quot;/&quot;;
+        basketsFolderName = filesFolderName + i18nc(&quot;HTML export folder (baskets)&quot;, &quot;baskets&quot;)  + &quot;/&quot;;
+    }
+    iconsFolderName   = (isSubBasket ? &quot;../&quot; : filesFolderName) + i18nc(&quot;HTML export folder (icons)&quot;,   &quot;icons&quot;)   + &quot;/&quot;; // eg.: &quot;foo.html_files/icons/&quot;   or &quot;../icons/&quot;
+    imagesFolderName  = (isSubBasket ? &quot;../&quot; : filesFolderName) + i18nc(&quot;HTML export folder (images)&quot;,  &quot;images&quot;)  + &quot;/&quot;; // eg.: &quot;foo.html_files/images/&quot;  or &quot;../images/&quot;
+
+    kDebug() &lt;&lt; &quot;Exporting ================================================&quot;;
+    kDebug() &lt;&lt; &quot;  filePath:&quot; &lt;&lt; filePath;
+    kDebug() &lt;&lt; &quot;  basketFilePath:&quot; &lt;&lt; basketFilePath;
+    kDebug() &lt;&lt; &quot;  filesFolderPath:&quot; &lt;&lt; filesFolderPath;
+    kDebug() &lt;&lt; &quot;  filesFolderName:&quot; &lt;&lt; filesFolderName;
+    kDebug() &lt;&lt; &quot;  iconsFolderPath:&quot; &lt;&lt; iconsFolderPath;
+    kDebug() &lt;&lt; &quot;  iconsFolderName:&quot; &lt;&lt; iconsFolderName;
+    kDebug() &lt;&lt; &quot;  imagesFolderPath:&quot; &lt;&lt; imagesFolderPath;
+    kDebug() &lt;&lt; &quot;  imagesFolderName:&quot; &lt;&lt; imagesFolderName;
+    kDebug() &lt;&lt; &quot;  dataFolderPath:&quot; &lt;&lt; dataFolderPath;
+    kDebug() &lt;&lt; &quot;  dataFolderName:&quot; &lt;&lt; dataFolderName;
+    kDebug() &lt;&lt; &quot;  basketsFolderPath:&quot; &lt;&lt; basketsFolderPath;
+    kDebug() &lt;&lt; &quot;  basketsFolderName:&quot; &lt;&lt; basketsFolderName;
+
+    // Create the data folder for this basket:
+    QDir dir;
+    dir.mkdir(dataFolderPath);
+
+    backgroundColorName = basket-&gt;backgroundColor().name().toLower().mid(1);
+
+    // Generate basket icons:
+    QString basketIcon16 = iconsFolderName + copyIcon(basket-&gt;icon(), 16);
+    QString basketIcon32 = iconsFolderName + copyIcon(basket-&gt;icon(), 32);
+
+    // Generate the [+] image for groups:
+    QPixmap expandGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
+    expandGroup.fill(basket-&gt;backgroundColor());
+    QPainter painter(&amp;expandGroup);
+    Note::drawExpander(&amp;painter, 0, 0, basket-&gt;backgroundColor(), /*expand=*/true, basket);
+    painter.end();
+    expandGroup.save(imagesFolderPath + &quot;expand_group_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
+
+    // Generate the [-] image for groups:
+    QPixmap foldGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
+    foldGroup.fill(basket-&gt;backgroundColor());
+    painter.begin(&amp;foldGroup);
+    Note::drawExpander(&amp;painter, 0, 0, basket-&gt;backgroundColor(), /*expand=*/false, basket);
+    painter.end();
+    foldGroup.save(imagesFolderPath + &quot;fold_group_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
+
+    // Open the file to write:
+    QFile file(basketFilePath);
+    if (!file.open(QIODevice::WriteOnly))
+        return;
+    stream.setDevice(&amp;file);
+    stream.setCodec(&quot;UTF-8&quot;);
+
+    // Compute the colors to draw dragient for notes:
+    QColor topBgColor;
+    QColor bottomBgColor;
+    Note::getGradientColors(basket-&gt;backgroundColor(), &amp;topBgColor, &amp;bottomBgColor);
+    // Compute the gradient image for notes:
+    QString gradientImageFileName = Basket::saveGradientBackground(basket-&gt;backgroundColor(), basket-&gt;Q3ScrollView::font(), imagesFolderPath);
+
+    // Output the header:
+    QString borderColor = Tools::mixColor(basket-&gt;backgroundColor(), basket-&gt;textColor()).name();
+    stream &lt;&lt;
+    &quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot; \&quot;http://www.w3.org/TR/html4/strict.dtd\&quot;&gt;\n&quot;
+    &quot;&lt;html&gt;\n&quot;
+    &quot; &lt;head&gt;\n&quot;
+    &quot;  &lt;meta http-equiv=\&quot;Content-Type\&quot; content=\&quot;text/html; charset=UTF-8\&quot;&gt;\n&quot;
+    &quot;  &lt;meta name=\&quot;Generator\&quot; content=\&quot;&quot; &lt;&lt; KGlobal::mainComponent().aboutData()-&gt;programName() &lt;&lt; &quot; &quot; &lt;&lt; VERSION &lt;&lt; &quot; http://basket.kde.org/\&quot;&gt;\n&quot;
+    &quot;  &lt;style type=\&quot;text/css\&quot;&gt;\n&quot;
+//      &quot;   @media print {\n&quot;
+//      &quot;    span.printable { display: inline; }\n&quot;
+//      &quot;   }\n&quot;
+    &quot;   body { margin: 10px; font: 11px sans-serif; }\n&quot; // TODO: Use user font
+    &quot;   h1 { text-align: center; }\n&quot;
+    &quot;   img { border: none; vertical-align: middle; }\n&quot;;
+    if (withBasketTree) {
+        stream &lt;&lt;
+        &quot;   .tree { margin: 0; padding: 1px 0 1px 1px; width: 150px; _width: 149px; overflow: hidden; float: left; }\n&quot;
+        &quot;   .tree ul { margin: 0 0 0 10px; padding: 0; }\n&quot;
+        &quot;   .tree li { padding: 0; margin: 0; list-style: none; }\n&quot;
+        &quot;   .tree a { display: block; padding: 1px; height: 16px; text-decoration: none;\n&quot;
+        &quot;             white-space: nowrap; word-wrap: normal; text-wrap: suppress; color: black; }\n&quot;
+        &quot;   .tree span { -moz-border-radius: 6px; display: block; float: left;\n&quot;
+        &quot;                line-height: 16px; height: 16px; vertical-align: middle; padding: 0 1px; }\n&quot;
+        &quot;   .tree img { vertical-align: top; padding-right: 1px; }\n&quot;
+        &quot;   .tree .current { background-color: &quot; &lt;&lt; kapp-&gt;palette().color(QPalette::Highlight).name() &lt;&lt; &quot;; &quot;
+        &quot;-moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; color: &quot; &lt;&lt; kapp-&gt;palette().color(QPalette::Highlight).name() &lt;&lt; &quot;; }\n&quot;
+        &quot;   .basketSurrounder { margin-left: 152px; _margin: 0; _float: right; }\n&quot;;
+    }
+    stream &lt;&lt;
+    &quot;   .basket { background-color: &quot; &lt;&lt; basket-&gt;backgroundColor().name() &lt;&lt; &quot;; border: solid &quot; &lt;&lt; borderColor &lt;&lt; &quot; 1px; &quot;
+    &quot;font: &quot; &lt;&lt; Tools::cssFontDefinition(basket-&gt;Q3ScrollView::font()) &lt;&lt; &quot;; color: &quot; &lt;&lt; basket-&gt;textColor().name() &lt;&lt; &quot;; padding: 1px; width: 100%; }\n&quot;
+    &quot;   table.basket { border-collapse: collapse; }\n&quot;
+    &quot;   .basket * { padding: 0; margin: 0; }\n&quot;
+    &quot;   .basket table { width: 100%; border-spacing: 0; _border-collapse: collapse; }\n&quot;
+    &quot;   .column { vertical-align: top; }\n&quot;
+    &quot;   .columnHandle { width: &quot; &lt;&lt; Note::RESIZER_WIDTH &lt;&lt; &quot;px; background: transparent url('&quot; &lt;&lt; imagesFolderName &lt;&lt; &quot;column_handle_&quot; &lt;&lt; backgroundColorName &lt;&lt; &quot;.png') repeat-y; }\n&quot;
+    &quot;   .group { margin: 0; padding: 0; border-collapse: collapse; width: 100% }\n&quot;
+    &quot;   .groupHandle { margin: 0; width: &quot; &lt;&lt; Note::GROUP_WIDTH &lt;&lt; &quot;px; text-align: center; }\n&quot;
+    &quot;   .note { padding: 1px 2px; background: &quot; &lt;&lt; bottomBgColor.name() &lt;&lt; &quot; url('&quot; &lt;&lt; imagesFolderName &lt;&lt; gradientImageFileName &lt;&lt; &quot;')&quot;
+    &quot; repeat-x; border-top: solid &quot; &lt;&lt; topBgColor.name() &lt;&lt;
+    &quot; 1px; border-bottom: solid &quot; &lt;&lt; Tools::mixColor(topBgColor, bottomBgColor).name() &lt;&lt;
+    &quot; 1px; width: 100%; }\n&quot;
+    &quot;   .tags { width: 1px; white-space: nowrap; }\n&quot;
+    &quot;   .tags img { padding-right: 2px; }\n&quot;
+    &lt;&lt; LinkLook::soundLook-&gt;toCSS(&quot;sound&quot;, basket-&gt;textColor())
+    &lt;&lt; LinkLook::fileLook-&gt;toCSS(&quot;file&quot;, basket-&gt;textColor())
+    &lt;&lt; LinkLook::localLinkLook-&gt;toCSS(&quot;local&quot;, basket-&gt;textColor())
+    &lt;&lt; LinkLook::networkLinkLook-&gt;toCSS(&quot;network&quot;, basket-&gt;textColor())
+    &lt;&lt; LinkLook::launcherLook-&gt;toCSS(&quot;launcher&quot;, basket-&gt;textColor())
+    &lt;&lt;
+    &quot;   .unknown { margin: 1px 2px; border: 1px solid &quot; &lt;&lt; borderColor &lt;&lt; &quot;; -moz-border-radius: 4px; }\n&quot;;
+    QList&lt;State*&gt; states = basket-&gt;usedStates();
+    QString statesCss;
+    for (State::List::Iterator it = states.begin(); it != states.end(); ++it)
+        statesCss += (*it)-&gt;toCSS(imagesFolderPath, imagesFolderName, basket-&gt;Q3ScrollView::font());
+    stream &lt;&lt;
+    statesCss &lt;&lt;
+    &quot;   .credits { text-align: right; margin: 3px 0 0 0; _margin-top: -17px; font-size: 80%; color: &quot; &lt;&lt; borderColor &lt;&lt; &quot;; }\n&quot;
+    &quot;  &lt;/style&gt;\n&quot;
+    &quot;  &lt;title&gt;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/title&gt;\n&quot;
+    &quot;  &lt;link rel=\&quot;shortcut icon\&quot; type=\&quot;image/png\&quot; href=\&quot;&quot; &lt;&lt; basketIcon16 &lt;&lt; &quot;\&quot;&gt;\n&quot;;
+    // Create the column handle image:
+    QPixmap columnHandle(Note::RESIZER_WIDTH, 50);
+    painter.begin(&amp;columnHandle);
+    Note::drawInactiveResizer(&amp;painter, 0, 0, columnHandle.height(), basket-&gt;backgroundColor(), /*column=*/true);
+    painter.end();
+    columnHandle.save(imagesFolderPath + &quot;column_handle_&quot; + backgroundColorName + &quot;.png&quot;, &quot;PNG&quot;);
+
+    stream &lt;&lt;
+    &quot; &lt;/head&gt;\n&quot;
+    &quot; &lt;body&gt;\n&quot;
+    &quot;  &lt;h1&gt;&lt;img src=\&quot;&quot; &lt;&lt; basketIcon32 &lt;&lt; &quot;\&quot; width=\&quot;32\&quot; height=\&quot;32\&quot; alt=\&quot;\&quot;&gt; &quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/h1&gt;\n&quot;;
+
+    if (withBasketTree)
+        writeBasketTree(basket);
+
+    // If filtering, only export filtered notes, inform to the user:
+    // TODO: Filtering tags too!!
+    // TODO: Make sure only filtered notes are exported!
+//  if (decoration()-&gt;filterData().isFiltering)
+//      stream &lt;&lt;
+//          &quot;  &lt;p&gt;&quot; &lt;&lt; i18n(&quot;Notes matching the filter &amp;quot;%1&amp;quot;:&quot;).arg(Tools::textToHTMLWithoutP(decoration()-&gt;filterData().string)) &lt;&lt; &quot;&lt;/p&gt;\n&quot;;
+
+    stream &lt;&lt;
+    &quot;  &lt;div class=\&quot;basketSurrounder\&quot;&gt;\n&quot;;
+
+    if (basket-&gt;isColumnsLayout())
+        stream &lt;&lt;
+        &quot;   &lt;table class=\&quot;basket\&quot;&gt;\n&quot;
+        &quot;    &lt;tr&gt;\n&quot;;
+    else
+        stream &lt;&lt;
+        &quot;   &lt;div class=\&quot;basket\&quot; style=\&quot;position: relative; height: &quot; &lt;&lt; basket-&gt;contentsHeight() &lt;&lt; &quot;px; width: &quot; &lt;&lt; basket-&gt;contentsWidth() &lt;&lt; &quot;px; min-width: 100%;\&quot;&gt;\n&quot;;
+
+    for (Note *note = basket-&gt;firstNote(); note; note = note-&gt;next())
+        exportNote(note, /*indent=*/(basket-&gt;isFreeLayout() ? 4 : 5));
+
+    // Output the footer:
+    if (basket-&gt;isColumnsLayout())
+        stream &lt;&lt;
+        &quot;    &lt;/tr&gt;\n&quot;
+        &quot;   &lt;/table&gt;\n&quot;;
+    else
+        stream &lt;&lt;
+        &quot;   &lt;/div&gt;\n&quot;;
+    stream &lt;&lt; QString(
+        &quot;  &lt;/div&gt;\n&quot;
+        &quot;  &lt;p class=\&quot;credits\&quot;&gt;%1&lt;/p&gt;\n&quot;).arg(
+            i18n(&quot;Made with &lt;a href=\&quot;http://basket.kde.org/\&quot;&gt;%1&lt;/a&gt; %2, a KDE tool to take notes and keep information at hand.&quot;,
+                 KGlobal::mainComponent().aboutData()-&gt;programName(), VERSION));
+
+    // Copy a transparent GIF image in the folder, needed for the JavaScript hack:
+    QString gifFileName = &quot;spacer.gif&quot;;
+    QFile transGIF(imagesFolderPath + gifFileName);
+    if (!transGIF.exists() &amp;&amp; transGIF.open(QIODevice::WriteOnly)) {
+        QDataStream streamGIF(&amp;transGIF);
+        // This is a 1px*1px transparent GIF image:
+        const char blankGIF[] = {
+            0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0a, 0x00, 0x0a, 0x00,
+            0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x21,
+            0xfe, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,
+            0x77, 0x69, 0x74, 0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47,
+            0x49, 0x4d, 0x50, 0x00, 0x21, 0xf9, 0x04, 0x01, 0x0a, 0x00,
+            0x01, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a,
+            0x00, 0x00, 0x02, 0x08, 0x8c, 0x8f, 0xa9, 0xcb, 0xed, 0x0f,
+            0x63, 0x2b, 0x00, 0x3b
+        };
+        streamGIF.writeRawData(blankGIF, 74);
+        transGIF.close();
+    }
+    stream &lt;&lt;
+    &quot;  &lt;!--[if lt IE 7]&gt;\n&quot;
+    &quot;   &lt;script&gt;\n&quot;
+    &quot;    function fixPng(img) {\n&quot;
+    &quot;     if (!img.style.filter) {\n&quot;
+    &quot;      img.style.filter = \&quot;progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\&quot; + img.src + \&quot;')\&quot;;\n&quot;
+    &quot;      img.src = \&quot;&quot; &lt;&lt; imagesFolderName &lt;&lt; gifFileName &lt;&lt; &quot;\&quot;;\n&quot;
+    &quot;     }\n&quot;
+    &quot;    }\n&quot;
+    &quot;    for (i = document.images.length - 1; i &gt;= 0; i -= 1) {\n&quot;
+    &quot;     var img = document.images[i];\n&quot;
+    &quot;     if (img.src.substr(img.src.length - 4) == \&quot;.png\&quot;)\n&quot;
+    &quot;      if (img.complete)\n&quot;
+    &quot;       fixPng(img);\n&quot;
+    &quot;      else\n&quot;
+    &quot;       img.attachEvent(\&quot;onload\&quot;, function() { fixPng(window.event.srcElement); });\n&quot;
+    &quot;    }\n&quot;
+    &quot;   &lt;/script&gt;\n&quot;
+    &quot;  &lt;![endif]--&gt;\n&quot;
+    &quot; &lt;/body&gt;\n&quot;
+    &quot;&lt;/html&gt;\n&quot;;
+
+    file.close();
+    stream.setDevice(0);
+    progress-&gt;setValue(progress-&gt;value() + 1); // Basket exportation finished
+
+    // Recursively export child baskets:
+    BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
+    if (item-&gt;childCount() &gt;= 0) {
+        for (int i = 0; i &lt; item-&gt;childCount(); i++) {
+            exportBasket(((BasketListViewItem *)item-&gt;child(i))-&gt;basket(), /*isSubBasket=*/true);
+        }
+    }
 }
 
 void HTMLExporter::exportNote(Note *note, int indent)
 {
-	QString spaces;
-
-	if (note-&gt;isColumn()) {
-		QString width = &quot;&quot;;
-		if (false/*TODO: DEBUG AND REENABLE: hasResizer()*/) {
-			// As we cannot be precise in CSS (say eg. &quot;width: 50%-40px;&quot;),
-			// we output a percentage that is approximatively correct.
-			// For instance, we compute the currently used percentage of width in the basket
-			// and try make make it the same on a 1024*768 display in a Web browser:
-			int availableSpaceForColumnsInThisBasket = note-&gt;basket()-&gt;contentsWidth() - (note-&gt;basket()-&gt;columnsCount() - 1) * Note::RESIZER_WIDTH;
-			int availableSpaceForColumnsInBrowser    = 1024    /* typical screen width */
-			                                           - 25    /* window border and scrollbar width */
-			                                           - 2 * 5 /* page margin */
-			                                           - (note-&gt;basket()-&gt;columnsCount() - 1) * Note::RESIZER_WIDTH;
-			if (availableSpaceForColumnsInThisBasket &lt;= 0)
-				availableSpaceForColumnsInThisBasket = 1;
-			int widthValue = (int)(availableSpaceForColumnsInBrowser * (double) note-&gt;groupWidth() / availableSpaceForColumnsInThisBasket);
-			if (widthValue &lt;= 0)
-				widthValue = 1;
-			if (widthValue &gt; 100)
-				widthValue = 100;
-			width = QString(&quot; width=\&quot;%1%\&quot;&quot;).arg(QString::number(widthValue));
-		}
-		stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;td class=\&quot;column\&quot;&quot; &lt;&lt; width &lt;&lt; &quot;&gt;\n&quot;;
-
-		// Export child notes:
-		for (Note *child = note-&gt;firstChild(); child; child = child-&gt;next()) {
-			stream &lt;&lt; spaces.fill(' ', indent + 1);
-			exportNote(child, indent + 1);
-			stream &lt;&lt; '\n';
-		}
-
-		stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/td&gt;\n&quot;;
-		if (note-&gt;hasResizer())
-			stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;td class=\&quot;columnHandle\&quot;&gt;&lt;/td&gt;\n&quot;;
-		return;
-	}
-
-	QString freeStyle;
-	if (note-&gt;isFree())
-		freeStyle = &quot; style=\&quot;position: absolute; left: &quot; + QString::number(note-&gt;x()) + &quot;px; top: &quot; + QString::number(note-&gt;y()) + &quot;px; width: &quot; + QString::number(note-&gt;groupWidth()) + &quot;px\&quot;&quot;;
-
-	if (note-&gt;isGroup()) {
-		stream &lt;&lt; '\n' &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;table&quot; &lt;&lt; freeStyle &lt;&lt; &quot;&gt;\n&quot;; // Note content is expected to be on the same HTML line, but NOT groups
-		int i = 0;
-		for (Note *child = note-&gt;firstChild(); child; child = child-&gt;next()) {
-			stream &lt;&lt; spaces.fill(' ', indent);
-			if (i == 0)
-				stream &lt;&lt; &quot; &lt;tr&gt;&lt;td class=\&quot;groupHandle\&quot;&gt;&lt;img src=\&quot;&quot; &lt;&lt; imagesFolderName &lt;&lt; (note-&gt;isFolded() ? &quot;expand_group_&quot; : &quot;fold_group_&quot;) &lt;&lt; backgroundColorName &lt;&lt; &quot;.png&quot;
-				       &lt;&lt; &quot;\&quot; width=\&quot;&quot; &lt;&lt; Note::EXPANDER_WIDTH &lt;&lt; &quot;\&quot; height=\&quot;&quot; &lt;&lt; Note::EXPANDER_HEIGHT &lt;&lt; &quot;\&quot;&gt;&lt;/td&gt;\n&quot;;
-			else if (i == 1)
-				stream &lt;&lt; &quot; &lt;tr&gt;&lt;td class=\&quot;freeSpace\&quot; rowspan=\&quot;&quot; &lt;&lt; note-&gt;countDirectChilds() &lt;&lt; &quot;\&quot;&gt;&lt;/td&gt;\n&quot;;
-			else
-				stream &lt;&lt; &quot; &lt;tr&gt;\n&quot;;
-			stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;  &lt;td&gt;&quot;;
-			exportNote(child, indent + 3);
-			stream &lt;&lt; &quot;&lt;/td&gt;\n&quot;
-			       &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot; &lt;/tr&gt;\n&quot;;
-			++i;
-		}
-		stream &lt;&lt; '\n' &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/table&gt;\n&quot; /*&lt;&lt; spaces.fill(' ', indent - 1)*/;
-	} else {
-		// Additionnal class for the content (link, netword, color...):
-		QString additionnalClasses = note-&gt;content()-&gt;cssClass();
-		if (!additionnalClasses.isEmpty())
-			additionnalClasses = &quot; &quot; + additionnalClasses;
-		// Assign the style of each associted tags:
-		for (State::List::Iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
-			additionnalClasses += &quot; tag_&quot; + (*it)-&gt;id();
-		//stream &lt;&lt; spaces.fill(' ', indent);
-		stream &lt;&lt; &quot;&lt;table class=\&quot;note&quot; &lt;&lt; additionnalClasses &lt;&lt; &quot;\&quot;&quot; &lt;&lt; freeStyle &lt;&lt; &quot;&gt;&lt;tr&gt;&quot;;
-		if (note-&gt;emblemsCount() &gt; 0) {
-			stream &lt;&lt; &quot;&lt;td class=\&quot;tags\&quot;&gt;&lt;nobr&gt;&quot;;
-			for (State::List::Iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
-				if (!(*it)-&gt;emblem().isEmpty()) {
-					int emblemSize = 16;
-					QString iconFileName = copyIcon((*it)-&gt;emblem(), emblemSize);
-					stream &lt;&lt; &quot;&lt;img src=\&quot;&quot; &lt;&lt; iconsFolderName &lt;&lt; iconFileName
-					       &lt;&lt; &quot;\&quot; width=\&quot;&quot; &lt;&lt; emblemSize &lt;&lt; &quot;\&quot; height=\&quot;&quot; &lt;&lt; emblemSize
-					       &lt;&lt; &quot;\&quot; alt=\&quot;&quot; &lt;&lt; (*it)-&gt;textEquivalent() &lt;&lt; &quot;\&quot; title=\&quot;&quot; &lt;&lt; (*it)-&gt;fullName() &lt;&lt; &quot;\&quot;&gt;&quot;;
-				}
-				stream &lt;&lt; &quot;&lt;/nobr&gt;&lt;/td&gt;&quot;;
-		}
-		stream &lt;&lt; &quot;&lt;td&gt;&quot;;
-		note-&gt;content()-&gt;exportToHTML(this, indent);
-		stream &lt;&lt; &quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;;
-	}
+    QString spaces;
+
+    if (note-&gt;isColumn()) {
+        QString width = &quot;&quot;;
+        if (false/*TODO: DEBUG AND REENABLE: hasResizer()*/) {
+            // As we cannot be precise in CSS (say eg. &quot;width: 50%-40px;&quot;),
+            // we output a percentage that is approximatively correct.
+            // For instance, we compute the currently used percentage of width in the basket
+            // and try make make it the same on a 1024*768 display in a Web browser:
+            int availableSpaceForColumnsInThisBasket = note-&gt;basket()-&gt;contentsWidth() - (note-&gt;basket()-&gt;columnsCount() - 1) * Note::RESIZER_WIDTH;
+            int availableSpaceForColumnsInBrowser    = 1024    /* typical screen width */
+                    - 25    /* window border and scrollbar width */
+                    - 2 * 5 /* page margin */
+                    - (note-&gt;basket()-&gt;columnsCount() - 1) * Note::RESIZER_WIDTH;
+            if (availableSpaceForColumnsInThisBasket &lt;= 0)
+                availableSpaceForColumnsInThisBasket = 1;
+            int widthValue = (int)(availableSpaceForColumnsInBrowser * (double) note-&gt;groupWidth() / availableSpaceForColumnsInThisBasket);
+            if (widthValue &lt;= 0)
+                widthValue = 1;
+            if (widthValue &gt; 100)
+                widthValue = 100;
+            width = QString(&quot; width=\&quot;%1%\&quot;&quot;).arg(QString::number(widthValue));
+        }
+        stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;td class=\&quot;column\&quot;&quot; &lt;&lt; width &lt;&lt; &quot;&gt;\n&quot;;
+
+        // Export child notes:
+        for (Note *child = note-&gt;firstChild(); child; child = child-&gt;next()) {
+            stream &lt;&lt; spaces.fill(' ', indent + 1);
+            exportNote(child, indent + 1);
+            stream &lt;&lt; '\n';
+        }
+
+        stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/td&gt;\n&quot;;
+        if (note-&gt;hasResizer())
+            stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;td class=\&quot;columnHandle\&quot;&gt;&lt;/td&gt;\n&quot;;
+        return;
+    }
+
+    QString freeStyle;
+    if (note-&gt;isFree())
+        freeStyle = &quot; style=\&quot;position: absolute; left: &quot; + QString::number(note-&gt;x()) + &quot;px; top: &quot; + QString::number(note-&gt;y()) + &quot;px; width: &quot; + QString::number(note-&gt;groupWidth()) + &quot;px\&quot;&quot;;
+
+    if (note-&gt;isGroup()) {
+        stream &lt;&lt; '\n' &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;table&quot; &lt;&lt; freeStyle &lt;&lt; &quot;&gt;\n&quot;; // Note content is expected to be on the same HTML line, but NOT groups
+        int i = 0;
+        for (Note *child = note-&gt;firstChild(); child; child = child-&gt;next()) {
+            stream &lt;&lt; spaces.fill(' ', indent);
+            if (i == 0)
+                stream &lt;&lt; &quot; &lt;tr&gt;&lt;td class=\&quot;groupHandle\&quot;&gt;&lt;img src=\&quot;&quot; &lt;&lt; imagesFolderName &lt;&lt; (note-&gt;isFolded() ? &quot;expand_group_&quot; : &quot;fold_group_&quot;) &lt;&lt; backgroundColorName &lt;&lt; &quot;.png&quot;
+                &lt;&lt; &quot;\&quot; width=\&quot;&quot; &lt;&lt; Note::EXPANDER_WIDTH &lt;&lt; &quot;\&quot; height=\&quot;&quot; &lt;&lt; Note::EXPANDER_HEIGHT &lt;&lt; &quot;\&quot;&gt;&lt;/td&gt;\n&quot;;
+            else if (i == 1)
+                stream &lt;&lt; &quot; &lt;tr&gt;&lt;td class=\&quot;freeSpace\&quot; rowspan=\&quot;&quot; &lt;&lt; note-&gt;countDirectChilds() &lt;&lt; &quot;\&quot;&gt;&lt;/td&gt;\n&quot;;
+            else
+                stream &lt;&lt; &quot; &lt;tr&gt;\n&quot;;
+            stream &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;  &lt;td&gt;&quot;;
+            exportNote(child, indent + 3);
+            stream &lt;&lt; &quot;&lt;/td&gt;\n&quot;
+            &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot; &lt;/tr&gt;\n&quot;;
+            ++i;
+        }
+        stream &lt;&lt; '\n' &lt;&lt; spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/table&gt;\n&quot; /*&lt;&lt; spaces.fill(' ', indent - 1)*/;
+    } else {
+        // Additionnal class for the content (link, netword, color...):
+        QString additionnalClasses = note-&gt;content()-&gt;cssClass();
+        if (!additionnalClasses.isEmpty())
+            additionnalClasses = &quot; &quot; + additionnalClasses;
+        // Assign the style of each associted tags:
+        for (State::List::Iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
+            additionnalClasses += &quot; tag_&quot; + (*it)-&gt;id();
+        //stream &lt;&lt; spaces.fill(' ', indent);
+        stream &lt;&lt; &quot;&lt;table class=\&quot;note&quot; &lt;&lt; additionnalClasses &lt;&lt; &quot;\&quot;&quot; &lt;&lt; freeStyle &lt;&lt; &quot;&gt;&lt;tr&gt;&quot;;
+        if (note-&gt;emblemsCount() &gt; 0) {
+            stream &lt;&lt; &quot;&lt;td class=\&quot;tags\&quot;&gt;&lt;nobr&gt;&quot;;
+            for (State::List::Iterator it = note-&gt;states().begin(); it != note-&gt;states().end(); ++it)
+                if (!(*it)-&gt;emblem().isEmpty()) {
+                    int emblemSize = 16;
+                    QString iconFileName = copyIcon((*it)-&gt;emblem(), emblemSize);
+                    stream &lt;&lt; &quot;&lt;img src=\&quot;&quot; &lt;&lt; iconsFolderName &lt;&lt; iconFileName
+                    &lt;&lt; &quot;\&quot; width=\&quot;&quot; &lt;&lt; emblemSize &lt;&lt; &quot;\&quot; height=\&quot;&quot; &lt;&lt; emblemSize
+                    &lt;&lt; &quot;\&quot; alt=\&quot;&quot; &lt;&lt; (*it)-&gt;textEquivalent() &lt;&lt; &quot;\&quot; title=\&quot;&quot; &lt;&lt; (*it)-&gt;fullName() &lt;&lt; &quot;\&quot;&gt;&quot;;
+                }
+            stream &lt;&lt; &quot;&lt;/nobr&gt;&lt;/td&gt;&quot;;
+        }
+        stream &lt;&lt; &quot;&lt;td&gt;&quot;;
+        note-&gt;content()-&gt;exportToHTML(this, indent);
+        stream &lt;&lt; &quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;;
+    }
 }
 
 void HTMLExporter::writeBasketTree(Basket *currentBasket)
 {
-	stream &lt;&lt; &quot;  &lt;ul class=\&quot;tree\&quot;&gt;\n&quot;;
-	writeBasketTree(currentBasket, exportedBasket, 3);
-	stream &lt;&lt; &quot;  &lt;/ul&gt;\n&quot;;
+    stream &lt;&lt; &quot;  &lt;ul class=\&quot;tree\&quot;&gt;\n&quot;;
+    writeBasketTree(currentBasket, exportedBasket, 3);
+    stream &lt;&lt; &quot;  &lt;/ul&gt;\n&quot;;
 }
 
 void HTMLExporter::writeBasketTree(Basket *currentBasket, Basket *basket, int indent)
 {
-	// Compute variable HTML code:
-	QString spaces;
-	QString cssClass = (basket == currentBasket ? &quot; class=\&quot;current\&quot;&quot; : &quot;&quot;);
-	QString link = &quot;#&quot;;
-	if (currentBasket != basket) {
-		if (currentBasket == exportedBasket) {
-			link = basketsFolderName + basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
-		} else if (basket == exportedBasket) {
-			link = &quot;../../&quot; + fileName;
-		} else {
-			link = basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
-		}
-	}
-	QString spanStyle = &quot;&quot;;
-	if (basket-&gt;backgroundColorSetting().isValid() || basket-&gt;textColorSetting().isValid()) {
-		spanStyle = &quot; style=\&quot;background-color: &quot; + basket-&gt;backgroundColor().name() + &quot;; color: &quot; + basket-&gt;textColor().name() + &quot;\&quot;&quot;;
-	}
-
-	// Write the basket tree line:
-	stream &lt;&lt;
-		spaces.fill(' ', indent) &lt;&lt; &quot;&lt;li&gt;&lt;a&quot; &lt;&lt; cssClass &lt;&lt; &quot; href=\&quot;&quot; &lt;&lt; link &lt;&lt; &quot;\&quot;&gt;&quot;
-		&quot;&lt;span&quot; &lt;&lt; spanStyle &lt;&lt; &quot; title=\&quot;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;\&quot;&gt;&quot;
-		&quot;&lt;img src=\&quot;&quot; &lt;&lt; iconsFolderName &lt;&lt;  copyIcon(basket-&gt;icon(), 16) &lt;&lt; &quot;\&quot; width=\&quot;16\&quot; height=\&quot;16\&quot; alt=\&quot;\&quot;&gt;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/span&gt;&lt;/a&gt;&quot;;
-
-	// Write the sub-baskets lines &amp; end the current one:
-	BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
-	if (item-&gt;childCount() &gt;= 0) {
-		stream &lt;&lt;
-			&quot;\n&quot; &lt;&lt;
-			spaces.fill(' ', indent) &lt;&lt; &quot; &lt;ul&gt;\n&quot;;
-		for (int i=0;i&lt;item-&gt;childCount();i++)
-			writeBasketTree(currentBasket, ((BasketListViewItem*)item-&gt;child(i))-&gt;basket(), indent + 2);
-		stream &lt;&lt;
-			spaces.fill(' ', indent) &lt;&lt; &quot; &lt;/ul&gt;\n&quot; &lt;&lt;
-			spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/li&gt;\n&quot;;
-	} else {
-		stream &lt;&lt; &quot;&lt;/li&gt;\n&quot;;
-	}
+    // Compute variable HTML code:
+    QString spaces;
+    QString cssClass = (basket == currentBasket ? &quot; class=\&quot;current\&quot;&quot; : &quot;&quot;);
+    QString link = &quot;#&quot;;
+    if (currentBasket != basket) {
+        if (currentBasket == exportedBasket) {
+            link = basketsFolderName + basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
+        } else if (basket == exportedBasket) {
+            link = &quot;../../&quot; + fileName;
+        } else {
+            link = basket-&gt;folderName().left(basket-&gt;folderName().length() - 1) + &quot;.html&quot;;
+        }
+    }
+    QString spanStyle = &quot;&quot;;
+    if (basket-&gt;backgroundColorSetting().isValid() || basket-&gt;textColorSetting().isValid()) {
+        spanStyle = &quot; style=\&quot;background-color: &quot; + basket-&gt;backgroundColor().name() + &quot;; color: &quot; + basket-&gt;textColor().name() + &quot;\&quot;&quot;;
+    }
+
+    // Write the basket tree line:
+    stream &lt;&lt;
+    spaces.fill(' ', indent) &lt;&lt; &quot;&lt;li&gt;&lt;a&quot; &lt;&lt; cssClass &lt;&lt; &quot; href=\&quot;&quot; &lt;&lt; link &lt;&lt; &quot;\&quot;&gt;&quot;
+    &quot;&lt;span&quot; &lt;&lt; spanStyle &lt;&lt; &quot; title=\&quot;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;\&quot;&gt;&quot;
+    &quot;&lt;img src=\&quot;&quot; &lt;&lt; iconsFolderName &lt;&lt;  copyIcon(basket-&gt;icon(), 16) &lt;&lt; &quot;\&quot; width=\&quot;16\&quot; height=\&quot;16\&quot; alt=\&quot;\&quot;&gt;&quot; &lt;&lt; Tools::textToHTMLWithoutP(basket-&gt;basketName()) &lt;&lt; &quot;&lt;/span&gt;&lt;/a&gt;&quot;;
+
+    // Write the sub-baskets lines &amp; end the current one:
+    BasketListViewItem *item = Global::bnpView-&gt;listViewItemForBasket(basket);
+    if (item-&gt;childCount() &gt;= 0) {
+        stream &lt;&lt;
+        &quot;\n&quot; &lt;&lt;
+        spaces.fill(' ', indent) &lt;&lt; &quot; &lt;ul&gt;\n&quot;;
+        for (int i = 0; i &lt; item-&gt;childCount(); i++)
+            writeBasketTree(currentBasket, ((BasketListViewItem*)item-&gt;child(i))-&gt;basket(), indent + 2);
+        stream &lt;&lt;
+        spaces.fill(' ', indent) &lt;&lt; &quot; &lt;/ul&gt;\n&quot; &lt;&lt;
+        spaces.fill(' ', indent) &lt;&lt; &quot;&lt;/li&gt;\n&quot;;
+    } else {
+        stream &lt;&lt; &quot;&lt;/li&gt;\n&quot;;
+    }
 }
 
 /** Save an icon to a folder.
@@ -525,16 +526,16 @@ void HTMLExporter::writeBasketTree(Basket *currentBasket, Basket *basket, int in
   */
 QString HTMLExporter::copyIcon(const QString &amp;iconName, int size)
 {
-	if (iconName.isEmpty())
-		return &quot;&quot;;
-
-	// Sometimes icon can be &quot;favicons/www.kde.org&quot;, we replace the '/' with a '_'
-	QString fileName = iconName; // QString::replace() isn't const, so I must copy the string before
-	fileName = &quot;ico&quot; + QString::number(size) + &quot;_&quot; + fileName.replace(&quot;/&quot;, &quot;_&quot;) + &quot;.png&quot;;
-	QString fullPath = iconsFolderPath + fileName;
-	if (!QFile::exists(fullPath))
-		DesktopIcon(iconName, size).save(fullPath, &quot;PNG&quot;);
-	return fileName;
+    if (iconName.isEmpty())
+        return &quot;&quot;;
+
+    // Sometimes icon can be &quot;favicons/www.kde.org&quot;, we replace the '/' with a '_'
+    QString fileName = iconName; // QString::replace() isn't const, so I must copy the string before
+    fileName = &quot;ico&quot; + QString::number(size) + &quot;_&quot; + fileName.replace(&quot;/&quot;, &quot;_&quot;) + &quot;.png&quot;;
+    QString fullPath = iconsFolderPath + fileName;
+    if (!QFile::exists(fullPath))
+        DesktopIcon(iconName, size).save(fullPath, &quot;PNG&quot;);
+    return fileName;
 }
 
 /** Done: Sometimes we can call two times copyFile() with the same srcPath and dataFolderPath
@@ -545,18 +546,18 @@ QString HTMLExporter::copyIcon(const QString &amp;iconName, int size)
   */
 QString HTMLExporter::copyFile(const QString &amp;srcPath, bool createIt)
 {
-	QString fileName = Tools::fileNameForNewFile(KUrl(srcPath).fileName(), dataFolderPath);
-	QString fullPath = dataFolderPath + fileName;
-
-	if (createIt) {
-		// We create the file to be sure another very near call to copyFile() willn't choose the same name:
-		QFile file(KUrl(fullPath).path());
-		if (file.open(QIODevice::WriteOnly))
-			file.close();
-		// And then we copy the file AND overwriting the file we juste created:
-        KIO::file_copy(KUrl(srcPath), KUrl(fullPath), 0666, KIO::HideProgressInfo| KIO::Resume | KIO::Overwrite);
-	} else
-		/*KIO::CopyJob *copyJob = */KIO::copy(KUrl(srcPath), KUrl(fullPath), KIO::DefaultFlags); // Do it as before
-
-	return fileName;
+    QString fileName = Tools::fileNameForNewFile(KUrl(srcPath).fileName(), dataFolderPath);
+    QString fullPath = dataFolderPath + fileName;
+
+    if (createIt) {
+        // We create the file to be sure another very near call to copyFile() willn't choose the same name:
+        QFile file(KUrl(fullPath).path());
+        if (file.open(QIODevice::WriteOnly))
+            file.close();
+        // And then we copy the file AND overwriting the file we juste created:
+        KIO::file_copy(KUrl(srcPath), KUrl(fullPath), 0666, KIO::HideProgressInfo | KIO::Resume | KIO::Overwrite);
+    } else
+        /*KIO::CopyJob *copyJob = */KIO::copy(KUrl(srcPath), KUrl(fullPath), KIO::DefaultFlags); // Do it as before
+
+    return fileName;
 }</diff>
      <filename>src/htmlexporter.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -34,46 +34,46 @@ class Note;
  */
 class HTMLExporter
 {
-  public:
-	HTMLExporter(Basket *basket);
-	~HTMLExporter();
-  private:
-	void prepareExport(Basket *basket, const QString &amp;fullPath);
-	void exportBasket(Basket *basket, bool isSubBasket);
-	void exportNote(Note *note, int indent);
-	void writeBasketTree(Basket *currentBasket);
-	void writeBasketTree(Basket *currentBasket, Basket *basket, int indent);
+public:
+    HTMLExporter(Basket *basket);
+    ~HTMLExporter();
+private:
+    void prepareExport(Basket *basket, const QString &amp;fullPath);
+    void exportBasket(Basket *basket, bool isSubBasket);
+    void exportNote(Note *note, int indent);
+    void writeBasketTree(Basket *currentBasket);
+    void writeBasketTree(Basket *currentBasket, Basket *basket, int indent);
 
-  public:
-	QString copyIcon(const QString &amp;iconName, int size);
-	QString copyFile(const QString &amp;srcPath, bool createIt);
+public:
+    QString copyIcon(const QString &amp;iconName, int size);
+    QString copyFile(const QString &amp;srcPath, bool createIt);
 
-  public:
-	// Absolute path of the file name the user choosen:
-	QString filePath;          // eg.: &quot;/home/seb/foo.html&quot;
-	QString fileName;          // eg.: &quot;foo.html&quot;
+public:
+    // Absolute path of the file name the user choosen:
+    QString filePath;          // eg.: &quot;/home/seb/foo.html&quot;
+    QString fileName;          // eg.: &quot;foo.html&quot;
 
-	// Absolute &amp; relative paths for the current basket to be exported:
-	QString basketFilePath;    // eg.: &quot;/home/seb/foo.html&quot; or &quot;/home/seb/foo.html_files/baskets/basketN.html&quot;
-	QString filesFolderPath;   // eg.: &quot;/home/seb/foo.html_files/&quot;
-	QString filesFolderName;   // eg.: &quot;foo.html_files/&quot; or &quot;../&quot;
-	QString iconsFolderPath;   // eg.: &quot;/home/seb/foo.html_files/icons/&quot;
-	QString iconsFolderName;   // eg.: &quot;foo.html_files/icons/&quot; or &quot;../icons/&quot;
-	QString imagesFolderPath;  // eg.: &quot;/home/seb/foo.html_files/images/&quot;
-	QString imagesFolderName;  // eg.: &quot;foo.html_files/images/&quot; or &quot;../images/&quot;
-	QString dataFolderPath;    // eg.: &quot;/home/seb/foo.html_files/data/&quot; or &quot;/home/seb/foo.html_files/baskets/basketN-data/&quot;
-	QString dataFolderName;    // eg.: &quot;foo.html_files/data/&quot; or &quot;basketN-data/&quot;
-	QString basketsFolderPath; // eg.: &quot;/home/seb/foo.html_files/baskets/&quot;
-	QString basketsFolderName; // eg.: &quot;foo.html_files/baskets/&quot; or &quot;&quot;
+    // Absolute &amp; relative paths for the current basket to be exported:
+    QString basketFilePath;    // eg.: &quot;/home/seb/foo.html&quot; or &quot;/home/seb/foo.html_files/baskets/basketN.html&quot;
+    QString filesFolderPath;   // eg.: &quot;/home/seb/foo.html_files/&quot;
+    QString filesFolderName;   // eg.: &quot;foo.html_files/&quot; or &quot;../&quot;
+    QString iconsFolderPath;   // eg.: &quot;/home/seb/foo.html_files/icons/&quot;
+    QString iconsFolderName;   // eg.: &quot;foo.html_files/icons/&quot; or &quot;../icons/&quot;
+    QString imagesFolderPath;  // eg.: &quot;/home/seb/foo.html_files/images/&quot;
+    QString imagesFolderName;  // eg.: &quot;foo.html_files/images/&quot; or &quot;../images/&quot;
+    QString dataFolderPath;    // eg.: &quot;/home/seb/foo.html_files/data/&quot; or &quot;/home/seb/foo.html_files/baskets/basketN-data/&quot;
+    QString dataFolderName;    // eg.: &quot;foo.html_files/data/&quot; or &quot;basketN-data/&quot;
+    QString basketsFolderPath; // eg.: &quot;/home/seb/foo.html_files/baskets/&quot;
+    QString basketsFolderName; // eg.: &quot;foo.html_files/baskets/&quot; or &quot;&quot;
 
-	// Various properties of the currently exporting basket:
-	QString backgroundColorName;
+    // Various properties of the currently exporting basket:
+    QString backgroundColorName;
 
-	// Variables used by every export methods:
-	QTextStream stream;
-	Basket *exportedBasket;
-	bool withBasketTree;
-	QProgressBar *progress;
+    // Variables used by every export methods:
+    QTextStream stream;
+    Basket *exportedBasket;
+    bool withBasketTree;
+    QProgressBar *progress;
 };
 
 #endif // HTMLEXPORTER_H</diff>
      <filename>src/htmlexporter.h</filename>
    </modified>
    <modified>
      <diff>@@ -26,47 +26,37 @@
 //----------------------------
 // KCM stuff
 //----------------------------
-extern &quot;C&quot;
-{
-	KDE_EXPORT KCModule *create_basket_config_general(QWidget *parent, const char *)
-	{
-		GeneralPage *page = new GeneralPage(parent, &quot;kcmbasket_config_general&quot;);
-		return page;
-	}
+extern &quot;C&quot; {
+    KDE_EXPORT KCModule *create_basket_config_general(QWidget *parent, const char *) {
+        GeneralPage *page = new GeneralPage(parent, &quot;kcmbasket_config_general&quot;);
+        return page;
+    }
 }
 
-extern &quot;C&quot;
-{
-	KDE_EXPORT KCModule *create_basket_config_baskets(QWidget *parent, const char *)
-	{
-		BasketsPage *page = new BasketsPage(parent, &quot;kcmbasket_config_baskets&quot;);
-		return page;
-	}
+extern &quot;C&quot; {
+    KDE_EXPORT KCModule *create_basket_config_baskets(QWidget *parent, const char *) {
+        BasketsPage *page = new BasketsPage(parent, &quot;kcmbasket_config_baskets&quot;);
+        return page;
+    }
 }
 
-extern &quot;C&quot;
-{
-	KDE_EXPORT KCModule *create_basket_config_new_notes(QWidget *parent, const char *)
-	{
-		NewNotesPage *page = new NewNotesPage(parent, &quot;kcmbasket_config_new_notes&quot;);
-		return page;
-	}
+extern &quot;C&quot; {
+    KDE_EXPORT KCModule *create_basket_config_new_notes(QWidget *parent, const char *) {
+        NewNotesPage *page = new NewNotesPage(parent, &quot;kcmbasket_config_new_notes&quot;);
+        return page;
+    }
 }
 
-extern &quot;C&quot;
-{
-	KDE_EXPORT KCModule *create_basket_config_notes_appearance(QWidget *parent, const char *)
-	{
-		NotesAppearancePage *page = new NotesAppearancePage(parent, &quot;kcmbasket_config_notes_appearance&quot;);
-		return page;
-	}
+extern &quot;C&quot; {
+    KDE_EXPORT KCModule *create_basket_config_notes_appearance(QWidget *parent, const char *) {
+        NotesAppearancePage *page = new NotesAppearancePage(parent, &quot;kcmbasket_config_notes_appearance&quot;);
+        return page;
+    }
 }
 
-extern &quot;C&quot;
-{
-	KDE_EXPORT KCModule *create_basket_config_apps(QWidget *parent, const char *)
-	{
-		ApplicationsPage *page = new ApplicationsPage(parent, &quot;kcmbasket_config_apps&quot;);
-		return page;
-	}
+extern &quot;C&quot; {
+    KDE_EXPORT KCModule *create_basket_config_apps(QWidget *parent, const char *) {
+        ApplicationsPage *page = new ApplicationsPage(parent, &quot;kcmbasket_config_apps&quot;);
+        return page;
+    }
 }</diff>
      <filename>src/kcm_basket.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -44,10 +44,10 @@
 //#define OUTPUT_GIMP_PALETTE
 
 #ifdef DEBUG_COLOR_ARRAY
-  #include &lt;iomanip&gt;
+#include &lt;iomanip&gt;
 #endif
 #ifdef OUTPUT_GIMP_PALETTE
-  #include &lt;iomanip&gt;
+#include &lt;iomanip&gt;
 #endif
 
 
@@ -58,12 +58,12 @@ const int KColorPopup::FRAME_WIDTH = 1;
 
 
 KColorPopup::KColorPopup(KColorCombo2 *parent)
- : QWidget(/*parent=*/0, /*name=*/0, Qt::WType_Popup | WNoAutoErase),
-   m_selector(parent)
+        : QWidget(/*parent=*/0, /*name=*/0, Qt::WType_Popup | WNoAutoErase),
+        m_selector(parent)
 {
-	hide();
-	setMouseTracking(true);
-	//resize(20, 20);
+    hide();
+    setMouseTracking(true);
+    //resize(20, 20);
 }
 
 KColorPopup::~KColorPopup()
@@ -74,238 +74,238 @@ KColorPopup::~KColorPopup()
 
 void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
 {
-	int  columnCount = m_selector-&gt;columnCount();
-	int  rowCount    = m_selector-&gt;rowCount();
-	int  colorHeight = m_selector-&gt;colorRectHeight();
-	int  colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
-	bool haveDefault = m_selector-&gt;defaultColor().isValid();
-
-	int width  = 2 + MARGIN + (colorWidth  + MARGIN) * columnCount;
-	int height = 2 + MARGIN + (colorHeight + MARGIN) * rowCount + (colorHeight + MARGIN);
-
-	resize(width, height);
-
-	// Initialize the pixmap:
-	m_pixmap.resize(width, height);
-	QPainter painter(&amp;m_pixmap);
-	painter.fillRect(0, 0, width, height, palette().color(QPalette::Base));
-	painter.setPen(palette().color(QPalette::Text));
-	painter.drawRect(0, 0, width, height);
-
-	// Needed to draw:
-	int x, y;
-	QRect selectionRect;
-
-	// Draw the color array:
-	for (int i = 0; i &lt; columnCount; ++i) {
-		for (int j = 0; j &lt; rowCount; ++j) {
-			x = 1 + MARGIN + (colorWidth  + MARGIN) * i;
-			y = 1 + MARGIN + (colorHeight + MARGIN) * j;
-			if (i == m_selectedColumn &amp;&amp; j == m_selectedRow) {
-				selectionRect = QRect(x - 2, y - 2, colorWidth + 4, colorHeight + 4);
-				painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
-			}
-			m_selector-&gt;drawColorRect(painter, x, y, m_selector-&gt;colorAt(i, j), /*isDefault=*/false, colorWidth, colorHeight);
-		}
-	}
-
-	m_columnOther = (haveDefault ? columnCount / 2 : 0); // &quot;(Default)&quot; is allowed, paint &quot;Other...&quot; on the right
-	int defaultCellWidth = (colorWidth  + MARGIN) * m_columnOther;
-	int otherCellWidth   = (colorWidth  + MARGIN) * (columnCount - m_columnOther);
-
-	// Draw the &quot;(Default)&quot; and &quot;Other...&quot; colors:
-	y = height - (colorHeight + MARGIN) - 1;
-	QColor textColor;
-	if (m_selector-&gt;defaultColor().isValid()) {
-		x = 1 + MARGIN;
-		if (m_selectedColumn &lt; m_columnOther &amp;&amp; rowCount == m_selectedRow) {
-			selectionRect = QRect(x - 2, y - 2, defaultCellWidth, colorHeight + 4);
-			painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
-			textColor = palette().color(QPalette::HighlightedText);
-		} else
-			textColor = palette().color(QPalette::Text);
-		m_selector-&gt;drawColorRect(painter, x, y, m_selector-&gt;defaultColor(), /*isDefault=*/true, colorWidth, colorHeight);
-		painter.setFont(m_selector-&gt;font());
-		painter.setPen(textColor);
-		painter.drawText(x + 2 + colorWidth, y, /*width=*/5000, colorHeight, Qt::AlignLeft | Qt::AlignVCenter | DontClip, i18n(&quot;(Default)&quot;));
-	}
-	x = 1 + MARGIN + m_columnOther * (colorWidth + MARGIN);
-	if (m_selectedColumn &gt;= m_columnOther &amp;&amp; rowCount == m_selectedRow) {
-		selectionRect = QRect(x - 2, y - 2, otherCellWidth, colorHeight + 4);
-		painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
-		textColor = palette().color(QPalette::HighlightedText);
-	} else
-		textColor = palette().color(QPalette::Text);
-	m_selector-&gt;drawColorRect(painter, x, y, m_otherColor, /*isDefault=*/false, colorWidth, colorHeight);
-	painter.setFont(m_selector-&gt;font());
-	painter.setPen(textColor);
-	painter.drawText(x + 2 + colorWidth, y, /*width=*/5000, colorHeight, Qt::AlignLeft | Qt::AlignVCenter | DontClip, i18n(&quot;Other...&quot;));
-
-//	QPoint pos = mapFromGlobal(QCursor::pos());
-//	painter.drawRect(pos.x(), pos.y(), 5000, 5000);
+    int  columnCount = m_selector-&gt;columnCount();
+    int  rowCount    = m_selector-&gt;rowCount();
+    int  colorHeight = m_selector-&gt;colorRectHeight();
+    int  colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
+    bool haveDefault = m_selector-&gt;defaultColor().isValid();
+
+    int width  = 2 + MARGIN + (colorWidth  + MARGIN) * columnCount;
+    int height = 2 + MARGIN + (colorHeight + MARGIN) * rowCount + (colorHeight + MARGIN);
+
+    resize(width, height);
+
+    // Initialize the pixmap:
+    m_pixmap.resize(width, height);
+    QPainter painter(&amp;m_pixmap);
+    painter.fillRect(0, 0, width, height, palette().color(QPalette::Base));
+    painter.setPen(palette().color(QPalette::Text));
+    painter.drawRect(0, 0, width, height);
+
+    // Needed to draw:
+    int x, y;
+    QRect selectionRect;
+
+    // Draw the color array:
+    for (int i = 0; i &lt; columnCount; ++i) {
+        for (int j = 0; j &lt; rowCount; ++j) {
+            x = 1 + MARGIN + (colorWidth  + MARGIN) * i;
+            y = 1 + MARGIN + (colorHeight + MARGIN) * j;
+            if (i == m_selectedColumn &amp;&amp; j == m_selectedRow) {
+                selectionRect = QRect(x - 2, y - 2, colorWidth + 4, colorHeight + 4);
+                painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
+            }
+            m_selector-&gt;drawColorRect(painter, x, y, m_selector-&gt;colorAt(i, j), /*isDefault=*/false, colorWidth, colorHeight);
+        }
+    }
+
+    m_columnOther = (haveDefault ? columnCount / 2 : 0); // &quot;(Default)&quot; is allowed, paint &quot;Other...&quot; on the right
+    int defaultCellWidth = (colorWidth  + MARGIN) * m_columnOther;
+    int otherCellWidth   = (colorWidth  + MARGIN) * (columnCount - m_columnOther);
+
+    // Draw the &quot;(Default)&quot; and &quot;Other...&quot; colors:
+    y = height - (colorHeight + MARGIN) - 1;
+    QColor textColor;
+    if (m_selector-&gt;defaultColor().isValid()) {
+        x = 1 + MARGIN;
+        if (m_selectedColumn &lt; m_columnOther &amp;&amp; rowCount == m_selectedRow) {
+            selectionRect = QRect(x - 2, y - 2, defaultCellWidth, colorHeight + 4);
+            painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
+            textColor = palette().color(QPalette::HighlightedText);
+        } else
+            textColor = palette().color(QPalette::Text);
+        m_selector-&gt;drawColorRect(painter, x, y, m_selector-&gt;defaultColor(), /*isDefault=*/true, colorWidth, colorHeight);
+        painter.setFont(m_selector-&gt;font());
+        painter.setPen(textColor);
+        painter.drawText(x + 2 + colorWidth, y, /*width=*/5000, colorHeight, Qt::AlignLeft | Qt::AlignVCenter | DontClip, i18n(&quot;(Default)&quot;));
+    }
+    x = 1 + MARGIN + m_columnOther * (colorWidth + MARGIN);
+    if (m_selectedColumn &gt;= m_columnOther &amp;&amp; rowCount == m_selectedRow) {
+        selectionRect = QRect(x - 2, y - 2, otherCellWidth, colorHeight + 4);
+        painter.fillRect(selectionRect, palette().color(QPalette::Highlight));
+        textColor = palette().color(QPalette::HighlightedText);
+    } else
+        textColor = palette().color(QPalette::Text);
+    m_selector-&gt;drawColorRect(painter, x, y, m_otherColor, /*isDefault=*/false, colorWidth, colorHeight);
+    painter.setFont(m_selector-&gt;font());
+    painter.setPen(textColor);
+    painter.drawText(x + 2 + colorWidth, y, /*width=*/5000, colorHeight, Qt::AlignLeft | Qt::AlignVCenter | DontClip, i18n(&quot;Other...&quot;));
+
+//  QPoint pos = mapFromGlobal(QCursor::pos());
+//  painter.drawRect(pos.x(), pos.y(), 5000, 5000);
 }
 
 void KColorPopup::updateCell(int column, int row)
 {
-	int  colorHeight = m_selector-&gt;colorRectHeight();
-	int  colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
+    int  colorHeight = m_selector-&gt;colorRectHeight();
+    int  colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
 
-	int x      = 1 + MARGIN + - 2 + column * (colorWidth  + MARGIN);
-	int y      = 1 + MARGIN + - 2 + row    * (colorHeight + MARGIN);
-	int width  = colorWidth  + MARGIN;
-	int height = colorHeight + MARGIN;
+    int x      = 1 + MARGIN + - 2 + column * (colorWidth  + MARGIN);
+    int y      = 1 + MARGIN + - 2 + row    * (colorHeight + MARGIN);
+    int width  = colorWidth  + MARGIN;
+    int height = colorHeight + MARGIN;
 
-	if (row == m_selector-&gt;rowCount()) {
-		if (m_selectedColumn &lt; m_columnOther) // The &quot;(Default)&quot; cell:
-			width = (colorWidth  + MARGIN) * m_columnOther;
-		else // The &quot;Other...&quot; cell:
-			width = (colorWidth  + MARGIN) * (m_selector-&gt;columnCount() - m_columnOther);
-	}
+    if (row == m_selector-&gt;rowCount()) {
+        if (m_selectedColumn &lt; m_columnOther) // The &quot;(Default)&quot; cell:
+            width = (colorWidth  + MARGIN) * m_columnOther;
+        else // The &quot;Other...&quot; cell:
+            width = (colorWidth  + MARGIN) * (m_selector-&gt;columnCount() - m_columnOther);
+    }
 
-	update(x, y, width, height);
+    update(x, y, width, height);
 }
 
 void KColorPopup::doSelection()
 {
-	m_otherColor = QColor();
-
-	// If the selected color is not the default one, try to find it in the array:
-	if (m_selector-&gt;color().isValid()) {
-		bool isInArray = false;
-		for (int column = 0; column &lt; m_selector-&gt;columnCount(); ++column)
-			for (int row = 0; row &lt; m_selector-&gt;rowCount(); ++row)
-				if (m_selector-&gt;color() == m_selector-&gt;colorAt(column, row)) {
-					m_selectedColumn = column;
-					m_selectedRow    = row;
-					isInArray        = true;
-				}
-		// If not found in array, it's another one:
-		if (!isInArray) {
-			m_selectedColumn = m_columnOther;
-			m_selectedRow    = m_selector-&gt;rowCount();
-			m_otherColor     = m_selector-&gt;color();
-		}
-	// If it's the default one:
-	} else {
-		m_selectedColumn = 0;
-		m_selectedRow    = m_selector-&gt;rowCount();
-	}
+    m_otherColor = QColor();
+
+    // If the selected color is not the default one, try to find it in the array:
+    if (m_selector-&gt;color().isValid()) {
+        bool isInArray = false;
+        for (int column = 0; column &lt; m_selector-&gt;columnCount(); ++column)
+            for (int row = 0; row &lt; m_selector-&gt;rowCount(); ++row)
+                if (m_selector-&gt;color() == m_selector-&gt;colorAt(column, row)) {
+                    m_selectedColumn = column;
+                    m_selectedRow    = row;
+                    isInArray        = true;
+                }
+        // If not found in array, it's another one:
+        if (!isInArray) {
+            m_selectedColumn = m_columnOther;
+            m_selectedRow    = m_selector-&gt;rowCount();
+            m_otherColor     = m_selector-&gt;color();
+        }
+        // If it's the default one:
+    } else {
+        m_selectedColumn = 0;
+        m_selectedRow    = m_selector-&gt;rowCount();
+    }
 }
 
 void KColorPopup::validate()
 {
-	hide();
-	close();
+    hide();
+    close();
 
-	if (m_selectedRow != m_selector-&gt;rowCount()) // A normal row:
-		m_selector-&gt;setColor(m_selector-&gt;colorAt(m_selectedColumn, m_selectedRow));
-	else if (m_selectedColumn &lt; m_columnOther) // The default color:
-		m_selector-&gt;setColor(QColor());
-	else { // The user want to choose one:
-		QColor color = m_selector-&gt;effectiveColor();
-		if (KColorDialog::getColor(color, this) == QDialog::Accepted)
-			m_selector-&gt;setColor(color);
-	}
+    if (m_selectedRow != m_selector-&gt;rowCount()) // A normal row:
+        m_selector-&gt;setColor(m_selector-&gt;colorAt(m_selectedColumn, m_selectedRow));
+    else if (m_selectedColumn &lt; m_columnOther) // The default color:
+        m_selector-&gt;setColor(QColor());
+    else { // The user want to choose one:
+        QColor color = m_selector-&gt;effectiveColor();
+        if (KColorDialog::getColor(color, this) == QDialog::Accepted)
+            m_selector-&gt;setColor(color);
+    }
 }
 
 void KColorPopup::mousePressEvent(QMouseEvent *event)
 {
-	int x = event-&gt;pos().x();
-	int y = event-&gt;pos().y();
-	if (x &lt; 0 || y &lt; 0 || x &gt;= width() || y &gt;= height()) {
-		hide();
-		close();
-	} else
-		validate();
+    int x = event-&gt;pos().x();
+    int y = event-&gt;pos().y();
+    if (x &lt; 0 || y &lt; 0 || x &gt;= width() || y &gt;= height()) {
+        hide();
+        close();
+    } else
+        validate();
 
-	event-&gt;accept();
+    event-&gt;accept();
 }
 
 void KColorPopup::paintEvent(QPaintEvent *event)
 {
-	QPainter painter(this);
-	painter.drawPixmap(0, 0, m_pixmap);
-	painter.setPen(Qt::black);
-	painter.drawRect(event-&gt;rect());
+    QPainter painter(this);
+    painter.drawPixmap(0, 0, m_pixmap);
+    painter.setPen(Qt::black);
+    painter.drawRect(event-&gt;rect());
 }
 
 void KColorPopup::mouseMoveEvent(QMouseEvent *event)
 {
-	int x = event-&gt;pos().x();
-	int y = event-&gt;pos().y();
-	if (x &lt; FRAME_WIDTH + 2 || y &lt; FRAME_WIDTH + 2 || x &gt; width() - 2 - 2*FRAME_WIDTH || y &gt; height() - 2 - 2*FRAME_WIDTH)
-		return;
+    int x = event-&gt;pos().x();
+    int y = event-&gt;pos().y();
+    if (x &lt; FRAME_WIDTH + 2 || y &lt; FRAME_WIDTH + 2 || x &gt; width() - 2 - 2*FRAME_WIDTH || y &gt; height() - 2 - 2*FRAME_WIDTH)
+        return;
 
-	int colorHeight = m_selector-&gt;colorRectHeight();
-	int colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
+    int colorHeight = m_selector-&gt;colorRectHeight();
+    int colorWidth  = m_selector-&gt;colorRectWidthForHeight(colorHeight);
 
-// 	int oldSelectedColumn = m_selectedColumn;
-// 	int oldSelectedRow    = m_selectedRow;
-	m_selectedColumn = (x - FRAME_WIDTH - MARGIN + 2) / (colorWidth  + MARGIN);
-	m_selectedRow    = (y - FRAME_WIDTH - MARGIN + 2) / (colorHeight + MARGIN);
+//  int oldSelectedColumn = m_selectedColumn;
+//  int oldSelectedRow    = m_selectedRow;
+    m_selectedColumn = (x - FRAME_WIDTH - MARGIN + 2) / (colorWidth  + MARGIN);
+    m_selectedRow    = (y - FRAME_WIDTH - MARGIN + 2) / (colorHeight + MARGIN);
 
-	relayout();
-	update();
+    relayout();
+    update();
 }
 
 void KColorPopup::keyPressEvent(QKeyEvent *event)
 {
-	int column      = m_selectedColumn;
-	int row         = m_selectedRow;
-	int columnCount = m_selector-&gt;columnCount();
-	int rowCount    = m_selector-&gt;rowCount();
-
-	switch (event-&gt;key()) {
-		case Qt::Key_Right:
-			if (m_selectedRow != rowCount) // A normal row:
-				column = (column + 1) % columnCount;
-			else {
-				// The last row, if there are two choices, switch. Else, do nothing:
-				if (m_selector-&gt;defaultColor().isValid())
-					column = (m_selectedColumn &lt; m_columnOther ? m_columnOther : 0);
-			}
-			break;
-		case Qt::Key_Left:
-			if (m_selectedRow != rowCount) { // A normal row:
-				column = (column - 1);
-				if (column &lt; 0)
-					column = columnCount - 1;
-			} else {
-				// The last row, if there are two choices, switch. Else, do nothing:
-				if (m_selector-&gt;defaultColor().isValid())
-					column = (m_selectedColumn &lt; m_columnOther ? m_columnOther : 0);
-			}
-			break;
-		case Qt::Key_Up:       row    = (row    - 1); if (row &lt; 0)    row    = rowCount;        break;
-		case Qt::Key_Down:     row    = (row    + 1) % (rowCount+1);          break;
-		case Qt::Key_PageDown: row += 10; if (row &gt; rowCount) row = rowCount; break;
-		case Qt::Key_PageUp:   row -= 10; if (row &lt; 0)        row = 0;        break;
-		case Qt::Key_Home:     row = 0;        column = 0;                    break;
-		case Qt::Key_End:      row = rowCount; column = columnCount - 1;      break;
-		case Qt::Key_Return:
-			validate();
-			break;
-		default:
-			QWidget::keyPressEvent(event);
-	}
-
-	if (row != m_selectedRow || column != m_selectedColumn) {
-		m_selectedRow    = row;
-		m_selectedColumn = column;
-		relayout();
-		update();
-	}
+    int column      = m_selectedColumn;
+    int row         = m_selectedRow;
+    int columnCount = m_selector-&gt;columnCount();
+    int rowCount    = m_selector-&gt;rowCount();
+
+    switch (event-&gt;key()) {
+    case Qt::Key_Right:
+        if (m_selectedRow != rowCount) // A normal row:
+            column = (column + 1) % columnCount;
+        else {
+            // The last row, if there are two choices, switch. Else, do nothing:
+            if (m_selector-&gt;defaultColor().isValid())
+                column = (m_selectedColumn &lt; m_columnOther ? m_columnOther : 0);
+        }
+        break;
+    case Qt::Key_Left:
+        if (m_selectedRow != rowCount) { // A normal row:
+            column = (column - 1);
+            if (column &lt; 0)
+                column = columnCount - 1;
+        } else {
+            // The last row, if there are two choices, switch. Else, do nothing:
+            if (m_selector-&gt;defaultColor().isValid())
+                column = (m_selectedColumn &lt; m_columnOther ? m_columnOther : 0);
+        }
+        break;
+    case Qt::Key_Up:       row    = (row    - 1); if (row &lt; 0)    row    = rowCount;        break;
+    case Qt::Key_Down:     row    = (row    + 1) % (rowCount+1);          break;
+    case Qt::Key_PageDown: row += 10; if (row &gt; rowCount) row = rowCount; break;
+    case Qt::Key_PageUp:   row -= 10; if (row &lt; 0)        row = 0;        break;
+    case Qt::Key_Home:     row = 0;        column = 0;                    break;
+    case Qt::Key_End:      row = rowCount; column = columnCount - 1;      break;
+    case Qt::Key_Return:
+        validate();
+        break;
+    default:
+        QWidget::keyPressEvent(event);
+    }
+
+    if (row != m_selectedRow || column != m_selectedColumn) {
+        m_selectedRow    = row;
+        m_selectedColumn = column;
+        relayout();
+        update();
+    }
 }
 
 /** Helper function: */
 
 QColor Tool_mixColors(const QColor &amp;color1, const QColor &amp;color2)
 {
-	QColor mixedColor;
-	mixedColor.setRgb( (color1.red()   + color2.red())   / 2,
-	                   (color1.green() + color2.green()) / 2,
-	                   (color1.blue()  + color2.blue())  / 2 );
-	return mixedColor;
+    QColor mixedColor;
+    mixedColor.setRgb((color1.red()   + color2.red())   / 2,
+                      (color1.green() + color2.green()) / 2,
+                      (color1.blue()  + color2.blue())  / 2);
+    return mixedColor;
 }
 
 /** class KColorCombo2Private */
@@ -323,458 +323,458 @@ class KColorCombo2::KColorCombo2Private
  */
 
 KColorCombo2::KColorCombo2(const QColor &amp;color, const QColor &amp;defaultColor, QWidget *parent, const char *name)
- : QComboBox(/*editable=*/false, parent, name),
-   m_color(color), m_defaultColor(defaultColor)
+        : QComboBox(/*editable=*/false, parent, name),
+        m_color(color), m_defaultColor(defaultColor)
 {
-	init();
+    init();
 }
 
 KColorCombo2::KColorCombo2(const QColor &amp;color, QWidget *parent, const char *name)
- : QComboBox(/*editable=*/false, parent, name),
-   m_color(color), m_defaultColor()
+        : QComboBox(/*editable=*/false, parent, name),
+        m_color(color), m_defaultColor()
 {
-	init();
+    init();
 }
 
 void KColorCombo2::init()
 {
-	m_discardNextMousePress = false;
-	m_colorArray            = 0;
-	d                       = new KColorCombo2Private();
+    m_discardNextMousePress = false;
+    m_colorArray            = 0;
+    d                       = new KColorCombo2Private();
 
-	setDefaultColor(m_defaultColor);
-	insertItem(&quot;&quot;, /*index=*/0);
-	updateComboBox(); // It need an item of index 0 to exists, so we created it.
-	setAcceptDrops(true);
+    setDefaultColor(m_defaultColor);
+    insertItem(&quot;&quot;, /*index=*/0);
+    updateComboBox(); // It need an item of index 0 to exists, so we created it.
+    setAcceptDrops(true);
 
-	m_popup = new KColorPopup(this);
-	m_popup-&gt;installEventFilter(this);
+    m_popup = new KColorPopup(this);
+    m_popup-&gt;installEventFilter(this);
 
-	// By default, the array is filled with setRainbowPreset().
-	// But we allocate it on demand (the later as possible) to avoid performances issues if the developer set another array.
-	// However, to keep columnCount() rowCount() const, we define theme here:
-	m_columnCount = 13;
-	m_rowCount    = 9;
+    // By default, the array is filled with setRainbowPreset().
+    // But we allocate it on demand (the later as possible) to avoid performances issues if the developer set another array.
+    // However, to keep columnCount() rowCount() const, we define theme here:
+    m_columnCount = 13;
+    m_rowCount    = 9;
 }
 
 KColorCombo2::~KColorCombo2()
 {
-	deleteColorArray();
+    deleteColorArray();
 }
 
 void KColorCombo2::setColor(const QColor &amp;color)
 {
-	// Do nothing if the color should be set to the default one and there is no such default color allowed:
-	if (!color.isValid() &amp;&amp; !m_defaultColor.isValid()) {
-		// kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to assign the default color (an invalid one) whereas no such default color is allowed&quot;;
-		return;
-	}
+    // Do nothing if the color should be set to the default one and there is no such default color allowed:
+    if (!color.isValid() &amp;&amp; !m_defaultColor.isValid()) {
+        // kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to assign the default color (an invalid one) whereas no such default color is allowed&quot;;
+        return;
+    }
 
-	if (m_color != color) {
-		m_color = color;
-		updateComboBox();
-		emit changed(color);
-	}
+    if (m_color != color) {
+        m_color = color;
+        updateComboBox();
+        emit changed(color);
+    }
 }
 
 QColor KColorCombo2::color() const
 {
-	return m_color;
+    return m_color;
 }
 
 QColor KColorCombo2::effectiveColor() const
 {
-	if (m_color.isValid())
-		return m_color;
-	else
-		return m_defaultColor;
+    if (m_color.isValid())
+        return m_color;
+    else
+        return m_defaultColor;
 }
 
 void KColorCombo2::setRainbowPreset(int colorColumnCount, int lightRowCount, int darkRowCount, bool withGray)
 {
-	// At least one row and one column:
-	if (colorColumnCount &lt; 1 - (withGray ? 1 : 0))
-		colorColumnCount = 1 - (withGray ? 1 : 0);
-	if (lightRowCount &lt; 0)
-		lightRowCount = 0;
-	if (darkRowCount &lt; 0)
-		darkRowCount = 0;
-
-	// Create the array:
-	int  columnCount = colorColumnCount + (withGray ? 1 : 0);
-	int  rowCount    = lightRowCount + 1 + darkRowCount;
-	newColorArray(columnCount, rowCount);
-
-	// Fill the array:
-	for (int i = 0; i &lt; colorColumnCount; ++i) {
-		int hue = i * 360 / colorColumnCount;
-		// With light colors:
-		for (int j = 1; j &lt;= lightRowCount; ++j) { // Start to 1 because we don't want a row full of white!
-			int saturation = j * 255 / (lightRowCount + 1);
-			setColorAt(i, j - 1, QColor(hue, saturation, 255, QColor::Hsv));
-		}
-		// With pure colors:
-		setColorAt(i, lightRowCount, QColor(hue, 255, 255, QColor::Hsv));
-		// With dark colors:
-		for (int j = 1; j &lt;= darkRowCount; ++j) {
-			int value = 255 - j * 255 / (darkRowCount + 1);
-			setColorAt(i, lightRowCount + j, QColor(hue, 255, value, QColor::Hsv));
-		}
-	}
-
-	// Fill the gray column:
-	if (withGray) {
-		for (int i = 0; i &lt; rowCount; ++i) {
-			int gray = ( rowCount == 1  ?  128  :  255 - (i * 255 / (rowCount - 1)) );
-			setColorAt(columnCount-1, i, QColor(gray, gray, gray));
-		}
-	}
+    // At least one row and one column:
+    if (colorColumnCount &lt; 1 - (withGray ? 1 : 0))
+        colorColumnCount = 1 - (withGray ? 1 : 0);
+    if (lightRowCount &lt; 0)
+        lightRowCount = 0;
+    if (darkRowCount &lt; 0)
+        darkRowCount = 0;
+
+    // Create the array:
+    int  columnCount = colorColumnCount + (withGray ? 1 : 0);
+    int  rowCount    = lightRowCount + 1 + darkRowCount;
+    newColorArray(columnCount, rowCount);
+
+    // Fill the array:
+    for (int i = 0; i &lt; colorColumnCount; ++i) {
+        int hue = i * 360 / colorColumnCount;
+        // With light colors:
+        for (int j = 1; j &lt;= lightRowCount; ++j) { // Start to 1 because we don't want a row full of white!
+            int saturation = j * 255 / (lightRowCount + 1);
+            setColorAt(i, j - 1, QColor(hue, saturation, 255, QColor::Hsv));
+        }
+        // With pure colors:
+        setColorAt(i, lightRowCount, QColor(hue, 255, 255, QColor::Hsv));
+        // With dark colors:
+        for (int j = 1; j &lt;= darkRowCount; ++j) {
+            int value = 255 - j * 255 / (darkRowCount + 1);
+            setColorAt(i, lightRowCount + j, QColor(hue, 255, value, QColor::Hsv));
+        }
+    }
+
+    // Fill the gray column:
+    if (withGray) {
+        for (int i = 0; i &lt; rowCount; ++i) {
+            int gray = (rowCount == 1  ?  128  :  255 - (i * 255 / (rowCount - 1)));
+            setColorAt(columnCount - 1, i, QColor(gray, gray, gray));
+        }
+    }
 
 #ifdef DEBUG_COLOR_ARRAY
-	kDebug() &lt;&lt; &quot;KColorCombo2::setColorPreset&quot;;
-	for (int j = 0; j &lt; rowCount; ++j) {
-		for (int i = 0; i &lt; columnCount; ++i) {
-			int h, s, v;
-			m_colorArray[i][j].getHsv(h, s, v);
-			kDebug() &lt;&lt; QString(&quot;(%1,%2,%3)&quot;).arg(h, 3).arg(s, 3).arg(v, 3);
-			//kDebug() &lt;&lt; colorArray[i][j].name() &lt;&lt; &quot; &quot;;
-		}
-		kDebug();
-	}
+    kDebug() &lt;&lt; &quot;KColorCombo2::setColorPreset&quot;;
+    for (int j = 0; j &lt; rowCount; ++j) {
+        for (int i = 0; i &lt; columnCount; ++i) {
+            int h, s, v;
+            m_colorArray[i][j].getHsv(h, s, v);
+            kDebug() &lt;&lt; QString(&quot;(%1,%2,%3)&quot;).arg(h, 3).arg(s, 3).arg(v, 3);
+            //kDebug() &lt;&lt; colorArray[i][j].name() &lt;&lt; &quot; &quot;;
+        }
+        kDebug();
+    }
 #endif
 #ifdef OUTPUT_GIMP_PALETTE
-	kDebug() &lt;&lt; &quot;GIMP Palette&quot;;
-	for (int j = 0; j &lt; rowCount; ++j) {
-		for (int i = 0; i &lt; columnCount; ++i) {
-			kDebug() &lt;&lt; QString(&quot;(%1,%2,%3)&quot;)
-                .arg(m_colorArray[i][j].red(), 3)
-                .arg(m_colorArray[i][j].green(), 3)
-                .arg(m_colorArray[i][j].blue(), 3);
-		}
-	}
+    kDebug() &lt;&lt; &quot;GIMP Palette&quot;;
+    for (int j = 0; j &lt; rowCount; ++j) {
+        for (int i = 0; i &lt; columnCount; ++i) {
+            kDebug() &lt;&lt; QString(&quot;(%1,%2,%3)&quot;)
+            .arg(m_colorArray[i][j].red(), 3)
+            .arg(m_colorArray[i][j].green(), 3)
+            .arg(m_colorArray[i][j].blue(), 3);
+        }
+    }
 #endif
 }
 
 int KColorCombo2::columnCount() const
 {
-	return m_columnCount;
+    return m_columnCount;
 }
 
 int KColorCombo2::rowCount() const
 {
-	return m_rowCount;
+    return m_rowCount;
 }
 
 QColor KColorCombo2::colorAt(int column, int row)/* const*/
 {
-	if (!m_colorArray)
-		setRainbowPreset();
+    if (!m_colorArray)
+        setRainbowPreset();
 
-	if (column &lt; 0 || row &lt; 0 || column &gt;= m_columnCount || row &gt;= m_rowCount)
-		return QColor();
+    if (column &lt; 0 || row &lt; 0 || column &gt;= m_columnCount || row &gt;= m_rowCount)
+        return QColor();
 
-	return m_colorArray[column][row];
+    return m_colorArray[column][row];
 }
 
 QColor KColorCombo2::defaultColor() const
 {
-	return m_defaultColor;
+    return m_defaultColor;
 }
 
 void KColorCombo2::newColorArray(int columnCount, int rowCount)
 {
-	if (columnCount &lt;= 0 || rowCount &lt;= 0) {
-		// kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to create an empty new color array (with %d columns and %d rows)&quot;;
-		return;
-	}
+    if (columnCount &lt;= 0 || rowCount &lt;= 0) {
+        // kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to create an empty new color array (with %d columns and %d rows)&quot;;
+        return;
+    }
 
-	// Delete any previous array (if any):
-	deleteColorArray();
+    // Delete any previous array (if any):
+    deleteColorArray();
 
-	// Create a new array of the wanted dimentions:
-	m_columnCount = columnCount;
-	m_rowCount    = rowCount;
-	m_colorArray  = new QColor* [columnCount];
-	for (int i = 0; i &lt; columnCount; ++i)
-		m_colorArray[i] = new QColor[rowCount];
+    // Create a new array of the wanted dimentions:
+    m_columnCount = columnCount;
+    m_rowCount    = rowCount;
+    m_colorArray  = new QColor* [columnCount];
+    for (int i = 0; i &lt; columnCount; ++i)
+        m_colorArray[i] = new QColor[rowCount];
 
-	m_popup-&gt;relayout();
+    m_popup-&gt;relayout();
 }
 
 void KColorCombo2::setColorAt(int column, int row, const QColor &amp;color)
 {
-	if (!m_colorArray)
-		setRainbowPreset();
+    if (!m_colorArray)
+        setRainbowPreset();
 
-	if (column &lt; 0 || row &lt; 0 || column &gt;= m_columnCount || row &gt;= m_rowCount) {
-		// kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to set a color at an invalid index (at column %d and row %d, whereas the array have %d columns and %d rows)&quot;;
-		return;
-	}
+    if (column &lt; 0 || row &lt; 0 || column &gt;= m_columnCount || row &gt;= m_rowCount) {
+        // kdebug &lt;&lt; this::FUNCTION &lt;&lt; &quot;Trying to set a color at an invalid index (at column %d and row %d, whereas the array have %d columns and %d rows)&quot;;
+        return;
+    }
 
-	m_colorArray[column][row] = color;
+    m_colorArray[column][row] = color;
 }
 
 void KColorCombo2::setDefaultColor(const QColor &amp;color)
 {
-	m_defaultColor = color;
-	if (!m_defaultColor.isValid() &amp;&amp; !m_color.isValid())
-		m_color = Qt::white; // FIXME: Use the first one.
+    m_defaultColor = color;
+    if (!m_defaultColor.isValid() &amp;&amp; !m_color.isValid())
+        m_color = Qt::white; // FIXME: Use the first one.
 }
 
 QPixmap KColorCombo2::colorRectPixmap(const QColor &amp;color, bool isDefault, int width, int height)
 {
-	// Prepare to draw:
-	QPixmap  pixmap(width, height);
-	QBitmap  mask(width, height);
-	QPainter painter(&amp;pixmap);
-	QPainter maskPainter(&amp;mask);
+    // Prepare to draw:
+    QPixmap  pixmap(width, height);
+    QBitmap  mask(width, height);
+    QPainter painter(&amp;pixmap);
+    QPainter maskPainter(&amp;mask);
 
-	// Draw pixmap:
-	drawColorRect(painter, 0, 0, color, isDefault, width, height);
+    // Draw pixmap:
+    drawColorRect(painter, 0, 0, color, isDefault, width, height);
 
-	// Draw mask (make the four corners transparent):
-	maskPainter.fillRect(0, 0, width, height, Qt::color1); // opaque
-	maskPainter.setPen(Qt::color0); // transparent
-	maskPainter.drawPoint(0,         0);
-	maskPainter.drawPoint(0,         height - 1);
-	maskPainter.drawPoint(width - 1, height - 1);
-	maskPainter.drawPoint(width - 1, 0);
+    // Draw mask (make the four corners transparent):
+    maskPainter.fillRect(0, 0, width, height, Qt::color1); // opaque
+    maskPainter.setPen(Qt::color0); // transparent
+    maskPainter.drawPoint(0,         0);
+    maskPainter.drawPoint(0,         height - 1);
+    maskPainter.drawPoint(width - 1, height - 1);
+    maskPainter.drawPoint(width - 1, 0);
 
-	// Finish:
-	painter.end();
-	maskPainter.end();
-	pixmap.setMask(mask);
-	return pixmap;
+    // Finish:
+    painter.end();
+    maskPainter.end();
+    pixmap.setMask(mask);
+    return pixmap;
 }
 
 void KColorCombo2::drawColorRect(QPainter &amp;painter, int x, int y, const QColor &amp;color, bool isDefault, int width, int height)
 {
-	// Fill:
-	if (color.isValid())
-		painter.fillRect(x /*+ 1*/, y /*+ 1*/, width /*- 2*/, height /*- 2*/, color);
-	else {
-		// If it's an invalid color, it's for the &quot;Other...&quot; entry: draw a rainbow.
-		// If it wasn't for the &quot;Other...&quot; entry, the programmer made a fault, so (s)he will be informed about that visually.
-		for (int i = 0; i &lt; width-2; ++i) {
-			int hue = i * 360 / (width-2);
-			for (int j = 0; j &lt; height-2; ++j) {
-				int saturation = 255 - (j * 255 / (height-2));
-				painter.setPen( QColor(hue, saturation, /*value=*/255, QColor::Hsv) );
-				painter.drawPoint(x + i + 1, y + j + 1);
-			}
-		}
-	}
-
-	// Stroke:
-	int dontCare, value;
-	color.getHsv(/*hue:*/dontCare, /*saturation:*/dontCare, value);
-	QColor stroke = (color.isValid() ? color.dark(125) : palette().color(QPalette::Text));
-	painter.setPen(/*color);//*/stroke);
-	painter.drawLine(x + 1,         y,              x + width - 2, y);
-	painter.drawLine(x,             y + 1,          x,             y + height - 2);
-	painter.drawLine(x + 1,         y + height - 1, x + width - 2, y + height - 1);
-	painter.drawLine(x + width - 1, y + 1,          x + width - 1, y + height - 2);
-
-	// Round corners:
-	QColor antialiasing;
-	if (color.isValid()) {
-		antialiasing = Tool_mixColors(color, stroke);
-		painter.setPen(antialiasing);
-		painter.drawPoint(x + 1,         y + 1);
-		painter.drawPoint(x + 1,         y + height - 2);
-		painter.drawPoint(x + width - 2, y + height - 2);
-		painter.drawPoint(x + width - 2, y + 1);
-	} else {
-		// The two top corners:
-		antialiasing = Tool_mixColors(Qt::red, stroke);
-		painter.setPen(antialiasing);
-		painter.drawPoint(x + 1,         y + 1);
-		painter.drawPoint(x + width - 2, y + 1);
-		// The two bottom ones:
-		antialiasing = Tool_mixColors(Qt::white, stroke);
-		painter.setPen(antialiasing);
-		painter.drawPoint(x + 1,         y + height - 2);
-		painter.drawPoint(x + width - 2, y + height - 2);
-	}
-
-	// Mark default color:
-	if (isDefault) {
-		painter.setPen(stroke);
-		painter.drawLine(x + 1, y + height - 2, x + width - 2, y + 1);
-	}
+    // Fill:
+    if (color.isValid())
+        painter.fillRect(x /*+ 1*/, y /*+ 1*/, width /*- 2*/, height /*- 2*/, color);
+    else {
+        // If it's an invalid color, it's for the &quot;Other...&quot; entry: draw a rainbow.
+        // If it wasn't for the &quot;Other...&quot; entry, the programmer made a fault, so (s)he will be informed about that visually.
+        for (int i = 0; i &lt; width - 2; ++i) {
+            int hue = i * 360 / (width - 2);
+            for (int j = 0; j &lt; height - 2; ++j) {
+                int saturation = 255 - (j * 255 / (height - 2));
+                painter.setPen(QColor(hue, saturation, /*value=*/255, QColor::Hsv));
+                painter.drawPoint(x + i + 1, y + j + 1);
+            }
+        }
+    }
+
+    // Stroke:
+    int dontCare, value;
+    color.getHsv(/*hue:*/dontCare, /*saturation:*/dontCare, value);
+    QColor stroke = (color.isValid() ? color.dark(125) : palette().color(QPalette::Text));
+    painter.setPen(/*color);//*/stroke);
+    painter.drawLine(x + 1,         y,              x + width - 2, y);
+    painter.drawLine(x,             y + 1,          x,             y + height - 2);
+    painter.drawLine(x + 1,         y + height - 1, x + width - 2, y + height - 1);
+    painter.drawLine(x + width - 1, y + 1,          x + width - 1, y + height - 2);
+
+    // Round corners:
+    QColor antialiasing;
+    if (color.isValid()) {
+        antialiasing = Tool_mixColors(color, stroke);
+        painter.setPen(antialiasing);
+        painter.drawPoint(x + 1,         y + 1);
+        painter.drawPoint(x + 1,         y + height - 2);
+        painter.drawPoint(x + width - 2, y + height - 2);
+        painter.drawPoint(x + width - 2, y + 1);
+    } else {
+        // The two top corners:
+        antialiasing = Tool_mixColors(Qt::red, stroke);
+        painter.setPen(antialiasing);
+        painter.drawPoint(x + 1,         y + 1);
+        painter.drawPoint(x + width - 2, y + 1);
+        // The two bottom ones:
+        antialiasing = Tool_mixColors(Qt::white, stroke);
+        painter.setPen(antialiasing);
+        painter.drawPoint(x + 1,         y + height - 2);
+        painter.drawPoint(x + width - 2, y + height - 2);
+    }
+
+    // Mark default color:
+    if (isDefault) {
+        painter.setPen(stroke);
+        painter.drawLine(x + 1, y + height - 2, x + width - 2, y + 1);
+    }
 }
 
 int KColorCombo2::colorRectHeight() const
 {
-	return (fontMetrics().boundingRect(i18n(&quot;(Default)&quot;)).height() + 2)*3/2;
+    return (fontMetrics().boundingRect(i18n(&quot;(Default)&quot;)).height() + 2)*3 / 2;
 }
 
 int KColorCombo2::colorRectWidthForHeight(int height) const
 {
-	return height * 14 / 10; // 1.4 times the height, like A4 papers.
+    return height * 14 / 10; // 1.4 times the height, like A4 papers.
 }
 
 void KColorCombo2::deleteColorArray()
 {
-	if (m_colorArray) {
-		for (int i = 0; i &lt; m_columnCount; ++i)
-			delete[] m_colorArray[i];
-		delete[] m_colorArray;
-		m_colorArray = 0;
-	}
+    if (m_colorArray) {
+        for (int i = 0; i &lt; m_columnCount; ++i)
+            delete[] m_colorArray[i];
+        delete[] m_colorArray;
+        m_colorArray = 0;
+    }
 }
 
 void KColorCombo2::updateComboBox()
 {
-	int height = colorRectHeight()*2/3; // fontMetrics().boundingRect(i18n(&quot;(Default)&quot;)).height() + 2
-	QPixmap pixmap = colorRectPixmap(effectiveColor(), !m_color.isValid(), colorRectWidthForHeight(height), height); // TODO: isDefaultColorSelected()
-	changeItem(pixmap, (m_color.isValid() ? &quot;&quot; : i18n(&quot;(Default)&quot;)), /*index=*/0);
+    int height = colorRectHeight() * 2 / 3; // fontMetrics().boundingRect(i18n(&quot;(Default)&quot;)).height() + 2
+    QPixmap pixmap = colorRectPixmap(effectiveColor(), !m_color.isValid(), colorRectWidthForHeight(height), height); // TODO: isDefaultColorSelected()
+    changeItem(pixmap, (m_color.isValid() ? &quot;&quot; : i18n(&quot;(Default)&quot;)), /*index=*/0);
 }
 
 void KColorCombo2::popup()
 {
-	if (!m_colorArray)
-		setRainbowPreset();
+    if (!m_colorArray)
+        setRainbowPreset();
 
-	// Compute where to show the popup:
-	QRect desk = KGlobalSettings::desktopGeometry(this);
+    // Compute where to show the popup:
+    QRect desk = KGlobalSettings::desktopGeometry(this);
 
-	QPoint popupPoint = mapToGlobal(QPoint(0, 0));
+    QPoint popupPoint = mapToGlobal(QPoint(0, 0));
 
-	int popupHeight = m_popup-&gt;sizeHint().height();
-	if (popupPoint.y() + height() + popupHeight &gt; desk.bottom())
-		popupPoint.setY(popupPoint.y() - popupHeight);
-	else
-		popupPoint.setY(popupPoint.y() + height());
+    int popupHeight = m_popup-&gt;sizeHint().height();
+    if (popupPoint.y() + height() + popupHeight &gt; desk.bottom())
+        popupPoint.setY(popupPoint.y() - popupHeight);
+    else
+        popupPoint.setY(popupPoint.y() + height());
 
-	int popupWidth = m_popup-&gt;sizeHint().width();
-	if (popupPoint.x() + popupWidth &gt; desk.right())
-		popupPoint.setX(desk.right() - popupWidth);
+    int popupWidth = m_popup-&gt;sizeHint().width();
+    if (popupPoint.x() + popupWidth &gt; desk.right())
+        popupPoint.setX(desk.right() - popupWidth);
 
-	if (popupPoint.x() &lt; desk.left())
-		popupPoint.setX(desk.left());
+    if (popupPoint.x() &lt; desk.left())
+        popupPoint.setX(desk.left());
 
-	if (popupPoint.y() &lt; desk.top())
-		popupPoint.setY(desk.top());
+    if (popupPoint.y() &lt; desk.top())
+        popupPoint.setY(desk.top());
 
-	// Configure the popup:
-	m_popup-&gt;move(popupPoint);
-	//m_popup-&gt;setColor(m_color);
-	m_popup-&gt;doSelection();
-	m_popup-&gt;relayout(); // FIXME: In aboutToShow() ?
+    // Configure the popup:
+    m_popup-&gt;move(popupPoint);
+    //m_popup-&gt;setColor(m_color);
+    m_popup-&gt;doSelection();
+    m_popup-&gt;relayout(); // FIXME: In aboutToShow() ?
 #if 0
 //#ifndef QT_NO_EFFECTS
-	if (QApplication::isEffectEnabled(UI_AnimateCombo)) {
-		if (m_popup-&gt;y() &lt; mapToGlobal(QPoint(0,0)).y())
-			qScrollEffect(m_popup, QEffects::UpScroll);
-		else
-			qScrollEffect(m_popup);
-	} else
+    if (QApplication::isEffectEnabled(UI_AnimateCombo)) {
+        if (m_popup-&gt;y() &lt; mapToGlobal(QPoint(0, 0)).y())
+            qScrollEffect(m_popup, QEffects::UpScroll);
+        else
+            qScrollEffect(m_popup);
+    } else
 #endif
-		m_popup-&gt;show();
+        m_popup-&gt;show();
 
-	// The combo box is now shown pressed. Make it show not pressed again
-	// by causing its (invisible) list box to emit a 'selected' signal.
-	// Simulate an Enter to unpress it:
-	QListWidget *lb = listBox();
-	if (lb) {
-		lb-&gt;setCurrentItem(0);
-		QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0, 0);
-		QApplication::postEvent(lb, keyEvent);
-	}
+    // The combo box is now shown pressed. Make it show not pressed again
+    // by causing its (invisible) list box to emit a 'selected' signal.
+    // Simulate an Enter to unpress it:
+    QListWidget *lb = listBox();
+    if (lb) {
+        lb-&gt;setCurrentItem(0);
+        QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0, 0);
+        QApplication::postEvent(lb, keyEvent);
+    }
 }
 
 bool KColorCombo2::eventFilter(QObject */*object*/, QEvent *event)
 {
-	QMouseEvent *mouseEvent;
-
-	switch (event-&gt;type()) {
-		case QEvent::MouseButtonDblClick:
-		case QEvent::MouseButtonPress:
-			mouseEvent = (QMouseEvent*)event;
-			if ( !m_popup-&gt;rect().contains(mouseEvent-&gt;pos()) ) {
-				QPoint globalPos = m_popup-&gt;mapToGlobal(mouseEvent-&gt;pos());
-				if (QApplication::widgetAt(globalPos, /*child=*/true) == this) {
-					// The popup is being closed by a click on the KColorCombo2 widget.
-					// Avoid popping it up again immediately:
-					m_discardNextMousePress = true;
-				}
-			}
-			break;
-		default:
-			break;
-	}
-
-	// Don't stop the event being handled further:
-	return false;
+    QMouseEvent *mouseEvent;
+
+    switch (event-&gt;type()) {
+    case QEvent::MouseButtonDblClick:
+    case QEvent::MouseButtonPress:
+        mouseEvent = (QMouseEvent*)event;
+        if (!m_popup-&gt;rect().contains(mouseEvent-&gt;pos())) {
+            QPoint globalPos = m_popup-&gt;mapToGlobal(mouseEvent-&gt;pos());
+            if (QApplication::widgetAt(globalPos, /*child=*/true) == this) {
+                // The popup is being closed by a click on the KColorCombo2 widget.
+                // Avoid popping it up again immediately:
+                m_discardNextMousePress = true;
+            }
+        }
+        break;
+    default:
+        break;
+    }
+
+    // Don't stop the event being handled further:
+    return false;
 }
 
 void KColorCombo2::mousePressEvent(QMouseEvent *event)
 {
-	m_dragStartPos = event-&gt;pos();
+    m_dragStartPos = event-&gt;pos();
 
-	if (event-&gt;button() == Qt::LeftButton &amp;&amp; m_discardNextMousePress)
-		m_discardNextMousePress = false;
-	else
-		QComboBox::mousePressEvent(event);
+    if (event-&gt;button() == Qt::LeftButton &amp;&amp; m_discardNextMousePress)
+        m_discardNextMousePress = false;
+    else
+        QComboBox::mousePressEvent(event);
 }
 
 void KColorCombo2::mouseMoveEvent(QMouseEvent *event)
 {
-	if( (event-&gt;state() &amp; Qt::LeftButton) &amp;&amp;
-	    (event-&gt;pos() - m_dragStartPos).manhattanLength() &gt; KGlobalSettings::dndEventDelay() ) {
-		// Drag color object:
-		QMimeData* mimeData = new QMimeData;
-		QDrag* colorDrag = new QDrag(this);
-		mimeData-&gt;setColor(effectiveColor());
-		// Replace the drag pixmap with our own rounded one, at the same position and dimetions:
-		QPixmap pixmap = colorDrag-&gt;pixmap();
-		pixmap = colorRectPixmap(effectiveColor(), /*isDefault=*/false, pixmap.width(), pixmap.height());
-		colorDrag-&gt;setPixmap(pixmap, colorDrag-&gt;pixmapHotSpot());
-		colorDrag-&gt;exec(Qt::CopyAction, Qt::CopyAction);
-		//setDown(false);
-	}
+    if ((event-&gt;state() &amp; Qt::LeftButton) &amp;&amp;
+            (event-&gt;pos() - m_dragStartPos).manhattanLength() &gt; KGlobalSettings::dndEventDelay()) {
+        // Drag color object:
+        QMimeData* mimeData = new QMimeData;
+        QDrag* colorDrag = new QDrag(this);
+        mimeData-&gt;setColor(effectiveColor());
+        // Replace the drag pixmap with our own rounded one, at the same position and dimetions:
+        QPixmap pixmap = colorDrag-&gt;pixmap();
+        pixmap = colorRectPixmap(effectiveColor(), /*isDefault=*/false, pixmap.width(), pixmap.height());
+        colorDrag-&gt;setPixmap(pixmap, colorDrag-&gt;pixmapHotSpot());
+        colorDrag-&gt;exec(Qt::CopyAction, Qt::CopyAction);
+        //setDown(false);
+    }
 }
 
 void KColorCombo2::dragEnterEvent(QDragEnterEvent *event)
 {
-	event-&gt;accept(isEnabled() &amp;&amp; event-&gt;mimeData()-&gt;hasColor());
+    event-&gt;accept(isEnabled() &amp;&amp; event-&gt;mimeData()-&gt;hasColor());
 }
 
 void KColorCombo2::dropEvent(QDropEvent *event)
 {
-	QColor color;
-	color = qvariant_cast&lt;QColor&gt;(event-&gt;mimeData()-&gt;colorData());
-	if (color.isValid())
-		setColor(color);
+    QColor color;
+    color = qvariant_cast&lt;QColor&gt;(event-&gt;mimeData()-&gt;colorData());
+    if (color.isValid())
+        setColor(color);
 }
 
 void KColorCombo2::keyPressEvent(QKeyEvent *event)
 {
-	KKey key(event);
+    KKey key(event);
 
-	if (KStandardShortcut::copy().contains(key)) {
-		QMimeData *mime = new QMimeData;
-		mime-&gt;setColor(effectiveColor());
-		QApplication::clipboard()-&gt;setData(mime, QClipboard::Clipboard);
-	} else if (KStandardShortcut::paste().contains(key)) {
-		QColor color;
-		color = qvariant_cast&lt;QColor&gt;(QApplication::clipboard()-&gt;data(QClipboard::Clipboard)-&gt;colorData());
-		setColor(color);
-	} else
-		QComboBox::keyPressEvent(event);
+    if (KStandardShortcut::copy().contains(key)) {
+        QMimeData *mime = new QMimeData;
+        mime-&gt;setColor(effectiveColor());
+        QApplication::clipboard()-&gt;setData(mime, QClipboard::Clipboard);
+    } else if (KStandardShortcut::paste().contains(key)) {
+        QColor color;
+        color = qvariant_cast&lt;QColor&gt;(QApplication::clipboard()-&gt;data(QClipboard::Clipboard)-&gt;colorData());
+        setColor(color);
+    } else
+        QComboBox::keyPressEvent(event);
 }
 
 void KColorCombo2::fontChange(const QFont &amp;oldFont)
 {
-	// Since the color-rectangle is the same height of the text, we should resize it if the font change:
-	updateComboBox();
-	QComboBox::fontChange(oldFont); // To update geometry.
+    // Since the color-rectangle is the same height of the text, we should resize it if the font change:
+    updateComboBox();
+    QComboBox::fontChange(oldFont); // To update geometry.
 }
 
 void KColorCombo2::virtual_hook(int /*id*/, void */*data*/)
 {
-	/* KBASE::virtual_hook(id, data); */
+    /* KBASE::virtual_hook(id, data); */
 }
 
 #endif // USE_NEW_KCOLORCOMBO</diff>
      <filename>src/kcolorcombo2.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -48,26 +48,22 @@ class KColorCombo2 : public KColorCombo
 public:
     KColorCombo2(const QColor &amp;color,
                  const QColor &amp;defaultColor,
-                 QWidget *parent=0)
-        : KColorCombo(parent)
-    {
+                 QWidget *parent = 0)
+            : KColorCombo(parent) {
         setColor(color);
         setDefaultColor(defaultColor);
     }
 
     KColorCombo2(const QColor &amp;color,
-                 QWidget *parent=0)
-        : KColorCombo(parent)
-    {
+                 QWidget *parent = 0)
+            : KColorCombo(parent) {
         setColor(color);
     }
 
-    KColorCombo2(QWidget *parent=0)
-        : KColorCombo(parent)
-    {}
+    KColorCombo2(QWidget *parent = 0)
+            : KColorCombo(parent) {}
 
-    void setDefaultColor(const QColor &amp;)
-    { /* noop */ }
+    void setDefaultColor(const QColor &amp;) { /* noop */ }
 };
 
 
@@ -120,233 +116,233 @@ public:
  */
 class KColorCombo2 : public QComboBox
 {
-  Q_OBJECT
-  Q_PROPERTY(QColor color        READ color        WRITE setColor)
-  Q_PROPERTY(QColor defaultColor READ defaultColor WRITE setDefaultColor)
-
-  public slots:
-	/**
-	 * Change the selected color.\n
-	 * If the popup is open, it will not reflect the change. FIXME: Should it?
-	 * @param color The new selected color. Can be invalid to select the default one.\n
-	 *              If @p color is invalid and no default color is allowed, the function will keep the old one.
-	 */
-	void setColor(const QColor &amp;color);
-
-	/**
-	 * Change the default color.
-	 * @param color The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
-	 * @see defaultColor() to get it.
-	 */
-	void setDefaultColor(const QColor &amp;color);
-
-  signals:
-	/**
-	 * Emitted when the color of the widget is changed, either with setColor() or via user selection.
-	 * @see color() to know the content of @p newColor.
-	 */
-	void changed(const QColor &amp;newColor);
-
-  public:
-	/**
-	 * Constructs a color combobox with parent @p parent called @p name.
-	 * @param color         The initial selected color. If it is not valid, the default one will then be selected.\n
-	 *                      But if @p color is invalid and there is no default color, the result is undefined.
-	 * @param defaultColor  The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
-	 */
-	KColorCombo2(const QColor &amp;color, const QColor &amp;defaultColor, QWidget *parent = 0, const char *name = 0);
-
-	/**
-	 * Constructs a color combobox with parent @p parent called @p name.\n
-	 * The user is not allowed to choose a default color, unless you call setDefaultColor() later.
-	 * @param color         The initial selected color. If it is invalid, the result is undefined.
-	 */
-	KColorCombo2(const QColor &amp;color, QWidget *parent = 0L, const char *name = 0L);
-
-	/**
-	 * Destroys the combobox.
-	 */
-	virtual ~KColorCombo2();
-
-	/**
-	 * Get the color chosen by the user.\n
-	 * Can be invalid, if the user chosen the default one.\n
-	 * Ideal to store it in settings for later recall.
-	 * @see effectiveColor() if you want the color to be always valid.
-	 */
-	QColor color() const;
-
-	/**
-	 * Return the color chosen by the user.\n
-	 * If the user chosen the default color, the default one is then returned, so the returned color is always valid.\n
-	 * Ideal to directly use to draw.
-	 * @see color() if you want to be notified of a default color choice.
-	 */
-	QColor effectiveColor() const;
-
-	/**
-	 * Returns the default color or an invalid color if no default color is set (if the user isn't allowed to choose a default color).
-	 * @see setDefaultColor() to change it.
-	 */
-	QColor defaultColor() const;
-
-	/**
-	 * Allocate a new color array of the specified dimention.\n
-	 * The new array will have invalid colors: you should then assign them one by one.\n
-	 * If one or both of the dimentions are negative or null, this function do nothing (both dimentions are always ensured to be at least equal to 1).
-	 * @param columnCount The number of columns of the array.
-	 * @param rowCount    The number of rows of the array.
-	 * @see setColorAt() to set all colors once the array have been created.
-	 */
-	void newColorArray(int columnCount, int rowCount);
-
-	/**
-	 * Get the number of columns in the array that the user can see to choose.
-	 * @see rowCount() for the number of rows, and colorAt() to get a color from the array.
-	 */
-	int columnCount() const;
-
-	/**
-	 * Get the number of rows in the array that the user can see to choose.
-	 * @see columnCount() for the number of columns, and colorAt() to get a color from the array.
-	 */
-	int rowCount() const;
-
-	/**
-	 * Set a color in the array at position (column,row).\n
-	 * If one or both of the indexes are out of range, this function do nothing.\n
-	 * @p column and @p row start from 0 to columnCount()-1 and columnRow()-1.
-	 *
-	 * @param column The x coordinate of the color to set or change.
-	 * @param row    The y coordinate of the color to set or change.
-	 * @param color  The color to assign at this position.
-	 */
-	void setColorAt(int column, int row, const QColor &amp;color);
-
-	/**
-	 * Get a color in the array that the user can see to choose.\n
-	 * @p column and @p row start from 0 to columnCount()-1 and columnRow()-1.
-	 *
-	 * @return The asked color, or an invalid color if the index is out of limit of the array.
-	 * @see columnCount() and rowCount() to get the array dimentions.
-	 */
-	QColor colorAt(int column, int row)/* const*/;
-
-	/**
-	 * Fill the array of colors (that will be shown to the user in the popup that appears when he/she click the arrow) with a rainbow of different luminosity.\n
-	 * This rainbow representation have the advantage of being natural and well structured for a human to be able to select reasonable colors.\n
-	 * This function will allocate a color array by itself depending on the parameters (no need to call newColorArray()).
-	 * @param colorColumnCount The number of columns. The 360 possible colors of the rainbow will be splitted to take the wanted number of colors, equaly separated.
-	 * @param lightRowCount    There is always at least 1 row of colors: the &quot;pure&quot; colors: pure red, pure blue, pure green, pure fushia...\n
-	 *                         Additionnaly, you can add row on top: they will contain the same colors, but lighter.\n
-	 *                         The parameter @p lightRowCount specify how many different lighting grades shoud be shown (from near to white, but not white, to &quot;pure&quot;).
-	 * @param darkRowCount     Finally, on bottom of the row of &quot;pure colors&quot;, you can put any variety of dark colors (from &quot;pure&quot;, to near to black, but not black).\n
-	 *                         So, the number of rows is equal to @p lightRowCount + 1 + @p darkRowCount. On top are light colors, gradually going to dark ones on bottom.
-	 * @param withGray         If true, another column (so there will be @p colorColumnCount+1 columns) is added on the very-right of the popup
-	 *                         to show different gray values, matching the brightness of the sibling colors.
-	 *
-	 * The most acceptable parameters:
-	 * @li The default values are good to have the 7 colors of the rainbow + colors between them, and light/dark colors are well distinct.
-	 * @li If the color is a background color, you can set @p darkRowCount to 0, so only light colors are shown.
-	 * @li The inverse is true for text color choice: you can set @p lightRowCount to 0.
-	 * @li But be careful: some advanced users prefer white text on dark background, so you eg. can set @p lightRowCount to a big value and
-	 *     @p darkRowCount to a small one for a fewer choice of dark colors, but at least some ones.
-	 */
-	void setRainbowPreset(int colorColumnCount = 12, int lightRowCount = 4, int darkRowCount = 4, bool withGray = true);
-	//void setHsvPreset(QColor hue[], QColor saturation[], QColor value[], bool withGray = true);
-
-	/**
-	 * Returns a pixmap of a colored rounded-rectangle. The four corners are transparent.\n
-	 * Useful if you want to set such a rectangle as an icon for a menu entry, or for drag and drop operation...
-	 * @param color     The color of the rectangle. If the color is invalid, a rainbow is then drawn (like for the &quot;Other...&quot; entry in the popup).
-	 * @param isDefault True if @p color is the default one and should then be draw with a diagonal line.
-	 * @param width     The width of the rectangle pixmap to return.
-	 * @param height    The height of the rectangle pixmap to return.
-	 *
-	 * @see drawColorRect() if you need to draw it directly: it's faster.
-	 */
-	static QPixmap colorRectPixmap(const QColor &amp;color, bool isDefault, int width, int height);
-
-	/**
-	 * Draw an image of a colored rounded-rectangle.\n
-	 * This is like colorRectPixmap() but significantly faster because there is nothing to copy, and no transparency mask to create and apply.
-	 * @param painter   The painter where to draw the image.
-	 * @param x         The x coordinate on the @p painter where to draw the rectangle.
-	 * @param y         The y coordinate on the @p painter where to draw the rectangle.
-	 * @param color     The color of the rectangle. If the color is invalid, a rainbow is then drawn (like for the &quot;Other...&quot; entry in the popup).
-	 * @param isDefault True if @p color is the default one and should then be draw with a diagonal line.
-	 * @param width     The width of the rectangle pixmap to return.
-	 * @param height    The height of the rectangle pixmap to return.
-	 *
-	 * @see colorRectPixmap() to get a transparent pixmap of the rectangle.
-	 */
-	static void drawColorRect(QPainter &amp;painter, int x, int y, const QColor &amp;color, bool isDefault, int width, int height);
-
-	/**
-	 * Get the height of a color rectangle for this combobox.\n
-	 * This is equal to the text height, regarding to the current font of this combobox.
-	 */
-	int colorRectHeight() const;
-
-	/**
-	 * Get the width of a color rectangle, depending of the @p height of it.\n
-	 * It typically return 1.4 * @p height for decent rectangle proportions.
-	 */
-	int colorRectWidthForHeight(int height) const;
-
-  protected:
-	virtual void popup();
-	virtual void mousePressEvent(QMouseEvent *event);
-	virtual void mouseMoveEvent(QMouseEvent *event);
-	virtual bool eventFilter(QObject *object, QEvent *event);
-	virtual void dragEnterEvent(QDragEnterEvent *event);
-	virtual void dropEvent(QDropEvent *event);
-	virtual void keyPressEvent(QKeyEvent *event);
-	virtual void fontChange(const QFont &amp;oldFont);
-
-  private:
-	/**
-	 * Initialization routine common to every constructors.\n
-	 * Constructors just have to initialize the QComboBox, m_color and m_defaultColor
-	 * and this function do the rest to complete the creation of this widget.
-	 */
-	void init();
-
-	/**
-	 * Free up all memory allocated for the color array.\n
-	 * But only if an array have previously been allocated, of course.
-	 */
-	void deleteColorArray();
-
-	/**
-	 * Update the only item of the combobox to mirror the new selected color.\n
-	 * Mainly called on init() and setColor().
-	 */
-	void updateComboBox();
-
-	KColorPopup *m_popup;
-	QColor       m_color;
-	QColor       m_defaultColor;
-	bool         m_discardNextMousePress;
-	QColor     **m_colorArray;
-	int          m_columnCount;
-	int          m_rowCount;
-	QPoint       m_dragStartPos;
-
-  protected:
-	/**
-	 * Keep place for future improvements without having to break binary compatibility.\n
-	 * Does nothing for the moment.
-	 */
-	virtual void virtual_hook(int id, void *data);
-
-  private:
-	/**
-	 * Keep place for future improvements without having to break binary compatibility.
-	 */
-	class KColorCombo2Private;
-
-	KColorCombo2Private *d;
+    Q_OBJECT
+    Q_PROPERTY(QColor color        READ color        WRITE setColor)
+    Q_PROPERTY(QColor defaultColor READ defaultColor WRITE setDefaultColor)
+
+public slots:
+    /**
+     * Change the selected color.\n
+     * If the popup is open, it will not reflect the change. FIXME: Should it?
+     * @param color The new selected color. Can be invalid to select the default one.\n
+     *              If @p color is invalid and no default color is allowed, the function will keep the old one.
+     */
+    void setColor(const QColor &amp;color);
+
+    /**
+     * Change the default color.
+     * @param color The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
+     * @see defaultColor() to get it.
+     */
+    void setDefaultColor(const QColor &amp;color);
+
+signals:
+    /**
+     * Emitted when the color of the widget is changed, either with setColor() or via user selection.
+     * @see color() to know the content of @p newColor.
+     */
+    void changed(const QColor &amp;newColor);
+
+public:
+    /**
+     * Constructs a color combobox with parent @p parent called @p name.
+     * @param color         The initial selected color. If it is not valid, the default one will then be selected.\n
+     *                      But if @p color is invalid and there is no default color, the result is undefined.
+     * @param defaultColor  The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
+     */
+    KColorCombo2(const QColor &amp;color, const QColor &amp;defaultColor, QWidget *parent = 0, const char *name = 0);
+
+    /**
+     * Constructs a color combobox with parent @p parent called @p name.\n
+     * The user is not allowed to choose a default color, unless you call setDefaultColor() later.
+     * @param color         The initial selected color. If it is invalid, the result is undefined.
+     */
+    KColorCombo2(const QColor &amp;color, QWidget *parent = 0L, const char *name = 0L);
+
+    /**
+     * Destroys the combobox.
+     */
+    virtual ~KColorCombo2();
+
+    /**
+     * Get the color chosen by the user.\n
+     * Can be invalid, if the user chosen the default one.\n
+     * Ideal to store it in settings for later recall.
+     * @see effectiveColor() if you want the color to be always valid.
+     */
+    QColor color() const;
+
+    /**
+     * Return the color chosen by the user.\n
+     * If the user chosen the default color, the default one is then returned, so the returned color is always valid.\n
+     * Ideal to directly use to draw.
+     * @see color() if you want to be notified of a default color choice.
+     */
+    QColor effectiveColor() const;
+
+    /**
+     * Returns the default color or an invalid color if no default color is set (if the user isn't allowed to choose a default color).
+     * @see setDefaultColor() to change it.
+     */
+    QColor defaultColor() const;
+
+    /**
+     * Allocate a new color array of the specified dimention.\n
+     * The new array will have invalid colors: you should then assign them one by one.\n
+     * If one or both of the dimentions are negative or null, this function do nothing (both dimentions are always ensured to be at least equal to 1).
+     * @param columnCount The number of columns of the array.
+     * @param rowCount    The number of rows of the array.
+     * @see setColorAt() to set all colors once the array have been created.
+     */
+    void newColorArray(int columnCount, int rowCount);
+
+    /**
+     * Get the number of columns in the array that the user can see to choose.
+     * @see rowCount() for the number of rows, and colorAt() to get a color from the array.
+     */
+    int columnCount() const;
+
+    /**
+     * Get the number of rows in the array that the user can see to choose.
+     * @see columnCount() for the number of columns, and colorAt() to get a color from the array.
+     */
+    int rowCount() const;
+
+    /**
+     * Set a color in the array at position (column,row).\n
+     * If one or both of the indexes are out of range, this function do nothing.\n
+     * @p column and @p row start from 0 to columnCount()-1 and columnRow()-1.
+     *
+     * @param column The x coordinate of the color to set or change.
+     * @param row    The y coordinate of the color to set or change.
+     * @param color  The color to assign at this position.
+     */
+    void setColorAt(int column, int row, const QColor &amp;color);
+
+    /**
+     * Get a color in the array that the user can see to choose.\n
+     * @p column and @p row start from 0 to columnCount()-1 and columnRow()-1.
+     *
+     * @return The asked color, or an invalid color if the index is out of limit of the array.
+     * @see columnCount() and rowCount() to get the array dimentions.
+     */
+    QColor colorAt(int column, int row)/* const*/;
+
+    /**
+     * Fill the array of colors (that will be shown to the user in the popup that appears when he/she click the arrow) with a rainbow of different luminosity.\n
+     * This rainbow representation have the advantage of being natural and well structured for a human to be able to select reasonable colors.\n
+     * This function will allocate a color array by itself depending on the parameters (no need to call newColorArray()).
+     * @param colorColumnCount The number of columns. The 360 possible colors of the rainbow will be splitted to take the wanted number of colors, equaly separated.
+     * @param lightRowCount    There is always at least 1 row of colors: the &quot;pure&quot; colors: pure red, pure blue, pure green, pure fushia...\n
+     *                         Additionnaly, you can add row on top: they will contain the same colors, but lighter.\n
+     *                         The parameter @p lightRowCount specify how many different lighting grades shoud be shown (from near to white, but not white, to &quot;pure&quot;).
+     * @param darkRowCount     Finally, on bottom of the row of &quot;pure colors&quot;, you can put any variety of dark colors (from &quot;pure&quot;, to near to black, but not black).\n
+     *                         So, the number of rows is equal to @p lightRowCount + 1 + @p darkRowCount. On top are light colors, gradually going to dark ones on bottom.
+     * @param withGray         If true, another column (so there will be @p colorColumnCount+1 columns) is added on the very-right of the popup
+     *                         to show different gray values, matching the brightness of the sibling colors.
+     *
+     * The most acceptable parameters:
+     * @li The default values are good to have the 7 colors of the rainbow + colors between them, and light/dark colors are well distinct.
+     * @li If the color is a background color, you can set @p darkRowCount to 0, so only light colors are shown.
+     * @li The inverse is true for text color choice: you can set @p lightRowCount to 0.
+     * @li But be careful: some advanced users prefer white text on dark background, so you eg. can set @p lightRowCount to a big value and
+     *     @p darkRowCount to a small one for a fewer choice of dark colors, but at least some ones.
+     */
+    void setRainbowPreset(int colorColumnCount = 12, int lightRowCount = 4, int darkRowCount = 4, bool withGray = true);
+    //void setHsvPreset(QColor hue[], QColor saturation[], QColor value[], bool withGray = true);
+
+    /**
+     * Returns a pixmap of a colored rounded-rectangle. The four corners are transparent.\n
+     * Useful if you want to set such a rectangle as an icon for a menu entry, or for drag and drop operation...
+     * @param color     The color of the rectangle. If the color is invalid, a rainbow is then drawn (like for the &quot;Other...&quot; entry in the popup).
+     * @param isDefault True if @p color is the default one and should then be draw with a diagonal line.
+     * @param width     The width of the rectangle pixma