Move mac init code after logging init.

This commit is contained in:
John Maguire 2012-01-04 14:08:31 +00:00
parent 7a8103a352
commit 058e421827
1 changed files with 23 additions and 19 deletions

View File

@ -142,19 +142,8 @@ void LoadTranslation(const QString& prefix, const QString& path,
#include <xrme/connection.h>
#endif
int main(int argc, char *argv[]) {
if (CrashReporting::SendCrashReport(argc, argv)) {
return 0;
}
CrashReporting crash_reporting;
void IncreaseFDLimit() {
#ifdef Q_OS_DARWIN
// Do Mac specific startup to get media keys working.
// This must go before QApplication initialisation.
mac::MacMain();
{
// Bump the soft limit for the number of file descriptors from the default of 256 to
// the maximum (usually 10240).
struct rlimit limit;
@ -171,7 +160,20 @@ int main(int argc, char *argv[]) {
if (ret == 0) {
qLog(Debug) << "Max fd:" << max_fd;
}
#endif
}
int main(int argc, char *argv[]) {
if (CrashReporting::SendCrashReport(argc, argv)) {
return 0;
}
CrashReporting crash_reporting;
#ifdef Q_OS_DARWIN
// Do Mac specific startup to get media keys working.
// This must go before QApplication initialisation.
mac::MacMain();
#endif
QCoreApplication::setApplicationName("Clementine");
@ -289,6 +291,8 @@ int main(int argc, char *argv[]) {
logging::SetLevels(options.log_levels());
g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog), NULL);
IncreaseFDLimit();
QtSingleApplication a(argc, argv);
#ifdef Q_OS_DARWIN
QCoreApplication::setLibraryPaths(