bugfix for logfiledialog crash
This commit is contained in:
@@ -67,6 +67,7 @@ void LogFileDialog::refreshLogFileList()
|
|||||||
|
|
||||||
QFileInfo currentSqliteLogFile(QString::fromStdString(myGuiLog->getMySqliteLogFileName()));
|
QFileInfo currentSqliteLogFile(QString::fromStdString(myGuiLog->getMySqliteLogFileName()));
|
||||||
|
|
||||||
|
ui->treeWidget_logFiles->blockSignals(TRUE);
|
||||||
ui->treeWidget_logFiles->clear();
|
ui->treeWidget_logFiles->clear();
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i < dbFilesList.size(); i++) {
|
for (i=0; i < dbFilesList.size(); i++) {
|
||||||
@@ -86,6 +87,8 @@ void LogFileDialog::refreshLogFileList()
|
|||||||
ui->treeWidget_logFiles->addTopLevelItem(item);
|
ui->treeWidget_logFiles->addTopLevelItem(item);
|
||||||
}
|
}
|
||||||
ui->treeWidget_logFiles->sortItems(0, Qt::DescendingOrder);
|
ui->treeWidget_logFiles->sortItems(0, Qt::DescendingOrder);
|
||||||
|
ui->treeWidget_logFiles->blockSignals(FALSE);
|
||||||
|
ui->treeWidget_logFiles->setCurrentItem(ui->treeWidget_logFiles->topLevelItem(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogFileDialog::deleteLogFile()
|
void LogFileDialog::deleteLogFile()
|
||||||
|
|||||||
@@ -72,76 +72,76 @@ void SDLPlayer::initAudio()
|
|||||||
void SDLPlayer::playSound(string audioString, int playerID)
|
void SDLPlayer::playSound(string audioString, int playerID)
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
// if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||||
|
|
||||||
// QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav");
|
QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav");
|
||||||
|
|
||||||
// if(myFile.open(QIODevice::ReadOnly)) {
|
if(myFile.open(QIODevice::ReadOnly)) {
|
||||||
|
|
||||||
// //set 3d position for player
|
//set 3d position for player
|
||||||
// int position = 0;
|
int position = 0;
|
||||||
// int distance = 0;
|
int distance = 0;
|
||||||
|
|
||||||
// switch (playerID) {
|
switch (playerID) {
|
||||||
|
|
||||||
// case 0: {
|
case 0: {
|
||||||
// position = 180;
|
position = 180;
|
||||||
// distance = 10;
|
distance = 10;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 1: {
|
case 1: {
|
||||||
// position = 281;
|
position = 281;
|
||||||
// distance = 50;
|
distance = 50;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 2: {
|
case 2: {
|
||||||
// position = 315;
|
position = 315;
|
||||||
// distance = 120;
|
distance = 120;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 3: {
|
case 3: {
|
||||||
// position = 338;
|
position = 338;
|
||||||
// distance = 160;
|
distance = 160;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 4: {
|
case 4: {
|
||||||
// position = 23;
|
position = 23;
|
||||||
// distance = 160;
|
distance = 160;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 5: {
|
case 5: {
|
||||||
// position = 45;
|
position = 45;
|
||||||
// distance = 120;
|
distance = 120;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// case 6: {
|
case 6: {
|
||||||
// position = 79;
|
position = 79;
|
||||||
// distance = 50;
|
distance = 50;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// default: {
|
default: {
|
||||||
// position = 0;
|
position = 0;
|
||||||
// distance = 0;
|
distance = 0;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// QDataStream in(&myFile);
|
QDataStream in(&myFile);
|
||||||
// soundData = new Uint8[(int)myFile.size()];
|
soundData = new Uint8[(int)myFile.size()];
|
||||||
// in.readRawData( (char*)soundData, (int)myFile.size() );
|
in.readRawData( (char*)soundData, (int)myFile.size() );
|
||||||
// sound = Mix_QuickLoad_WAV(soundData);
|
sound = Mix_QuickLoad_WAV(soundData);
|
||||||
|
|
||||||
// // set channel 0 to settings volume
|
// set channel 0 to settings volume
|
||||||
// Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10);
|
Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10);
|
||||||
|
|
||||||
// // set 3d effect
|
// set 3d effect
|
||||||
// if(!Mix_SetPosition(0, position, distance)) {
|
if(!Mix_SetPosition(0, position, distance)) {
|
||||||
// printf("Mix_SetPosition: %s\n", Mix_GetError());
|
printf("Mix_SetPosition: %s\n", Mix_GetError());
|
||||||
// // no position effect, is it ok?
|
// no position effect, is it ok?
|
||||||
// }
|
}
|
||||||
// currentChannel = Mix_PlayChannel(-1, sound,0);
|
currentChannel = Mix_PlayChannel(-1, sound,0);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user