Ticket #7052: Deskbar_BarApp_cpp_style_fix.diff

File Deskbar_BarApp_cpp_style_fix.diff, 7.2 KB (added by jscipione, 13 years ago)
  • src/apps/deskbar/BarApp.cpp

    diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
    index 2647068..ffc1398 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    29 Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
    30 of Be Incorporated in the United States and other countries. Other brand product
    31 names are registered trademarks or trademarks of their respective holders.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    All rights reserved.  
    6061#include "PublicCommands.h"
    6162#include "ResourceSet.h"
    6263#include "Switcher.h"
    63 #include "TeamMenu.h"
    64 #include "WindowMenuItem.h"
    6564
    6665
    6766BLocker TBarApp::sSubscriberLock;
    BList TBarApp::sSubscribers;  
    7271const uint32 kShowBeMenu = 'BeMn';
    7372const uint32 kShowTeamMenu = 'TmMn';
    7473
    75 const BRect kIconSize(0.0f, 0.0f, 15.0f, 15.0f);
    7674
     75const BRect kIconRect(0.0f, 0.0f, 15.0f, 15.0f);
    7776static const color_space kIconFormat = B_RGBA32;
    7877
    7978
    TBarApp::SaveSettings()  
    190189        storedSettings.AddFloat("width", fSettings.width);
    191190        storedSettings.AddBool("showTime", fSettings.showTime);
    192191        storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
    193         storedSettings.AddInt32("recentAppsCount",
    194             fSettings.recentAppsCount);
    195         storedSettings.AddInt32("recentDocsCount",
    196             fSettings.recentDocsCount);
    197         storedSettings.AddBool("timeShowSeconds",
    198             fSettings.timeShowSeconds);
     192        storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount);
     193        storedSettings.AddInt32("recentDocsCount", fSettings.recentDocsCount);
     194        storedSettings.AddBool("timeShowSeconds", fSettings.timeShowSeconds);
    199195        storedSettings.AddInt32("recentFoldersCount",
    200196            fSettings.recentFoldersCount);
    201197        storedSettings.AddBool("alwaysOnTop", fSettings.alwaysOnTop);
    202198        storedSettings.AddBool("timeFullDate", fSettings.timeFullDate);
    203199        storedSettings.AddBool("trackerAlwaysFirst",
    204200            fSettings.trackerAlwaysFirst);
    205         storedSettings.AddBool("sortRunningApps",
    206             fSettings.sortRunningApps);
    207         storedSettings.AddBool("superExpando",
    208             fSettings.superExpando);
    209         storedSettings.AddBool("expandNewTeams",
    210             fSettings.expandNewTeams);
    211         storedSettings.AddBool("autoRaise",
    212             fSettings.autoRaise);
     201        storedSettings.AddBool("sortRunningApps", fSettings.sortRunningApps);
     202        storedSettings.AddBool("superExpando", fSettings.superExpando);
     203        storedSettings.AddBool("expandNewTeams", fSettings.expandNewTeams);
     204        storedSettings.AddBool("autoRaise", fSettings.autoRaise);
    213205        storedSettings.AddBool("recentAppsEnabled",
    214206            fSettings.recentAppsEnabled);
    215207        storedSettings.AddBool("recentDocsEnabled",
    TBarApp::InitSettings()  
    291283                &settings.trackerAlwaysFirst);
    292284            storedSettings.FindBool("sortRunningApps",
    293285                &settings.sortRunningApps);
    294             storedSettings.FindBool("superExpando",
    295                 &settings.superExpando);
    296             storedSettings.FindBool("expandNewTeams",
    297                 &settings.expandNewTeams);
    298             storedSettings.FindBool("autoRaise",
    299                 &settings.autoRaise);
     286            storedSettings.FindBool("superExpando", &settings.superExpando);
     287            storedSettings.FindBool("expandNewTeams", &settings.expandNewTeams);
     288            storedSettings.FindBool("autoRaise", &settings.autoRaise);
    300289            storedSettings.FindBool("recentAppsEnabled",
    301290                &settings.recentAppsEnabled);
    302291            storedSettings.FindBool("recentDocsEnabled",
    TBarApp::InitSettings()  
    313302void
    314303TBarApp::MessageReceived(BMessage* message)
    315304{
    316     int32 count;
    317     bool enabled;
    318305    switch (message->what) {
    319306        case 'gloc':
    320307        case 'sloc':
    TBarApp::MessageReceived(BMessage* message)  
    353340            break;
    354341
    355342        case kUpdateRecentCounts:
     343            int32 count;
     344            bool enabled;
     345
    356346            if (message->FindInt32("applications", &count) == B_OK)
    357347                fSettings.recentAppsCount = count;
    358348            if (message->FindBool("applicationsEnabled", &enabled) == B_OK)
    TBarApp::MessageReceived(BMessage* message)  
    413403            break;
    414404
    415405        case kAlwaysTop:
    416             fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
     406            fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
    417407
    418             fBarWindow->SetFeel(fSettings.alwaysOnTop ?
    419                 B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
    420             break;
     408            fBarWindow->SetFeel(fSettings.alwaysOnTop ?
     409                B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
     410            break;
    421411
    422412        case kAutoRaise:
    423         {
    424413            fSettings.autoRaise = !fSettings.autoRaise;
    425414
    426             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    427415            fBarWindow->Lock();
    428             barView->UpdateAutoRaise();
     416            BarView()->UpdateAutoRaise();
    429417            fBarWindow->Unlock();
    430418            break;
    431         }
    432419
    433420        case kTrackerFirst:
    434         {
    435421            fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst;
    436422
    437             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    438423            fBarWindow->Lock();
    439             barView->UpdatePlacement();
     424            BarView()->UpdatePlacement();
    440425            fBarWindow->Unlock();
    441426            break;
    442         }
    443427
    444428        case kSortRunningApps:
    445         {
    446429            fSettings.sortRunningApps = !fSettings.sortRunningApps;
    447430
    448             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    449431            fBarWindow->Lock();
    450             barView->UpdatePlacement();
     432            BarView()->UpdatePlacement();
    451433            fBarWindow->Unlock();
    452434            break;
    453         }
    454435
    455436        case kUnsubscribe:
    456437        {
    TBarApp::MessageReceived(BMessage* message)  
    461442        }
    462443
    463444        case kSuperExpando:
    464         {
    465445            fSettings.superExpando = !fSettings.superExpando;
    466446
    467             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    468447            fBarWindow->Lock();
    469             barView->UpdatePlacement();
     448            BarView()->UpdatePlacement();
    470449            fBarWindow->Unlock();
    471450            break;
    472         }
    473451
    474452        case kExpandNewTeams:
    475         {
    476453            fSettings.expandNewTeams = !fSettings.expandNewTeams;
    477454
    478             TBarView* barView = static_cast<TBarApp*>(be_app)->BarView();
    479455            fBarWindow->Lock();
    480             barView->UpdatePlacement();
     456            BarView()->UpdatePlacement();
    481457            fBarWindow->Unlock();
    482458            break;
    483         }
    484459
    485460        case 'TASK':
    486461            fSwitcherMessenger.SendMessage(message);
    TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)  
    636611    BAppFileInfo appMime(&file);
    637612
    638613    BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig),
    639         new BBitmap(kIconSize, kIconFormat), strdup(ref->name));
     614        new BBitmap(kIconRect, kIconFormat), strdup(ref->name));
    640615
    641616    barInfo->teams->AddItem((void*)team);
    642617    if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK)
    TBarApp::RemoveTeam(team_id team)  
    682657            int32 subsCount = sSubscribers.CountItems();
    683658            if (subsCount > 0) {
    684659                BMessage message((barInfo->teams->CountItems() == 1) ?
    685                      B_SOME_APP_QUIT : kRemoveTeam);
     660                    B_SOME_APP_QUIT : kRemoveTeam);
    686661
    687662                message.AddInt32("team", team);
    688663                for (int32 i = 0; i < subsCount; i++) {
    TBarApp::ShowPreferencesWindow()  
    706681{
    707682    if (fPreferencesWindow)
    708683        fPreferencesWindow->Activate();
    709     else {
     684    else {
    710685        fPreferencesWindow = new PreferencesWindow(BRect(0, 0, 320, 240));
    711686        fPreferencesWindow->Show();
    712687    }