1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Style corrections

'if()' → 'if ()'
'for()' → 'for ()'
This commit is contained in:
Zetok Zalbavar 2014-12-11 18:05:52 +00:00
parent 5cb1b6fe8e
commit e0993a72f6
No known key found for this signature in database
GPG Key ID: 53137C3033F09008
14 changed files with 56 additions and 56 deletions

View File

@ -184,14 +184,14 @@ void Audio::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, u
alGetSourcei(alSource, AL_BUFFERS_QUEUED, &queued); alGetSourcei(alSource, AL_BUFFERS_QUEUED, &queued);
alSourcei(alSource, AL_LOOPING, AL_FALSE); alSourcei(alSource, AL_LOOPING, AL_FALSE);
if(processed) if (processed)
{ {
ALuint bufids[processed]; ALuint bufids[processed];
alSourceUnqueueBuffers(alSource, processed, bufids); alSourceUnqueueBuffers(alSource, processed, bufids);
alDeleteBuffers(processed - 1, bufids + 1); alDeleteBuffers(processed - 1, bufids + 1);
bufid = bufids[0]; bufid = bufids[0];
} }
else if(queued < 16) else if (queued < 16)
{ {
alGenBuffers(1, &bufid); alGenBuffers(1, &bufid);
} }
@ -207,6 +207,6 @@ void Audio::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, u
ALint state; ALint state;
alGetSourcei(alSource, AL_SOURCE_STATE, &state); alGetSourcei(alSource, AL_SOURCE_STATE, &state);
if(state != AL_PLAYING) if (state != AL_PLAYING)
alSourcePlay(alSource); alSourcePlay(alSource);
} }

View File

