diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-07-31 19:46:32 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-07-31 19:46:32 +0400 |
commit | 78f27858ac26f2be5ec0412df5ee3f764f946f8a (patch) | |
tree | d1b7a3cb07f82cb8b51d74f1b3b5d80b5ae7018c /src/mumble | |
parent | 01cf72300fc6e87884cf71bc8062ec79a62e8a8f (diff) |
Indent, changelog and submodule update
Diffstat (limited to 'src/mumble')
-rw-r--r-- | src/mumble/ConfigDialogDelegate.h | 56 | ||||
-rw-r--r-- | src/mumble/CrashReporter.cpp | 6 | ||||
-rw-r--r-- | src/mumble/CrashReporter.h | 32 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_unix.cpp | 86 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_unix.h | 6 | ||||
-rw-r--r-- | src/mumble/MainWindow.cpp | 18 | ||||
-rw-r--r-- | src/mumble/Messages.cpp | 3 | ||||
-rw-r--r-- | src/mumble/os_macx.cpp | 12 | ||||
-rw-r--r-- | src/mumble/os_win.cpp | 2 |
9 files changed, 117 insertions, 104 deletions
diff --git a/src/mumble/ConfigDialogDelegate.h b/src/mumble/ConfigDialogDelegate.h index 32efb8cbc..86c465a78 100644 --- a/src/mumble/ConfigDialogDelegate.h +++ b/src/mumble/ConfigDialogDelegate.h @@ -38,30 +38,44 @@ @class NSToolbarItem; @interface ConfigDialogDelegate : NSObject { - ConfigDialog *configDialog; - QMap<unsigned int, ConfigWidget *> *widgetMap; + ConfigDialog *configDialog; + QMap<unsigned int, ConfigWidget *> *widgetMap; - BOOL inExpertMode; - NSMutableDictionary *nameWidgetMapping; - NSMutableArray *identifiers; - NSToolbar *toolbarCache; + BOOL inExpertMode; + NSMutableDictionary *nameWidgetMapping; + NSMutableArray *identifiers; + NSToolbar *toolbarCache; } -- (id) initWithConfigDialog: (ConfigDialog *)dialog andWidgetMap:(QMap<unsigned int, ConfigWidget *> *) map inExpertMode:(BOOL)flag; - -- (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar; -- (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar; -- (NSArray *) toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar; - -- (void) toolbarWillAddItem: (NSNotification*)notification; -- (void) toolbarDidRemoveItem: (NSNotification *)notification; - -- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *)identifier willBeInsertedIntoToolbar:(BOOL)flag; - -- (BOOL) validateToolbarItem: (NSToolbarItem *)toolbarItem; - -- (void) selectItem: (ConfigWidget *)cw; -- (void) itemSelected: (NSToolbarItem *)toolbarItem; +- (id) initWithConfigDialog: +(ConfigDialog *)dialog andWidgetMap: +(QMap<unsigned int, ConfigWidget *> *) map inExpertMode: +(BOOL)flag; + +- (NSArray *) toolbarAllowedItemIdentifiers: +(NSToolbar *)toolbar; +- (NSArray *) toolbarDefaultItemIdentifiers: +(NSToolbar *)toolbar; +- (NSArray *) toolbarSelectableItemIdentifiers: +(NSToolbar *)toolbar; + +- (void) toolbarWillAddItem: +(NSNotification*)notification; +- (void) toolbarDidRemoveItem: +(NSNotification *)notification; + +- (NSToolbarItem *) toolbar: +(NSToolbar *)toolbar itemForItemIdentifier: +(NSString *)identifier willBeInsertedIntoToolbar: +(BOOL)flag; + +- (BOOL) validateToolbarItem: +(NSToolbarItem *)toolbarItem; + +- (void) selectItem: +(ConfigWidget *)cw; +- (void) itemSelected: +(NSToolbarItem *)toolbarItem; @end diff --git a/src/mumble/CrashReporter.cpp b/src/mumble/CrashReporter.cpp index 915740fb7..c60332f65 100644 --- a/src/mumble/CrashReporter.cpp +++ b/src/mumble/CrashReporter.cpp @@ -40,7 +40,7 @@ CrashReporter::CrashReporter(QWidget *p) : QDialog(p) { QLabel *l; l = new QLabel(tr("<p><b>We're terribly sorry, but it seems Mumble has crashed. Do you want to send a crash report to the Mumble developers?</b></p>" - "<p>The crash report contains a partial copy of Mumble's memory at the time it crashed, and will help the developers fix the problem.</p>")); + "<p>The crash report contains a partial copy of Mumble's memory at the time it crashed, and will help the developers fix the problem.</p>")); vbl->addWidget(l); @@ -70,8 +70,8 @@ CrashReporter::CrashReporter(QWidget *p) : QDialog(p) { QDialogButtonBox *dbb = new QDialogButtonBox(Qt::Horizontal); dbb->addButton(pbOk, QDialogButtonBox::AcceptRole); dbb->addButton(pbCancel, QDialogButtonBox::RejectRole); - connect(dbb, SIGNAL(accepted()), this, SLOT(accept())); - connect(dbb, SIGNAL(rejected()), this, SLOT(reject())); + connect(dbb, SIGNAL(accepted()), this, SLOT(accept())); + connect(dbb, SIGNAL(rejected()), this, SLOT(reject())); vbl->addWidget(dbb); qelLoop = new QEventLoop(this); diff --git a/src/mumble/CrashReporter.h b/src/mumble/CrashReporter.h index 98d4b4923..1565a8d63 100644 --- a/src/mumble/CrashReporter.h +++ b/src/mumble/CrashReporter.h @@ -34,22 +34,22 @@ #include "mumble_pch.hpp" class CrashReporter : QDialog { - Q_OBJECT - Q_DISABLE_COPY(CrashReporter) - -public: - CrashReporter(QWidget *p = 0); - ~CrashReporter(); - void run(); -protected: - QEventLoop *qelLoop; - QProgressDialog *qpdProgress; - QNetworkReply *qnrReply; - QLineEdit *qleEmail; - QTextEdit *qteDescription; -public slots: - void uploadFinished(); - void uploadProgress(qint64, qint64); + Q_OBJECT + Q_DISABLE_COPY(CrashReporter) + + public: + CrashReporter(QWidget *p = 0); + ~CrashReporter(); + void run(); + protected: + QEventLoop *qelLoop; + QProgressDialog *qpdProgress; + QNetworkReply *qnrReply; + QLineEdit *qleEmail; + QTextEdit *qteDescription; + public slots: + void uploadFinished(); + void uploadProgress(qint64, qint64); }; #else diff --git a/src/mumble/GlobalShortcut_unix.cpp b/src/mumble/GlobalShortcut_unix.cpp index c4fa6711e..a4774fb9f 100644 --- a/src/mumble/GlobalShortcut_unix.cpp +++ b/src/mumble/GlobalShortcut_unix.cpp @@ -39,7 +39,7 @@ GlobalShortcutX::GlobalShortcutX() { bXInput = false; display = NULL; - + iKeyPress = iKeyRelease = iButtonPress = iButtonRelease = -1; #ifdef Q_OS_LINUX @@ -89,28 +89,28 @@ GlobalShortcutX::GlobalShortcutX() { GlobalShortcutX::~GlobalShortcutX() { bRunning = false; wait(); - foreach(XDevice *dev, qmXDevices) + foreach(XDevice *dev, qmXDevices) XCloseDevice(display, dev); if (display) XCloseDisplay(display); } void GlobalShortcutX::initXInput() { - foreach(XDevice *dev, qmXDevices) + foreach(XDevice *dev, qmXDevices) XCloseDevice(display, dev); - + qmXDevices.clear(); int numdev; XDeviceInfo *infolist = XListInputDevices(display, &numdev); if (! infolist) return; - for(int i=0;i<numdev;++i) { + for (int i=0;i<numdev;++i) { XDeviceInfo *info = infolist + i; XDevice *dev = XOpenDevice(display, info->id); if (dev) { bool key = false, button = false; - for(int j=0;j<dev->num_classes;++j) { + for (int j=0;j<dev->num_classes;++j) { XInputClassInfo *ici = dev->classes + j; key = key || (ici->input_class == KeyClass); button = button || (ici->input_class == ButtonClass); @@ -143,46 +143,46 @@ void GlobalShortcutX::initXInput() { } void GlobalShortcutX::run() { - Window root = XDefaultRootWindow(display); - Window root_ret, child_ret; - int root_x, root_y; - int win_x, win_y; - unsigned int mask[2]; - int idx = 0; - int next = 0; - char keys[2][32]; - - memset(keys[0], 0, 32); - memset(keys[1], 0, 32); - mask[0] = mask[1] = 0; - - while (bRunning) { - if (bNeedRemap) - remap(); - - msleep(10); - - idx = next; - next = idx ^ 1; - if (XQueryPointer(display, root, &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask[next]) && XQueryKeymap(display, keys[next])) { - for (int i=0;i<256;++i) { - int index = i / 8; - int keymask = 1 << (i % 8); - bool oldstate = (keys[idx][index] & keymask) != 0; - bool newstate = (keys[next][index] & keymask) != 0; - if (oldstate != newstate) { - handleButton(i, newstate); - } + Window root = XDefaultRootWindow(display); + Window root_ret, child_ret; + int root_x, root_y; + int win_x, win_y; + unsigned int mask[2]; + int idx = 0; + int next = 0; + char keys[2][32]; + + memset(keys[0], 0, 32); + memset(keys[1], 0, 32); + mask[0] = mask[1] = 0; + + while (bRunning) { + if (bNeedRemap) + remap(); + + msleep(10); + + idx = next; + next = idx ^ 1; + if (XQueryPointer(display, root, &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask[next]) && XQueryKeymap(display, keys[next])) { + for (int i=0;i<256;++i) { + int index = i / 8; + int keymask = 1 << (i % 8); + bool oldstate = (keys[idx][index] & keymask) != 0; + bool newstate = (keys[next][index] & keymask) != 0; + if (oldstate != newstate) { + handleButton(i, newstate); } - for (int i=8;i<=12;++i) { - bool oldstate = (mask[idx] & (1 << i)) != 0; - bool newstate = (mask[next] & (1 << i)) != 0; - if (oldstate != newstate) { - handleButton(0x110 + i, newstate); - } + } + for (int i=8;i<=12;++i) { + bool oldstate = (mask[idx] & (1 << i)) != 0; + bool newstate = (mask[next] & (1 << i)) != 0; + if (oldstate != newstate) { + handleButton(0x110 + i, newstate); } } } + } } void GlobalShortcutX::displayReadyRead(int) { @@ -190,7 +190,7 @@ void GlobalShortcutX::displayReadyRead(int) { if (bNeedRemap) remap(); - + while (XPending(display)) { XNextEvent(display, &evt); if ((evt.type == iButtonPress) || (evt.type == iButtonRelease)) { diff --git a/src/mumble/GlobalShortcut_unix.h b/src/mumble/GlobalShortcut_unix.h index 69b665bfa..a42a4c550 100644 --- a/src/mumble/GlobalShortcut_unix.h +++ b/src/mumble/GlobalShortcut_unix.h @@ -60,12 +60,12 @@ class GlobalShortcutX : public GlobalShortcutEngine { ~GlobalShortcutX(); void run(); QString buttonName(const QVariant &); - + int iKeyPress, iKeyRelease, iButtonPress, iButtonRelease; - + void initXInput(); public slots: - void displayReadyRead(int); + void displayReadyRead(int); void inputReadyRead(int); void directoryChanged(const QString &); }; diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index 56c598736..27747991b 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -695,16 +695,16 @@ void MainWindow::on_qaServerInformation_triggered() { unsigned int version = g.sh->uiVersion; QString qsVersion=tr("<h2>Version</h2><p>Protocol %1.%2.%3. Release %4.<br />Running on %5 %6.</p>").arg(QString::number((version >> 16) & 0xFF), - QString::number((version >> 8) & 0xFF), - QString::number(version & 0xFF), - g.sh->qsRelease, - g.sh->qsOS, - g.sh->qsOSVersion); + QString::number((version >> 8) & 0xFF), + QString::number(version & 0xFF), + g.sh->qsRelease, + g.sh->qsOS, + g.sh->qsOSVersion); QString qsControl=tr("<h2>Control channel</h2><p>Encrypted with %1 bit %2<br />%3 ms average latency (%4 deviation)</p>").arg(QString::number(qsc.usedBits()), - qsc.name(), - QString::fromLatin1("%1").arg(boost::accumulators::mean(g.sh->accTCP), 0, 'f', 2), - QString::fromLatin1("%1").arg(sqrt(boost::accumulators::variance(g.sh->accTCP)),0,'f',2)); + qsc.name(), + QString::fromLatin1("%1").arg(boost::accumulators::mean(g.sh->accTCP), 0, 'f', 2), + QString::fromLatin1("%1").arg(sqrt(boost::accumulators::variance(g.sh->accTCP)),0,'f',2)); QString qsVoice, qsCrypt, qsAudio; if (NetworkConfig::TcpModeEnabled()) { @@ -860,7 +860,7 @@ void MainWindow::on_qaUserMute_triggered() { if (p->bSuppress) mpus.set_suppress(false); } else { - mpus.set_mute(true); + mpus.set_mute(true); } g.sh->sendMessage(mpus); } diff --git a/src/mumble/Messages.cpp b/src/mumble/Messages.cpp index 6d33cfd07..721a74311 100644 --- a/src/mumble/Messages.cpp +++ b/src/mumble/Messages.cpp @@ -235,8 +235,7 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) { updateTrayIcon(); } else { if (msg.has_suppress() && ! pSrc) { - } - else if (msg.has_deaf() && pDst->bDeaf) + } else if (msg.has_deaf() && pDst->bDeaf) g.l->log(Log::YouMuted, tr("%1 deafened by %2.").arg(vic, admin)); else if (msg.has_mute() && pDst->bMute) g.l->log(Log::YouMuted, tr("%1 muted by %2.").arg(vic, admin)); diff --git a/src/mumble/os_macx.cpp b/src/mumble/os_macx.cpp index 2b508670d..c8c7bc9cf 100644 --- a/src/mumble/os_macx.cpp +++ b/src/mumble/os_macx.cpp @@ -149,12 +149,12 @@ void os_init() { */ extern "C" { -void mumble_macx_celt_fatal(const char *str, const char *file, int line) { - qFatal("Fatal (internal) libcelt error in %s, line %d: %s", file, line, str); -} + void mumble_macx_celt_fatal(const char *str, const char *file, int line) { + qFatal("Fatal (internal) libcelt error in %s, line %d: %s", file, line, str); + } -void mumble_macx_speex_fatal(const char *str, const char *file, int line) { - qFatal("Fatal (internal) libspeex error in %s, line %d: %s", file, line, str); -} + void mumble_macx_speex_fatal(const char *str, const char *file, int line) { + qFatal("Fatal (internal) libspeex error in %s, line %d: %s", file, line, str); + } } /* extern "C" */ diff --git a/src/mumble/os_win.cpp b/src/mumble/os_win.cpp index e3e880a47..58b88e563 100644 --- a/src/mumble/os_win.cpp +++ b/src/mumble/os_win.cpp @@ -36,7 +36,7 @@ #include "Version.h" extern "C" { -void __cpuid(int a[4], int b); + void __cpuid(int a[4], int b); }; #define PATH_MAX 1024 |