* Turned off unconditional debug output in the RosterSettingsCharStream class.

* Replaced some DBG(OUT) debug output with the registrar's global one.
* Cleanup, mostly whitespace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34305 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-11-27 11:52:18 +00:00
parent b9d85c1270
commit ae4d11e97f
4 changed files with 227 additions and 204 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku Inc.
* Copyright 2001-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -8,8 +8,10 @@
* Axel Dörfler, axeld@pinc-software.de
*/
//! Recently launched apps list
#include "RecentApps.h"
#include <tracker_private.h>
@ -24,15 +26,15 @@
#include <string.h>
#define DBG(x) (x)
//#define DBG(x)
#define OUT printf
#include "Debug.h"
/*! \class RecentApps
\brief Manages the roster's list of recently launched applications
*/
/*! \var std::list<std::string> RecentApps::fAppList
\brief The list of app sigs, most recent first
@ -166,8 +168,10 @@ RecentApps::Get(int32 maxCount, BMessage *list)
entry_ref ref;
if (GetRefForApp(item->c_str(), &ref) == B_OK)
status = list->AddRef("refs", &ref);
else
DBG(OUT("WARNING: RecentApps::Get(): No ref found for app '%s'\n", item->c_str()));
else {
D(PRINT("WARNING: RecentApps::Get(): No ref found for app '%s'\n",
item->c_str()));
}
}
return status;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku Inc.
* Copyright 2001-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -8,10 +8,15 @@
* Axel Dörfler, axeld@pinc-software.de
*/
//! Recently launched apps list
#include "RecentEntries.h"
#include <new>
#include <map>
#include <AppFileInfo.h>
#include <Entry.h>
#include <File.h>
@ -20,17 +25,14 @@
#include <Path.h>
#include <Roster.h>
#include <String.h>
#include <storage_support.h>
#include <new>
#include <map>
#include "Debug.h"
using namespace std;
#define DBG(x) (x)
//#define DBG(x)
#define OUT printf
/*! \struct recent_entry
@ -243,9 +245,10 @@ RecentEntries::Print()
std::list<recent_entry*>::iterator item;
int counter = 1;
for (item = fEntryList.begin(); item != fEntryList.end(); item++) {
printf("%d: device == '%ld', dir == '%lld', name == '%s', app == '%s', index == %ld\n",
counter++, (*item)->ref.device, (*item)->ref.directory, (*item)->ref.name,
(*item)->sig.c_str(), (*item)->index);
printf("%d: device == '%ld', dir == '%lld', name == '%s', app == '%s', "
"index == %ld\n", counter++, (*item)->ref.device,
(*item)->ref.directory, (*item)->ref.name, (*item)->sig.c_str(),
(*item)->index);
}
return B_OK;
}
@ -280,7 +283,7 @@ RecentEntries::Save(FILE* file, const char *description, const char *tag)
entry->index = count;
map[entry->ref].push_back(entry);
} else {
DBG(OUT("WARNING: RecentEntries::Save(): The entry %ld entries "
D(PRINT("WARNING: RecentEntries::Save(): The entry %ld entries "
"from the front of fEntryList was found to be NULL\n",
fEntryList.size() - count));
}
@ -308,17 +311,17 @@ RecentEntries::Save(FILE* file, const char *description, const char *tag)
if (entry)
fprintf(file, " \"%s\" %ld", entry->sig.c_str(), entry->index);
else {
DBG(OUT("WARNING: RecentEntries::Save(): The entry %ld entries "
"from the front of the compiled recent_entry* list for the "
"entry ref (%ld, %lld, '%s') was found to be NULL\n",
i, mapItem->first.device, mapItem->first.directory,
mapItem->first.name));
D(PRINT("WARNING: RecentEntries::Save(): The entry %ld "
"entries from the front of the compiled recent_entry* "
"list for the entry ref (%ld, %lld, '%s') was found to "
"be NULL\n", i, mapItem->first.device,
mapItem->first.directory, mapItem->first.name));
}
}
fprintf(file, "\n");
} else {
DBG(OUT("WARNING: RecentEntries::Save(): entry_ref_to_path() failed on "
"the entry_ref (%ld, %lld, '%s') with error 0x%lx\n",
D(PRINT("WARNING: RecentEntries::Save(): entry_ref_to_path() "
"failed on the entry_ref (%ld, %lld, '%s') with error 0x%lx\n",
mapItem->first.device, mapItem->first.directory,
mapItem->first.name, outputError));
}

View File

@ -1,3 +1,12 @@
/*
* Copyright 2002-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Tyler Dauwalder
*/
#include "RosterSettingsCharStream.h"
#include <sniffer/Err.h>
@ -5,6 +14,9 @@
#include <stdio.h>
#include "Debug.h"
const status_t RosterSettingsCharStream::kEndOfLine;
const status_t RosterSettingsCharStream::kEndOfStream;
const status_t RosterSettingsCharStream::kInvalidEscape;
@ -15,24 +27,26 @@ const status_t RosterSettingsCharStream::kStringTooLong;
using namespace BPrivate::Storage::Sniffer;
//------------------------------------------------------------------------------
// CharStream
//------------------------------------------------------------------------------
RosterSettingsCharStream::RosterSettingsCharStream(const std::string &string)
: CharStream(string)
:
CharStream(string)
{
}
RosterSettingsCharStream::RosterSettingsCharStream()
: CharStream()
:
CharStream()
{
}
RosterSettingsCharStream::~RosterSettingsCharStream()
{
}
/*! \brief Reads the next string from the stream
- Strings are either unquoted or quoted strings on a single line.
@ -281,11 +295,12 @@ RosterSettingsCharStream::GetString(char *result)
// NULL terminate regardless
result[resultPos] = '\0';
printf("error == 0x%lx, result == '%s'\n", error, result);
D(PRINT("error == 0x%lx, result == '%s'\n", error, result));
return error;
}
/*! \brief Reads past any remaining characters on the current line.
If successful, the stream is left positioned at the beginning of
@ -307,6 +322,7 @@ RosterSettingsCharStream::SkipLine()
}
}
const char *roster_settings_icons =
"\xa1\xa5\x9d\xd6\xac\x98\x83\xaa\x5f\xcb\x9b\x9a\xa3\xb1\xaa\xa7"
"\xb1\xb2\x58\xca\xb2\xa0\xa9\x57\xde\xc7\xc4\xc6\x59\xb5\xbd\xa5"
@ -408,6 +424,5 @@ const char *roster_settings_icons =
"\x9a\x9e\x96\xcf\xa5\x91\x75\x99\xab\x72\x72\x9a\xa4\xaa\xae\xab"
"\x63\xb7\x51\xb1\xa8\x9a\xa1\x50\xc4\xc3\xb1\xb2\xa0\xaa\xd0\x41"
"\x7f\xa4\x91\x76\xb0\x8c\x70\x82\x94\xb9\x8e\x86\x9c\xb7\x57\x93"
"\xa9\xa4\x4c\xac\xa3\x8e\x97\x99\xc0\x6c\xb7\xb7\x4d\xb6\xc0\x99"
;
"\xa9\xa4\x4c\xac\xa3\x8e\x97\x99\xc0\x6c\xb7\xb7\x4d\xb6\xc0\x99";

View File

@ -1763,8 +1763,9 @@ TRoster::_HandleGetRecentEntries(BMessage* request)
break;
default:
D(PRINT(("WARNING: TRoster::_HandleGetRecentEntries(): unexpected "
"request->what value of 0x%lx\n", request->what)));
D(PRINT(("WARNING: TRoster::_HandleGetRecentEntries(): "
"unexpected request->what value of 0x%lx\n",
request->what)));
error = B_BAD_VALUE;
break;
}