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

style(platform): Style fixes

This commit is contained in:
Diadlo 2016-07-07 13:10:41 +03:00
parent 20d3225f29
commit 9471065feb
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
3 changed files with 24 additions and 30 deletions

View File

@ -36,16 +36,8 @@ bool Platform::setAutorun(bool on)
autoRun.setValue("Label","chat.tox.qtox.autorun");
autoRun.setValue("Program", qtoxDir);
if (on)
{
autoRun.setValue("RunAtLoad",true);
state = true;
}
else
{
autoRun.setValue("RunAtLoad",false);
state = false;
}
state = on;
autoRun.setValue("RunAtLoad", state);
}
bool Platform::getAutorun()

View File

@ -128,13 +128,15 @@ QVector<VideoMode> v4l2::getDeviceModes(QString devName)
v4l2_fmtdesc vfd{};
vfd.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) {
while (!ioctl(fd, VIDIOC_ENUM_FMT, &vfd))
{
vfd.index++;
v4l2_frmsizeenum vfse{};
vfse.pixel_format = vfd.pixelformat;
while(!ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) {
while (!ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &vfse))
{
VideoMode mode;
mode.pixel_format = vfse.pixel_format;
switch (vfse.type) {
@ -150,6 +152,7 @@ QVector<VideoMode> v4l2::getDeviceModes(QString devName)
default:
continue;
}
QVector<unsigned short> rates = getDeviceModeFramerates(fd, mode.width, mode.height, vfd.pixelformat);
for (unsigned short rate : rates)
{

View File

@ -95,8 +95,12 @@ void osx::migrateProfiles()
+ "Library" + QDir::separator() + "Application Support" + QDir::separator() + "Tox");
QDir dir;
if (checkDir.exists() && checkDir.isDir())
if (!checkDir.exists() || !checkDir.isDir())
{
qDebug() << "OS X: Old settings directory not detected";
return;
}
qDebug() << "OS X: Old settings directory detected migrating to default";
if (!dir.rename(oldPath, newPath))
{
@ -111,9 +115,4 @@ void osx::migrateProfiles()
MigrateProfile.exec();
}
}
else
{
qDebug() << "OS X: Old settings directory not detected";
}
}
// End migrateProfiles() compatibility code