@ -728,7 +728,7 @@ void Core::requestFriendship(const QString& friendAddress, const QString& messag
{ {
const QString userId = friendAddress.mid(0, TOX_CLIENT_ID_SIZE * 2); const QString userId = friendAddress.mid(0, TOX_CLIENT_ID_SIZE * 2);
if(hasFriendWithAddress(friendAddress)) if (hasFriendWithAddress(friendAddress))
{ {
emit failedToAddFriend(userId, QString(tr("Friend is already added"))); emit failedToAddFriend(userId, QString(tr("Friend is already added")));
} }
@ -1677,7 +1677,7 @@ void Core::createGroup(uint8_t type)
bool Core::hasFriendWithAddress(const QString &addr) const bool Core::hasFriendWithAddress(const QString &addr) const
{ {
// Valid length check // Valid length check
if(addr.length() != (TOX_FRIEND_ADDRESS_SIZE * 2)) if (addr.length() != (TOX_FRIEND_ADDRESS_SIZE * 2))
{ {
return false; return false;
} }
@ -1689,7 +1689,7 @@ bool Core::hasFriendWithAddress(const QString &addr) const
bool Core::hasFriendWithPublicKey(const QString &pubkey) const bool Core::hasFriendWithPublicKey(const QString &pubkey) const
{ {
// Valid length check // Valid length check
if(pubkey.length() != (TOX_CLIENT_ID_SIZE * 2)) if (pubkey.length() != (TOX_CLIENT_ID_SIZE * 2))
{ {
return false; return false;
} }
@ -1706,7 +1706,7 @@ bool Core::hasFriendWithPublicKey(const QString &pubkey) const
QString addrOrId = getFriendAddress(ids[i]); QString addrOrId = getFriendAddress(ids[i]);
// Set true if found // Set true if found
if(addrOrId.toUpper().startsWith(pubkey.toUpper())) if (addrOrId.toUpper().startsWith(pubkey.toUpper()))
{ {
found = true; found = true;
break; break;

View File

@ -207,7 +207,7 @@ void Core::playCallAudio(void* toxav, int32_t callId, const int16_t *data, uint1
alGenSources(1, &calls[callId].alSource); alGenSources(1, &calls[callId].alSource);
ToxAvCSettings dest; ToxAvCSettings dest;
if(toxav_get_peer_csettings((ToxAv*)toxav, callId, 0, &dest) == 0) if (toxav_get_peer_csettings((ToxAv*)toxav, callId, 0, &dest) == 0)
playAudioBuffer(calls[callId].alSource, data, samples, dest.audio_channels, dest.audio_sample_rate); playAudioBuffer(calls[callId].alSource, data, samples, dest.audio_channels, dest.audio_sample_rate);
} }
@ -229,24 +229,24 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
bool frame = false; bool frame = false;
ALint samples; ALint samples;
alcGetIntegerv(Audio::alInDev, ALC_CAPTURE_SAMPLES, sizeof(samples), &samples); alcGetIntegerv(Audio::alInDev, ALC_CAPTURE_SAMPLES, sizeof(samples), &samples);
if(samples >= framesize) if (samples >= framesize)
{ {
memset(buf, 0, bufsize); // Avoid uninitialized values (Valgrind) memset(buf, 0, bufsize); // Avoid uninitialized values (Valgrind)
alcCaptureSamples(Audio::alInDev, buf, framesize); alcCaptureSamples(Audio::alInDev, buf, framesize);
frame = 1; frame = 1;
} }
if(frame) if (frame)
{ {
int r; int r;
if((r = toxav_prepare_audio_frame(toxav, callId, dest, framesize*2, (int16_t*)buf, framesize)) < 0) if ((r = toxav_prepare_audio_frame(toxav, callId, dest, framesize*2, (int16_t*)buf, framesize)) < 0)
{ {
qDebug() << "Core: toxav_prepare_audio_frame error"; qDebug() << "Core: toxav_prepare_audio_frame error";
calls[callId].sendAudioTimer->start(); calls[callId].sendAudioTimer->start();
return; return;
} }
if((r = toxav_send_audio(toxav, callId, dest, r)) < 0) if ((r = toxav_send_audio(toxav, callId, dest, r)) < 0)
qDebug() << "Core: toxav_send_audio error"; qDebug() << "Core: toxav_send_audio error";
} }
calls[callId].sendAudioTimer->start(); calls[callId].sendAudioTimer->start();
@ -271,7 +271,7 @@ void Core::sendCallVideo(int callId)
if (frame.w && frame.h) if (frame.w && frame.h)
{ {
int result; int result;
if((result = toxav_prepare_video_frame(toxav, callId, videobuf, videobufsize, &frame)) < 0) if ((result = toxav_prepare_video_frame(toxav, callId, videobuf, videobufsize, &frame)) < 0)
{ {
qDebug() << QString("Core: toxav_prepare_video_frame: error %1").arg(result); qDebug() << QString("Core: toxav_prepare_video_frame: error %1").arg(result);
vpx_img_free(&frame); vpx_img_free(&frame);
@ -279,7 +279,7 @@ void Core::sendCallVideo(int callId)
return; return;
} }
if((result = toxav_send_video(toxav, callId, (uint8_t*)videobuf, result)) < 0) if ((result = toxav_send_video(toxav, callId, (uint8_t*)videobuf, result)) < 0)
qDebug() << QString("Core: toxav_send_video error: %1").arg(result); qDebug() << QString("Core: toxav_send_video error: %1").arg(result);
vpx_img_free(&frame); vpx_img_free(&frame);
@ -540,7 +540,7 @@ void Core::onAvStart(void* _toxav, int32_t call_index, void* core)
// This function's logic was shamelessly stolen from uTox // This function's logic was shamelessly stolen from uTox
void Core::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, unsigned channels, int sampleRate) void Core::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, unsigned channels, int sampleRate)
{ {
if(!channels || channels > 2) if (!channels || channels > 2)
{ {
qWarning() << "Core::playAudioBuffer: trying to play on "<<channels<<" channels! Giving up."; qWarning() << "Core::playAudioBuffer: trying to play on "<<channels<<" channels! Giving up.";
return; return;
@ -552,14 +552,14 @@ void Core::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, un
alGetSourcei(alSource, AL_BUFFERS_QUEUED, &queued); alGetSourcei(alSource, AL_BUFFERS_QUEUED, &queued);
alSourcei(alSource, AL_LOOPING, AL_FALSE); alSourcei(alSource, AL_LOOPING, AL_FALSE);
if(processed) if (processed)
{ {
ALuint bufids[processed]; ALuint bufids[processed];
alSourceUnqueueBuffers(alSource, processed, bufids); alSourceUnqueueBuffers(alSource, processed, bufids);
alDeleteBuffers(processed - 1, bufids + 1); alDeleteBuffers(processed - 1, bufids + 1);
bufid = bufids[0]; bufid = bufids[0];
} }
else if(queued < 32) else if (queued < 32)
{ {
alGenBuffers(1, &bufid); alGenBuffers(1, &bufid);
} }
@ -575,7 +575,7 @@ void Core::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, un
ALint state; ALint state;
alGetSourcei(alSource, AL_SOURCE_STATE, &state); alGetSourcei(alSource, AL_SOURCE_STATE, &state);
if(state != AL_PLAYING) if (state != AL_PLAYING)
{ {
alSourcePlay(alSource); alSourcePlay(alSource);
//qDebug() << "Core: Starting audio source " << (int)alSource; //qDebug() << "Core: Starting audio source " << (int)alSource;
@ -643,17 +643,17 @@ void Core::sendGroupCallAudio(int groupId, ToxAv* toxav)
bool frame = false; bool frame = false;
ALint samples; ALint samples;
alcGetIntegerv(Audio::alInDev, ALC_CAPTURE_SAMPLES, sizeof(samples), &samples); alcGetIntegerv(Audio::alInDev, ALC_CAPTURE_SAMPLES, sizeof(samples), &samples);
if(samples >= framesize) if (samples >= framesize)
{ {
memset(buf, 0, bufsize); // Avoid uninitialized values (Valgrind) memset(buf, 0, bufsize); // Avoid uninitialized values (Valgrind)
alcCaptureSamples(Audio::alInDev, buf, framesize); alcCaptureSamples(Audio::alInDev, buf, framesize);
frame = 1; frame = 1;
} }
if(frame) if (frame)
{ {
int r; int r;
if((r = toxav_group_send_audio(toxav_get_tox(toxav), groupId, (int16_t*)buf, if ((r = toxav_group_send_audio(toxav_get_tox(toxav), groupId, (int16_t*)buf,
framesize, av_DefaultSettings.audio_channels, av_DefaultSettings.audio_sample_rate)) < 0) framesize, av_DefaultSettings.audio_channels, av_DefaultSettings.audio_sample_rate)) < 0)
{ {
qDebug() << "Core: toxav_group_send_audio error"; qDebug() << "Core: toxav_group_send_audio error";

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
parser.process(a); parser.process(a);
Settings::getInstance(); // Build our Settings singleton as soon as QApplication is ready, not before Settings::getInstance(); // Build our Settings singleton as soon as QApplication is ready, not before
if(parser.isSet("P")) if (parser.isSet("P"))
Settings::getInstance().setCurrentProfile(parser.value("P")); Settings::getInstance().setCurrentProfile(parser.value("P"));
sodium_init(); // For the auto-updater sodium_init(); // For the auto-updater
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
else if(!ipc.isCurrentOwner() && !parser.isSet("P")) else if (!ipc.isCurrentOwner() && !parser.isSet("P"))
{ {
time_t event = ipc.postEvent("$activate"); time_t event = ipc.postEvent("$activate");
ipc.waitUntilProcessed(event); ipc.waitUntilProcessed(event);

View File

@ -69,9 +69,9 @@ QList<QPair<QString, QString> > SmileyPack::listSmileyPacks(const QStringList &p
if (relPath.leftRef(2) == "..") if (relPath.leftRef(2) == "..")
{ {
if(!smileyPacks.contains(QPair<QString, QString>(packageName, absPath))) if (!smileyPacks.contains(QPair<QString, QString>(packageName, absPath)))
smileyPacks << QPair<QString, QString>(packageName, absPath); smileyPacks << QPair<QString, QString>(packageName, absPath);
else if(!smileyPacks.contains(QPair<QString, QString>(packageName, relPath))) else if (!smileyPacks.contains(QPair<QString, QString>(packageName, relPath)))
smileyPacks << QPair<QString, QString>(packageName, relPath); // use relative path for subdirectories smileyPacks << QPair<QString, QString>(packageName, relPath); // use relative path for subdirectories
} }
} }
@ -97,7 +97,7 @@ bool SmileyPack::load(const QString& filename)
// open emoticons.xml // open emoticons.xml
QFile xmlFile(filename); QFile xmlFile(filename);
if(!xmlFile.open(QIODevice::ReadOnly)) if (!xmlFile.open(QIODevice::ReadOnly))
return false; // cannot open file return false; // cannot open file
/* parse the cfg file /* parse the cfg file
@ -138,14 +138,14 @@ bool SmileyPack::load(const QString& filename)
QPixmap pm; QPixmap pm;
pm.loadFromData(getCachedSmiley(emoticon), "PNG"); pm.loadFromData(getCachedSmiley(emoticon), "PNG");
if(pm.size().width() > 0) if (pm.size().width() > 0)
emoticonSet.push_back(emoticon); emoticonSet.push_back(emoticon);
stringElement = stringElement.nextSibling().toElement(); stringElement = stringElement.nextSibling().toElement();
} }
if(emoticonSet.size() > 0) if (emoticonSet.size() > 0)
emoticons.push_back(emoticonSet); emoticons.push_back(emoticonSet);
} }

View File

@ -24,7 +24,7 @@ uint32_t Platform::getIdleTime()
{ {
LASTINPUTINFO info = { 0 }; LASTINPUTINFO info = { 0 };
info.cbSize = sizeof(info); info.cbSize = sizeof(info);
if(GetLastInputInfo(&info)) if (GetLastInputInfo(&info))
return GetTickCount() - info.dwTime; return GetTickCount() - info.dwTime;
return 0; return 0;
} }

View File

@ -25,7 +25,7 @@ uint32_t Platform::getIdleTime()
uint32_t idleTime = 0; uint32_t idleTime = 0;
Display *display = XOpenDisplay(NULL); Display *display = XOpenDisplay(NULL);
if(!display) if (!display)
{ {
qDebug() << "XOpenDisplay(NULL) failed"; qDebug() << "XOpenDisplay(NULL) failed";
return 0; return 0;
@ -33,10 +33,10 @@ uint32_t Platform::getIdleTime()
int32_t x11event = 0, x11error = 0; int32_t x11event = 0, x11error = 0;
static int32_t hasExtension = XScreenSaverQueryExtension(display, &x11event, &x11error); static int32_t hasExtension = XScreenSaverQueryExtension(display, &x11event, &x11error);
if(hasExtension) if (hasExtension)
{ {
XScreenSaverInfo *info = XScreenSaverAllocInfo(); XScreenSaverInfo *info = XScreenSaverAllocInfo();
if(info) if (info)
{ {
XScreenSaverQueryInfo(display, DefaultRootWindow(display), info); XScreenSaverQueryInfo(display, DefaultRootWindow(display), info);
idleTime = info->idle; idleTime = info->idle;

View File

@ -129,7 +129,7 @@ void CameraWorker::applyProps()
if (!cam.isOpened()) if (!cam.isOpened())
return; return;
for(int prop : props.keys()) for (int prop : props.keys())
cam.set(prop, props.value(prop)); cam.set(prop, props.value(prop));
} }
@ -148,7 +148,7 @@ void CameraWorker::subscribe()
void CameraWorker::unsubscribe() void CameraWorker::unsubscribe()
{ {
if(--refCount <= 0) if (--refCount <= 0)
{ {
cam.release(); cam.release();
refCount = 0; refCount = 0;

View File

@ -793,7 +793,7 @@ void ChatForm::onLoadHistory()
void ChatForm::startCounter() void ChatForm::startCounter()
{ {
if(!timer) if (!timer)
{ {
timer = new QTimer(); timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(updateTime())); connect(timer, SIGNAL(timeout()), this, SLOT(updateTime()));
@ -805,7 +805,7 @@ void ChatForm::startCounter()
void ChatForm::stopCounter() void ChatForm::stopCounter()
{ {
if(timer) if (timer)
{ {
addSystemInfoMessage(tr("Call with %1 ended. %2").arg(f->getDisplayedName(), addSystemInfoMessage(tr("Call with %1 ended. %2").arg(f->getDisplayedName(),
secondsToDHMS(timeElapsed.elapsed()/1000)), secondsToDHMS(timeElapsed.elapsed()/1000)),
@ -834,10 +834,10 @@ QString ChatForm::secondsToDHMS(quint32 duration)
int hours = (int) (duration % 24); int hours = (int) (duration % 24);
int days = (int) (duration / 24); int days = (int) (duration / 24);
if(minutes == 0) if (minutes == 0)
return cD + res.sprintf("%02ds", seconds); return cD + res.sprintf("%02ds", seconds);
if(hours == 0 && days == 0) if (hours == 0 && days == 0)
return cD + res.sprintf("%02dm %02ds", minutes, seconds); return cD + res.sprintf("%02dm %02ds", minutes, seconds);
if (days == 0) if (days == 0)

View File

@ -79,7 +79,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
bodyUI->styleBrowser->addItem(tr("None")); bodyUI->styleBrowser->addItem(tr("None"));
bodyUI->styleBrowser->addItems(QStyleFactory::keys()); bodyUI->styleBrowser->addItems(QStyleFactory::keys());
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle())) if (QStyleFactory::keys().contains(Settings::getInstance().getStyle()))
bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle()); bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle());
else else
bodyUI->styleBrowser->setCurrentText(tr("None")); bodyUI->styleBrowser->setCurrentText(tr("None"));
@ -124,7 +124,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged())); connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
connect(bodyUI->showInFront, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowInFront); connect(bodyUI->showInFront, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowInFront);
connect(bodyUI->autoacceptFiles, &QCheckBox::stateChanged, this, &GeneralForm::onAutoAcceptFileChange); connect(bodyUI->autoacceptFiles, &QCheckBox::stateChanged, this, &GeneralForm::onAutoAcceptFileChange);
if(bodyUI->autoacceptFiles->isChecked()) if (bodyUI->autoacceptFiles->isChecked())
connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange())); connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange()));
//theme //theme
connect(bodyUI->useEmoticons, &QCheckBox::stateChanged, this, &GeneralForm::onUseEmoticonsChange); connect(bodyUI->useEmoticons, &QCheckBox::stateChanged, this, &GeneralForm::onUseEmoticonsChange);
@ -192,7 +192,7 @@ void GeneralForm::onSetMinimizeToTray()
void GeneralForm::onStyleSelected(QString style) void GeneralForm::onStyleSelected(QString style)
{ {
if(bodyUI->styleBrowser->currentIndex() == 0) if (bodyUI->styleBrowser->currentIndex() == 0)
Settings::getInstance().setStyle("None"); Settings::getInstance().setStyle("None");
else else
Settings::getInstance().setStyle(style); Settings::getInstance().setStyle(style);
@ -221,7 +221,7 @@ void GeneralForm::onAutoAcceptFileChange()
{ {
Settings::getInstance().setAutoSaveEnabled(bodyUI->autoacceptFiles->isChecked()); Settings::getInstance().setAutoSaveEnabled(bodyUI->autoacceptFiles->isChecked());
if(bodyUI->autoacceptFiles->isChecked() == true) if (bodyUI->autoacceptFiles->isChecked() == true)
connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange())); connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange()));
else else
disconnect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()),this, SLOT(onAutoSaveDirChange())); disconnect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()),this, SLOT(onAutoSaveDirChange()));
@ -231,7 +231,7 @@ void GeneralForm::onAutoSaveDirChange()
{ {
QString previousDir = Settings::getInstance().getGlobalAutoAcceptDir(); QString previousDir = Settings::getInstance().getGlobalAutoAcceptDir();
QString directory = QFileDialog::getExistingDirectory(0, tr("Choose an auto accept directory","popup title")); QString directory = QFileDialog::getExistingDirectory(0, tr("Choose an auto accept directory","popup title"));
if(directory.isEmpty()) if (directory.isEmpty())
directory = previousDir; directory = previousDir;
Settings::getInstance().setGlobalAutoAcceptDir(directory); Settings::getInstance().setGlobalAutoAcceptDir(directory);
@ -299,7 +299,7 @@ void GeneralForm::reloadSmiles()
QStringList smiles; QStringList smiles;
smiles << ":)" << ";)" << ":p" << ":O" << ":["; //just in case... smiles << ":)" << ";)" << ":p" << ":O" << ":["; //just in case...
for(int i = 0; i < emoticons.size(); i++) for (int i = 0; i < emoticons.size(); i++)
smiles.push_front(emoticons.at(i).first()); smiles.push_front(emoticons.at(i).first());
int pixSize = 30; int pixSize = 30;

View File

@ -52,7 +52,7 @@ void TabCompleter::buildCompletionList()
// that section is then used as the completion regex // that section is then used as the completion regex
QRegExp regex(QString("^[-_\\[\\]{}|`^.\\\\]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive); QRegExp regex(QString("^[-_\\[\\]{}|`^.\\\\]*").append(QRegExp::escape(tabAbbrev)), Qt::CaseInsensitive);
for(auto name : group->getPeerList()) for (auto name : group->getPeerList())
if (regex.indexIn(name) > -1) if (regex.indexIn(name) > -1)
completionMap[name.toLower()] = name; completionMap[name.toLower()] = name;

View File

@ -130,6 +130,6 @@ void MaskablePixmapWidget::paintEvent(QPaintEvent *)
void MaskablePixmapWidget::mousePressEvent(QMouseEvent*) void MaskablePixmapWidget::mousePressEvent(QMouseEvent*)
{ {
if(clickable) if (clickable)
emit clicked(); emit clicked();
} }

View File

@ -29,7 +29,7 @@ MessageAction::MessageAction(const QString &author, const QString &message, cons
QString MessageAction::getMessage(QString div) QString MessageAction::getMessage(QString div)
{ {
QString message_; QString message_;
if(Settings::getInstance().getUseEmoticons()) if (Settings::getInstance().getUseEmoticons())
message_ = SmileyPack::getInstance().smileyfied(toHtmlChars(message)); message_ = SmileyPack::getInstance().smileyfied(toHtmlChars(message));
else else
message_ = toHtmlChars(message); message_ = toHtmlChars(message);

View File

@ -54,7 +54,7 @@
void toxActivateEventHandler(const QByteArray& data) void toxActivateEventHandler(const QByteArray& data)
{ {
if(data != "$activate") if (data != "$activate")
return; return;
Widget::getInstance()->show(); Widget::getInstance()->show();
Widget::getInstance()->activateWindow(); Widget::getInstance()->activateWindow();
@ -116,7 +116,7 @@ void Widget::init()
if (Settings::getInstance().getShowSystemTray()){ if (Settings::getInstance().getShowSystemTray()){
icon->show(); icon->show();
if(Settings::getInstance().getAutostartInTray() == false) if (Settings::getInstance().getAutostartInTray() == false)
this->show(); this->show();
} }
else else
@ -149,7 +149,7 @@ void Widget::init()
ui->tooliconsZone->setStyleSheet(Style::resolve("QPushButton{background-color:@themeDark;border:none;}QPushButton:hover{background-color:@themeMediumDark;border:none;}")); ui->tooliconsZone->setStyleSheet(Style::resolve("QPushButton{background-color:@themeDark;border:none;}QPushButton:hover{background-color:@themeMediumDark;border:none;}"));
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle()) if (QStyleFactory::keys().contains(Settings::getInstance().getStyle())
&& Settings::getInstance().getStyle() != "None") && Settings::getInstance().getStyle() != "None")
{ {
ui->mainHead->setStyle(QStyleFactory::create(Settings::getInstance().getStyle())); ui->mainHead->setStyle(QStyleFactory::create(Settings::getInstance().getStyle()));
@ -348,7 +348,7 @@ QThread* Widget::getCoreThread()
void Widget::closeEvent(QCloseEvent *event) void Widget::closeEvent(QCloseEvent *event)
{ {
if(Settings::getInstance().getShowSystemTray() && Settings::getInstance().getCloseToTray() == true) if (Settings::getInstance().getShowSystemTray() && Settings::getInstance().getCloseToTray() == true)
{ {
event->ignore(); event->ignore();
this->hide(); this->hide();
@ -365,7 +365,7 @@ void Widget::changeEvent(QEvent *event)
{ {
if (event->type() == QEvent::WindowStateChange) if (event->type() == QEvent::WindowStateChange)
{ {
if(isMinimized() && Settings::getInstance().getMinimizeToTray()) if (isMinimized() && Settings::getInstance().getMinimizeToTray())
{ {
this->hide(); this->hide();
} }
@ -415,7 +415,7 @@ QList<QString> Widget::searchProfiles()
QDir dir(Settings::getSettingsDirPath()); QDir dir(Settings::getSettingsDirPath());
dir.setFilter(QDir::Files | QDir::NoDotAndDotDot); dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
dir.setNameFilters(QStringList("*.tox")); dir.setNameFilters(QStringList("*.tox"));
for(QFileInfo file : dir.entryInfoList()) for (QFileInfo file : dir.entryInfoList())
out += file.completeBaseName(); out += file.completeBaseName();
return out; return out;
} }
@ -591,7 +591,7 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
{ {
switch (reason) { switch (reason) {
case QSystemTrayIcon::Trigger: case QSystemTrayIcon::Trigger:
if(this->isHidden() == true) if (this->isHidden() == true)
{ {
this->show(); this->show();
this->activateWindow(); this->activateWindow();
@ -712,7 +712,7 @@ void Widget::addFriend(int friendId, const QString &userId)
void Widget::addFriendFailed(const QString&, const QString& errorInfo) void Widget::addFriendFailed(const QString&, const QString& errorInfo)
{ {
QString info = QString(tr("Couldn't request friendship")); QString info = QString(tr("Couldn't request friendship"));
if(!errorInfo.isEmpty()) { if (!errorInfo.isEmpty()) {
info = info + (QString(": ") + errorInfo); info = info + (QString(": ") + errorInfo);
} }
@ -733,7 +733,7 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
f->getFriendWidget()->updateStatusLight(); f->getFriendWidget()->updateStatusLight();
//won't print the message if there were no messages before //won't print the message if there were no messages before
if(!f->getChatForm()->isEmpty() if (!f->getChatForm()->isEmpty()
&& Settings::getInstance().getStatusChangeNotificationEnabled()) && Settings::getInstance().getStatusChangeNotificationEnabled())
{ {
QString fStatus = ""; QString fStatus = "";