Commit fcbcbc53 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Try to fix avatar support

parent 6209ee43
......@@ -87,10 +87,9 @@ AvatarManager::AvatarManager(QObject *parent)
: QObject(parent), d(new Private)
{
// Locate avatar data dir on disk
d->baseDir = QUrl( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/avatars") ) ;
// Create directory on disk, if necessary
d->createDirectory( d->baseDir );
const QString avatarPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/avatars");
d->createDirectory(QUrl(avatarPath));
d->baseDir = QUrl(avatarPath);
}
AvatarManager::~AvatarManager()
......@@ -323,7 +322,7 @@ void AvatarManager::Private::createDirectory(const QUrl &directory)
if( !QFile::exists(directory.toLocalFile()) )
{
qCDebug(LIBKOPETE_LOG) << "Creating directory: " << directory.toLocalFile();
if( !KIO::NetAccess::mkdir(directory,0) )
if( !KIO::NetAccess::mkdir(directory,0) )
{
qCDebug(LIBKOPETE_LOG) << "Directory " << directory.toLocalFile() <<" creating failed.";
}
......
/*
kopeteinfodialog.cpp - A dialog to configure information for contacts,
kopeteinfodialog.cpp - A dialog to configure information for contacts,
metacontacts, groups, identities, etc
Copyright (c) 2007 by Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
......@@ -38,46 +38,46 @@ namespace UI
class InfoDialog::Private
{
public:
KTitleWidget *title;
SettingsContainer *container;
KTitleWidget *title;
SettingsContainer *container;
};
InfoDialog::InfoDialog(QWidget *parent, const QString &title, const QString &icon)
: QDialog(parent), d(new Private())
: QDialog(parent), d(new Private())
{
initialize();
if (!title.isEmpty())
setTitle( title );
else
setTitle( i18n( "Information" ) );
setIcon( icon );
if (!title.isEmpty())
setTitle( title );
else
setTitle( i18n( "Information" ) );
setIcon( icon );
}
InfoDialog::InfoDialog(QWidget *parent, const QString &title, const QIcon &icon)
: QDialog(parent), d(new Private())
: QDialog(parent), d(new Private())
{
initialize();
if (!title.isEmpty())
setTitle( title );
else
setTitle( i18n( "Information" ) );
setIcon( icon );
if (!title.isEmpty())
setTitle( title );
else
setTitle( i18n( "Information" ) );
setIcon( icon );
}
void InfoDialog::initialize()
{
//FIXME: this should be changed
resize(500,500);
//FIXME: this should be changed
resize(500,500);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
d->title = new KTitleWidget();
d->title = new KTitleWidget();
mainLayout->addWidget( d->title );
d->container = new SettingsContainer();
d->container = new SettingsContainer();
mainLayout->addWidget( d->container );
QDialogButtonBox *button = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
connect(button, &QDialogButtonBox::accepted, this, &InfoDialog::slotSave);
......@@ -97,25 +97,25 @@ void InfoDialog::slotSave()
void InfoDialog::setTitle(const QString &title)
{
d->title->setText( title, Qt::AlignLeft );
d->title->setText( title, Qt::AlignLeft );
}
void InfoDialog::setIcon(const QString &icon)
{
d->title->setPixmap( icon );
d->title->setPixmap( icon );
}
void InfoDialog::setIcon(const QIcon &icon)
{
d->title->setPixmap( icon );
d->title->setPixmap( icon );
}
void InfoDialog::addWidget(QWidget *w, const QString &caption)
{
CollapsibleWidget *c = d->container->insertWidget(w, caption);
// FIXME: maybe we could check for pages that were collapsed by the user the
// last time the dialog was shown
c->setExpanded(true);
CollapsibleWidget *c = d->container->insertWidget(w, caption);
// FIXME: maybe we could check for pages that were collapsed by the user the
// last time the dialog was shown
c->setExpanded(true);
}
} // namespace UI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment