kwalletd: indent and format

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-28 21:36:06 +03:00
parent 5a94dc6959
commit 0af77fcbde
11 changed files with 1027 additions and 1027 deletions

View file

@ -369,21 +369,23 @@ int KWalletD::openPathAsync(const QString& path, qlonglong wId, const QString& a
// Sets up a dialog that will be shown by kwallet.
void KWalletD::setupDialog( QWidget* dialog, WId wId, const QString& appid, bool modal ) {
if( wId != 0 )
if( wId != 0 ) {
KWindowSystem::setMainWindow( dialog, wId ); // correct, set dialog parent
else {
if( appid.isEmpty())
} else {
if( appid.isEmpty()) {
kWarning() << "Using kwallet without parent window!";
else
} else {
kWarning() << "Application '" << appid << "' using kwallet without parent window!";
}
// allow dialog activation even if it interrupts, better than trying hacks
// with keeping the dialog on top or on all desktops
kapp->updateUserTimestamp();
}
if( modal )
if( modal ) {
KWindowSystem::setState( dialog->winId(), NET::Modal );
else
} else {
KWindowSystem::clearState( dialog->winId(), NET::Modal );
}
activeDialog = dialog;
}
@ -394,8 +396,9 @@ void KWalletD::setupDialog( QWidget* dialog, WId wId, const QString& appid, bool
// dialog parents. Hopefully to be done in KDE4, for now just use all kinds of bad hacks to make
// sure the user doesn't overlook the active dialog.
void KWalletD::checkActiveDialog() {
if( !activeDialog )
if( !activeDialog ) {
return;
}
kapp->updateUserTimestamp();
@ -554,8 +557,7 @@ int KWalletD::internalOpen(const QString& appid, const QString& wallet, bool isP
b->setCipherType(KWallet::BACKEND_CIPHER_BLOWFISH);
KNewPasswordDialog *kpd = new KNewPasswordDialog();
if (wallet == KWallet::Wallet::LocalWallet() ||
wallet == KWallet::Wallet::NetworkWallet())
{
wallet == KWallet::Wallet::NetworkWallet()) {
// Auto create these wallets.
if (appid.isEmpty()) {
kpd->setPrompt(i18n("KDE has requested to open the wallet. This is used to store sensitive data in a secure fashion. Please enter a password to use with this wallet or click cancel to deny the application's request."));
@ -612,8 +614,9 @@ int KWalletD::internalOpen(const QString& appid, const QString& wallet, bool isP
if (_closeIdle) {
_closeTimers.addTimer(rc, _idleTime);
}
if (brandNew)
if (brandNew) {
emit walletCreated(wallet);
}
emit walletOpened(wallet);
if (_wallets.count() == 1 && _launchManager) {
KToolInvocation::startServiceByDesktopName("kwalletmanager-kwalletd");
@ -758,7 +761,6 @@ void KWalletD::initiateSync(int handle) {
}
void KWalletD::doTransactionChangePassword(const QString& appid, const QString& wallet, qlonglong wId) {
const QPair<int, KWallet::Backend*> walletInfo = findWallet(wallet);
int handle = walletInfo.first;
KWallet::Backend* w = walletInfo.second;
@ -1533,9 +1535,10 @@ QString KWalletD::localWallet() {
void KWalletD::screenSaverChanged(bool s)
{
if (s)
if (s) {
closeAllWallets();
}
}
void KWalletD::activatePasswordDialog()
{

View file

@ -33,11 +33,12 @@ void openWallet()
QTimer::singleShot( 30000, qApp, SLOT( quit() ) );
int ret = qApp->exec();
if ( ret == 0 )
if ( ret == 0 ) {
_out << "Timed out!" << endl;
else
} else {
_out << "Success!" << endl;
}
}
void WalletReceiver::walletOpened( bool got )
{
@ -56,8 +57,7 @@ int main( int argc, char *argv[] )
= QDBusConnection::sessionBus().interface()->registerService( "org.kde.kwalletasync",
QDBusConnectionInterface::ReplaceExistingService );
if ( !reply.isValid() )
{
if ( !reply.isValid() ) {
_out << "D-BUS name request returned " << reply.error().name() << endl;
}

View file

@ -39,11 +39,11 @@ void openWallet()
QTimer::singleShot( 30000, qApp, SLOT( quit() ) );
int ret = qApp->exec();
if ( ret == 0 )
if ( ret == 0 ) {
_out << "Timed out!" << endl;
else
} else {
_out << "Success!" << endl;
}
QMap<QString,QString> p;
ret = wallet->readPasswordList("*", p);
@ -79,8 +79,7 @@ int main( int argc, char *argv[] )
= QDBusConnection::sessionBus().interface()->registerService( "org.kde.kwalletboth",
QDBusConnectionInterface::ReplaceExistingService );
if ( !reply.isValid() )
{
if ( !reply.isValid() ) {
_out << "D-BUS name request returned " << reply.error().name() << endl;
}

View file

@ -36,8 +36,7 @@ int main( int argc, char *argv[] )
= QDBusConnection::sessionBus().interface()->registerService( "org.kde.kwalletsync",
QDBusConnectionInterface::ReplaceExistingService );
if ( !reply.isValid() )
{
if ( !reply.isValid() ) {
_out << "D-BUS name request returned " << reply.error().name() << endl;
}

View file

@ -30,7 +30,6 @@ int main(int argc, char **argv)
int ret = app.exec();
return ret;
}