Commit 688ab72c authored by Kelvie Wong's avatar Kelvie Wong
Browse files

Removed all of the whitespace changes from kde4port-svn.

The process to get rid of the whitespace changes was this:
1. First ask git to create a diff without whitespace changes
2. Run a script to go in and reject hunks with non-trivial whitespace
   changes (such as multiline whitespace changes and adding whitespace
   where there were none before).
3. Apply the new patch.
4. Apply the changes between this new HEAD and kde4port-svn onto kde4port-svn

For those interested, step 2 (it's not ???) was done in Emacs using
Emacs lisp calls via Pymacs.

This was some effort, but the rationale behind this is to make it a
_lot_ easier to merge later on.

This was initially done as a squashed merge, but I don't want to get rid of the
history when I merge (credit goes where credit is due).

This saves about 5000 lines to review as I merge this branch into the
fresh port (done by the kdesdk porting scripts) to see what work was
actually done on this port.
parent 97f885e8
PROJECT(basket)
# Find the requisite packages
#FIND_PACKAGE(Qt4 REQUIRED)
FIND_PACKAGE(KDE4 REQUIRED)
......@@ -53,7 +52,7 @@ ADD_SUBDIRECTORY(doc)
#$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
# @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
#
#MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
#MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
#
#package-messages:
# $(MAKE) -f admin/Makefile.common package-messages
......
......@@ -9,9 +9,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${K
#original Makefile.am contents follow:
## the SUBDIRS is filled automatically by am_edit. If files are
## the SUBDIRS is filled automatically by am_edit. If files are
## in this directory they are installed into the english dir
#
#KDE_LANG = en
#KDE_DOCS = basket
#SUBDIRS = $(AUTODIRS)
#SUBDIRS = $(AUTODIRS)
########### next target ###############
SET(basketcommon_LIB_SRCS
archive.cpp
archive.cpp
bnpview.cpp
basket.cpp
basketproperties.cpp
basket.cpp
basketproperties.cpp
linklabel.cpp
variouswidgets.cpp
xmlwork.cpp
keyboard.cpp
global.cpp
global.cpp
exporterdialog.cpp
htmlexporter.cpp
htmlexporter.cpp
notefactory.cpp
softwareimporters.cpp
focusedwidgets.cpp
......@@ -19,18 +19,18 @@ SET(basketcommon_LIB_SRCS
basketfactory.cpp
tag.cpp
qeffects.cpp
kcolorcombo2.cpp
newbasketdialog.cpp
kcolorcombo2.cpp
newbasketdialog.cpp
tagsedit.cpp
formatimporter.cpp
note.cpp
note.cpp
notecontent.cpp
notedrag.cpp
noteedit.cpp
notedrag.cpp
noteedit.cpp
filter.cpp
tools.cpp
backgroundmanager.cpp
regiongrabber.cpp
regiongrabber.cpp
#kicondialog.cpp
#kiconcanvas.cpp
kgpgme.cpp
......@@ -40,13 +40,13 @@ SET(basketcommon_LIB_SRCS
colorpicker.cpp
baskettree.cpp
debugwindow.cpp
systemtray.cpp
systemtray.cpp
aboutdata.cpp
basketstatusbar.cpp
clickablelabel.cpp
backup.cpp
settings.cpp
)
)
#kde4_automoc(${basketcommon_LIB_SRCS})
......
......@@ -61,7 +61,7 @@ BackupDialog::BackupDialog ( QWidget *parent )
{
setModal(true);
setCaption( i18n ( "Backup & Restore" ) );
setButtons( KDialog::Close|KDialog::Close );
setButtons( KDialog::Close|KDialog::Close );
showButtonSeparator( false );
KVBox *page = new KVBox ( this );
......@@ -69,64 +69,65 @@ BackupDialog::BackupDialog ( QWidget *parent )
// page->setSpacing(spacingHint());
QString savesFolder = Global::savesFolder();
savesFolder = savesFolder.left ( savesFolder.length() - 1 ); // savesFolder ends with "/"
savesFolder = savesFolder.left(savesFolder.length() - 1); // savesFolder ends with "/"
QGroupBox *folderGroup = new QGroupBox ( i18n ( "Save Folder" ), page );
new QLabel ( "<qt><nobr>" + i18n ( "Your baskets are currently stored in that folder:<br><b>%1</b>" ).arg ( savesFolder ), folderGroup );
QWidget *folderWidget = new QWidget ( folderGroup );
new QLabel("<qt><nobr>" + i18n("Your baskets are currently stored in that folder:<br><b>%1</b>").arg(savesFolder), folderGroup);
QWidget *folderWidget = new QWidget(folderGroup);
QHBoxLayout *folderLayout = new QHBoxLayout ( folderWidget );
folderLayout->setMargin ( 0 );
folderLayout->setSpacing ( spacingHint() );
QPushButton *moveFolder = new QPushButton ( i18n ( "&Move to Another Folder..." ), folderWidget );
QPushButton *useFolder = new QPushButton ( i18n ( "&Use Another Existing Folder..." ), folderWidget );
HelpLabel *helpLabel = new HelpLabel ( i18n ( "Why to do that?" ), i18n (
"<p>You can move the folder where %1 store your baskets to:</p><ul>"
"<li>Store your baskets in a visible place in your home folder, like ~/Notes or ~/Baskets, so you can manually backup them when you want.</li>"
"<li>Store your baskets on a server to share them between two computers.<br>"
"In this case, mount the shared-folder to the local file system and ask %2 to use that mount point.<br>"
"Warning: you should not run %3 at the same time on both computers, or you risk to loss data while the two applications are desynced.</li>"
"</ul><p>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).</p>" )
QPushButton *moveFolder = new QPushButton(i18n("&Move to Another Folder..."), folderWidget);
QPushButton *useFolder = new QPushButton(i18n("&Use Another Existing Folder..."), folderWidget);
HelpLabel *helpLabel = new HelpLabel(i18n("Why to do that?"), i18n(
"<p>You can move the folder where %1 store your baskets to:</p><ul>"
"<li>Store your baskets in a visible place in your home folder, like ~/Notes or ~/Baskets, so you can manually backup them when you want.</li>"
"<li>Store your baskets on a server to share them between two computers.<br>"
"In this case, mount the shared-folder to the local file system and ask %2 to use that mount point.<br>"
"Warning: you should not run %3 at the same time on both computers, or you risk to loss data while the two applications are desynced.</li>"
"</ul><p>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).</p>")
.arg ( KCmdLineArgs::aboutData( )->programName() )
.arg ( KCmdLineArgs::aboutData( )->programName() )
.arg ( KCmdLineArgs::aboutData( )->programName() ),
folderWidget );
folderLayout->addWidget ( moveFolder );
folderLayout->addWidget ( useFolder );
folderLayout->addWidget ( helpLabel );
folderWidget);
folderLayout->addWidget(moveFolder);
folderLayout->addWidget(useFolder);
folderLayout->addWidget(helpLabel);
folderLayout->addStretch();
connect ( moveFolder, SIGNAL ( clicked() ), this, SLOT ( moveToAnotherFolder() ) );
connect ( useFolder, SIGNAL ( clicked() ), this, SLOT ( useAnotherExistingFolder() ) );
connect( moveFolder, SIGNAL(clicked()), this, SLOT(moveToAnotherFolder()) );
connect( useFolder, SIGNAL(clicked()), this, SLOT(useAnotherExistingFolder()) );
QGroupBox *backupGroup = new QGroupBox ( i18n ( "Backups" ), page );
QWidget *backupWidget = new QWidget ( backupGroup );
QWidget *backupWidget = new QWidget(backupGroup);
QHBoxLayout *backupLayout = new QHBoxLayout ( backupWidget );
backupLayout->setMargin ( 0 );
backupLayout->setSpacing ( spacingHint() );
QPushButton *backupButton = new QPushButton ( i18n ( "&Backup..." ), backupWidget );
QPushButton *restoreButton = new QPushButton ( i18n ( "&Restore a Backup..." ), backupWidget );
m_lastBackup = new QLabel ( "", backupWidget );
backupLayout->addWidget ( backupButton );
backupLayout->addWidget ( restoreButton );
backupLayout->addWidget ( m_lastBackup );
QPushButton *backupButton = new QPushButton(i18n("&Backup..."), backupWidget);
QPushButton *restoreButton = new QPushButton(i18n("&Restore a Backup..."), backupWidget);
m_lastBackup = new QLabel("", backupWidget);
backupLayout->addWidget(backupButton);
backupLayout->addWidget(restoreButton);
backupLayout->addWidget(m_lastBackup);
backupLayout->addStretch();
connect ( backupButton, SIGNAL ( clicked() ), this, SLOT ( backup() ) );
connect ( restoreButton, SIGNAL ( clicked() ), this, SLOT ( restore() ) );
connect( backupButton, SIGNAL(clicked()), this, SLOT(backup()) );
connect( restoreButton, SIGNAL(clicked()), this, SLOT(restore()) );
populateLastBackup();
( new QWidget ( page ) )->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding );
(new QWidget(page))->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
BackupDialog::~BackupDialog()
{}
{
}
void BackupDialog::populateLastBackup()
{
QString lastBackupText = i18n ( "Last backup: never" );
if ( Settings::lastBackup().isValid() )
lastBackupText = i18n ( "Last backup: %1" ).arg ( Settings::lastBackup().toString ( Qt::LocalDate ) );
QString lastBackupText = i18n("Last backup: never");
if (Settings::lastBackup().isValid())
lastBackupText = i18n("Last backup: %1").arg(Settings::lastBackup().toString(Qt::LocalDate));
m_lastBackup->setText ( lastBackupText );
m_lastBackup->setText(lastBackupText);
}
void BackupDialog::moveToAnotherFolder()
......@@ -183,58 +184,55 @@ void BackupDialog::backup()
KConfigGroup config = KGlobal::config()->group ( "Backups" );
QString folder = config.readEntry ( "lastFolder", QDir::homePath() ) + "/";
QString fileName = i18nc ( "Backup filename (without extension), %1 is the date", "Baskets_%1" )
.arg ( QDate::currentDate().toString ( Qt::ISODate ) );
.arg(QDate::currentDate().toString(Qt::ISODate));
QString url = folder + fileName;
// Ask a file name & path to the user:
QString filter = "*.tar.gz|" + i18n ( "Tar Archives Compressed by Gzip" ) + "\n*|" + i18n ( "All Files" );
QString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
QString destination = url;
for ( bool askAgain = true; askAgain; )
{
for (bool askAgain = true; askAgain; ) {
// Ask:
destination = KFileDialog::getSaveFileName ( destination, filter, 0, i18n ( "Backup Baskets" ) );
destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n("Backup Baskets"));
// User canceled?
if ( destination.isEmpty() )
if (destination.isEmpty())
return;
// File already existing? Ask for overriding:
if ( dir.exists ( destination ) )
{
int result = KMessageBox::questionYesNoCancel (
0,
"<qt>" + i18n ( "The file <b>%1</b> already exists. Do you really want to override it?" )
if (dir.exists(destination)) {
int result = KMessageBox::questionYesNoCancel(
0,
"<qt>" + i18n("The file <b>%1</b> already exists. Do you really want to override it?")
.arg ( KUrl ( destination ).fileName() ),
i18n ( "Override File?" ),
i18n("Override File?"),
KGuiItem ( i18n ( "&Override" ), "document-save" )
);
if ( result == KMessageBox::Cancel )
);
if (result == KMessageBox::Cancel)
return;
else if ( result == KMessageBox::Yes )
else if (result == KMessageBox::Yes)
askAgain = false;
}
else
} else
askAgain = false;
}
KProgressDialog dialog ( 0, i18n ( "Backup Baskets" ), i18n ( "Backing up baskets. Please wait..." ) );
dialog.setModal(true);
dialog.setAllowCancel ( false );
dialog.setAutoClose ( true );
dialog.setAllowCancel(false);
dialog.setAutoClose(true);
dialog.show();
QProgressBar *progress = dialog.progressBar();
progress->setRange(0, 0);
progress->setValue ( 0 );
progress->setTextVisible( false );
BackupThread thread ( destination, Global::savesFolder() );
BackupThread thread(destination, Global::savesFolder());
thread.start();
while ( thread.isRunning() )
{
progress->setValue(progress->value()+1); // Or else, the animation is not played!
kapp->processEvents();
usleep ( 300 ); // Not too long because if the backup process is finished, we wait for nothing
usleep(300); // Not too long because if the backup process is finished, we wait for nothing
}
Settings::setLastBackup ( QDate::currentDate() );
Settings::setLastBackup(QDate::currentDate());
Settings::saveConfig();
populateLastBackup();
}
......@@ -246,20 +244,20 @@ void BackupDialog::restore()
QString folder = config.readEntry ( "lastFolder", QDir::homePath() ) + "/";
// Ask a file name to the user:
QString filter = "*.tar.gz|" + i18n ( "Tar Archives Compressed by Gzip" ) + "\n*|" + i18n ( "All Files" );
QString path = KFileDialog::getOpenFileName ( folder, filter, this, i18n ( "Open Basket Archive" ) );
if ( path.isEmpty() ) // User has canceled
QString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
QString path = KFileDialog::getOpenFileName(folder, filter, this, i18n("Open Basket Archive"));
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 );
copier.moveFolder(Global::savesFolder(), safetyPath);
// Add the README file for user to cancel a bad restoration:
QString readmePath = safetyPath + i18n ( "README.txt" );
QFile file ( readmePath );
QString readmePath = safetyPath + i18n("README.txt");
QFile file(readmePath);
if ( file.open ( QIODevice::WriteOnly ) )
{
//TODO
......@@ -273,12 +271,12 @@ void BackupDialog::restore()
QString message =
"<p><nobr>" + i18n ( "Restoring <b>%1</b>. Please wait..." ).arg ( KUrl ( path ).fileName() ) + "</nobr></p><p>" +
i18n ( "If something goes wrong during the restoration process, read the file <b>%1</b>." ).arg ( readmePath );
i18n("If something goes wrong during the restoration process, read the file <b>%1</b>.").arg(readmePath);
KProgressDialog *dialog = new KProgressDialog ( 0, i18n ( "Restore Baskets" ), message);
dialog->setModal ( true );
dialog->setAllowCancel ( false );
dialog->setAutoClose ( true );
dialog->setAllowCancel(false);
dialog->setAutoClose(true);
dialog->show();
QProgressBar *progress = dialog->progressBar();
progress->setRange(0, 0);
......@@ -286,13 +284,13 @@ void BackupDialog::restore()
progress->setTextVisible( false );
// Uncompress:
RestoreThread thread ( path, Global::savesFolder() );
RestoreThread thread(path, Global::savesFolder());
thread.start();
while ( thread.isRunning() )
{
progress->setValue (progress->value()+ 1 ); // Or else, the animation is not played!
kapp->processEvents();
usleep ( 300 ); // Not too long because if the restore process is finished, we wait for nothing
usleep(300); // Not too long because if the restore process is finished, we wait for nothing
}
dialog->hide(); // The restore is finished, do not continue to show it while telling the user the application is going to be restarted
......@@ -301,14 +299,13 @@ void BackupDialog::restore()
//kapp->processEvents();
// Check for errors:
if ( !thread.success() )
{
if (!thread.success()) {
// Restore the old baskets:
QDir dir;
dir.remove ( readmePath );
copier.moveFolder ( safetyPath, Global::savesFolder() );
dir.remove(readmePath);
copier.moveFolder(safetyPath, Global::savesFolder());
// Tell the user:
KMessageBox::error ( 0, i18n ( "This archive is either not a backup of baskets or is corrupted. It cannot be imported. Your old baskets have been preserved instead." ), i18n ( "Restore Error" ) );
KMessageBox::error(0, i18n("This archive is either not a backup of baskets or is corrupted. It cannot be imported. Your old baskets have been preserved instead."), i18n("Restore Error"));
return;
}
......@@ -316,7 +313,7 @@ void BackupDialog::restore()
// 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 ( "Your backup has been successfuly restored to <b>%1</b>. %2 is going to be restarted to take this change into account." ) );
Backup::setFolderAndRestart(Global::savesFolder()/*No change*/, i18n("Your backup has been successfuly restored to <b>%1</b>. %2 is going to be restarted to take this change into account."));
}
/** class Backup: */
......@@ -326,7 +323,7 @@ QString Backup::binaryPath = "";
#include <iostream>
#include <kiconloader.h>
void Backup::figureOutBinaryPath ( const char *argv0, QApplication &app )
void Backup::figureOutBinaryPath(const char *argv0, QApplication &app)
{
/*
The application can be launched by two ways:
......@@ -340,31 +337,31 @@ void Backup::figureOutBinaryPath ( const char *argv0, QApplication &app )
"./src/.libs/basket" "/home/seb/prog/basket/debug/src/.lib/basket" "/opt/kde3/bin/basket"
*/
binaryPath = QDir ( argv0 ).canonicalPath();
if ( binaryPath.isEmpty() )
binaryPath = QDir(argv0).canonicalPath();
if (binaryPath.isEmpty())
binaryPath = app.applicationFilePath();
}
void Backup::setFolderAndRestart ( const QString &folder, const QString &message )
void Backup::setFolderAndRestart(const QString &folder, const QString &message)
{
// Set the folder:
Settings::setDataFolder ( 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,
"<qt>" + message.arg (
( folder.endsWith ( "/" ) ? folder.left ( folder.length() - 1 ) : folder ),
KMessageBox::information(
0,
"<qt>" + message.arg(
(folder.endsWith("/") ? folder.left(folder.length() - 1) : folder),
KCmdLineArgs::aboutData( )->programName() ),
i18n ( "Restart" )
i18n("Restart")
);
// Restart the application:
//FIXME 1.5 KRun::runCommand ( binaryPath, KCmdLineArgs::aboutData( )->programName(), kapp->iconName() );
KRun::runCommand ( KCmdLineArgs::aboutData( )->programName(),0);
exit ( 0 );
exit(0);
}
QString Backup::newSafetyFolder()
......@@ -373,13 +370,13 @@ QString Backup::newSafetyFolder()
QString fullPath;
fullPath = QDir::homePath() + "/" + i18nc ( "Safety folder name before restoring a basket data archive", "Baskets Before Restoration" ) + "/";
if ( !dir.exists ( fullPath ) )
if (!dir.exists(fullPath))
return fullPath;
for ( int i = 2; ; ++i )
{
fullPath = QDir::homePath() + "/" + i18nc ( "Safety folder name before restoring a basket data archive", "Baskets Before Restoration (%1)" ).arg ( i ) + "/";
if ( !dir.exists ( fullPath ) )
if (!dir.exists(fullPath))
return fullPath;
}
......@@ -388,23 +385,23 @@ QString Backup::newSafetyFolder()
/** class BackupThread: */
BackupThread::BackupThread ( const QString &tarFile, const QString &folderToBackup )
: m_tarFile ( tarFile ), m_folderToBackup ( folderToBackup )
{}
BackupThread::BackupThread(const QString &tarFile, const QString &folderToBackup)
: m_tarFile(tarFile), m_folderToBackup(folderToBackup)
{
}
void BackupThread::run()
{
KTar tar ( m_tarFile, "application/x-gzip" );
KTar tar(m_tarFile, "application/x-gzip");
tar.open ( QIODevice::WriteOnly );
tar.addLocalDirectory ( m_folderToBackup, backupMagicFolder );
tar.addLocalDirectory(m_folderToBackup, backupMagicFolder);
// KArchive does not add hidden files. Basket description files (".basket") are hidden, we add them manually:
QDir dir ( m_folderToBackup + "baskets/" );
QStringList baskets = dir.entryList ( QDir::Dirs );
for ( QStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it )
{
tar.addLocalFile (
m_folderToBackup + "baskets/" + *it + "/.basket",
backupMagicFolder + "/baskets/" + *it + "/.basket"
QDir dir(m_folderToBackup + "baskets/");
QStringList baskets = dir.entryList(QDir::Dirs);
for (QStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it) {
tar.addLocalFile(
m_folderToBackup + "baskets/" + *it + "/.basket",
backupMagicFolder + "/baskets/" + *it + "/.basket"
);
}
// We finished:
......@@ -413,24 +410,23 @@ void BackupThread::run()
/** class RestoreThread: */
RestoreThread::RestoreThread ( const QString &tarFile, const QString &destFolder )
: m_tarFile ( tarFile ), m_destFolder ( destFolder )
{}
RestoreThread::RestoreThread(const QString &tarFile, const QString &destFolder)
: m_tarFile(tarFile), m_destFolder(destFolder)
{
}
void RestoreThread::run()
{
m_success = false;
KTar tar ( m_tarFile, "application/x-gzip" );
KTar tar(m_tarFile, "application/x-gzip");
tar.open ( QIODevice::WriteOnly );
if ( tar.isOpen() )
{
const KArchiveDirectory *directory = tar.directory();
if ( directory->entries().contains ( backupMagicFolder ) )
{
const KArchiveEntry *entry = directory->entry ( backupMagicFolder );
if ( entry->isDirectory() )
{
( ( const KArchiveDirectory* ) entry )->copyTo ( m_destFolder );
if (directory->entries().contains(backupMagicFolder)) {
const KArchiveEntry *entry = directory->entry(backupMagicFolder);
if (entry->isDirectory()) {
((const KArchiveDirectory*) entry)->copyTo(m_destFolder);
m_success = true;
}
}
......
This diff is collapsed.
......@@ -65,7 +65,7 @@ QString BasketFactory::unpackTemplate(const QString &templateName)
KMessageBox::error(/*parent=*/0, i18n("Sorry, but the folder creation for this new basket has failed."), i18n("Basket Creation Failed"));
return "";
}
kDebug() << "successfully create directory!" << endl;
// Unpack the template file to that folder:
......
......@@ -44,7 +44,6 @@
#include "global.h"
#include "backgroundmanager.h"
BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
: //KDialog(KDialog::Swallow, i18n("Basket Properties"), KDialog::Ok | KDialog::Apply | KDialog::Cancel,
// KDialog::Ok, parent, /*name=*/"BasketProperties", /*modal=*/true, /*separator=*/false),
......@@ -80,7 +79,7 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
//TODO QGroupBox *appearance = new QGroupBox(1, Qt::Horizontal, i18n("Appearance"), page);
QGroupBox *appearance = new QGroupBox( i18n("Appearance"), page );
QWidget *appearanceWidget = new QWidget( appearance );
QWidget *appearanceWidget = new QWidget(appearance);
//TODO QGridLayout *grid = new QGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
QGridLayout *grid = new QGridLayout( appearanceWidget );
......@@ -102,7 +101,7 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
topLayout->addWidget(appearance);
/*TODO
m_backgroundImage->insertItem( i18n("(None)"), 0 );
m_backgroundImage->insertItem(i18n("(None)"), 0);
m_backgroundImagesMap.insert(0, "");
QStringList backgrounds = Global::backgroundManager->imageNames();
int index = 1;
......@@ -121,7 +120,7 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
//TODO m_backgroundImage->setSizeLimit(50/*75 * 6 / m_backgroundImage->sizeHint().height()*/);
//TODO m_backgroundImage->setMinimumHeight(75 + 2 * BUTTON_MARGIN);
//Disposition:
// Disposition:
// m_disposition = new QButtonGroup(i18n("Disposition"), page);
// QWidget *columnsWidget = new QWidget(m_disposition);
// QHBoxLayout *dispoLayout = new QHBoxLayout(columnsWidget, /*margin=*/0, spacingHint());
......
......@@ -33,13 +33,15 @@
#include <kiconloader.h>
#include <qtooltip.h>
BasketStatusBar::BasketStatusBar ( KStatusBar *bar )
: m_bar ( bar ), m_extension ( 0 ), m_selectionStatus ( 0 ), m_lockStatus ( 0 ), m_basketStatus ( 0 ), m_savedStatus ( 0 )
{}
BasketStatusBar::BasketStatusBar(KStatusBar *bar)
: 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 )
{}
BasketStatusBar::BasketStatusBar(KParts::StatusBarExtension *extension)
: m_bar(0), m_extension(extension), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
{
}
BasketStatusBar::~BasketStatusBar()
{
......@@ -48,16 +50,16 @@ BasketStatusBar::~BasketStatusBar()
KStatusBar *BasketStatusBar::statusBar () const
{
if ( m_extension )
if(m_extension)
return m_extension->statusBar();
else
return m_bar;
}
void BasketStatusBar::addWidget ( QWidget * widget, int stretch, bool permanent )
void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent)
{
if ( m_extension )
m_extension->addStatusBarItem ( widget, stretch, permanent );
if(m_extension)
m_extension->addStatusBarItem(widget, stretch, permanent);
else
m_bar->addPermanentWidget ( widget, stretch );
}
......@@ -70,113 +72,108 @@ void BasketStatusBar::setupStatusBar()
//Tools::printChildren(parent);
if ( lst.count() == 0 )
{
m_basketStatus = new QLabel ( parent );
m_basketStatus = new QLabel(parent);
QSizePolicy policy ( QSizePolicy::Ignored, QSizePolicy::Ignored );
policy.setHorizontalStretch ( 0 );
policy.setVerticalStretch ( 0 );
policy.setHeightForWidth ( false );
m_basketStatus->setSizePolicy ( policy );
addWidget ( m_basketStatus, 1, false ); // Fit all extra space and is hiddable
addWidget( m_basketStatus, 1, false ); // Fit all extra space and is hiddable
}
else
m_basketStatus = lst.at ( 0 );
m_selectionStatus = new QLabel ( i18n ( "Loading..."