Commit 6bd2a8bd authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Revert "GIT_SILENT: Remove DISABLE_DEPRECATED_BEFORE macro. It can break...

Revert "GIT_SILENT: Remove DISABLE_DEPRECATED_BEFORE macro. It can break compile when we increase KF5/Qt5"

Minus points to me for not lokking at the complete commit and the history.

This reverts commit 948b6fbe.
parent 948b6fbe
......@@ -48,6 +48,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINAR
IF(NOT WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kcachegrind.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/kcachegrind.spec )
ENDIF(NOT WIN32)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
ecm_create_qm_loader(kcachegrind_QM_LOADER kcachegrind_qt)
......
......@@ -29,21 +29,21 @@
* Just a simple command line tool using libcore
*/
void showHelp(bool fullHelp = true)
void showHelp(QTextStream& out, bool fullHelp = true)
{
std::cout << "Show profiles from callgrind files. (c) 2010-2016 J. Weidendorfer\n";
out << "Show profiles from callgrind files. (c) 2010-2016 J. Weidendorfer\n";
if (!fullHelp)
std::cout << "Type 'cgview -h' for help." << std::endl;
out << "Type 'cgview -h' for help." << endl;
else
std::cout << "Usage: cgview [options] <file> ...\n\n"
out << "Usage: cgview [options] <file> ...\n\n"
"Options:\n"
" -h Show this help text\n"
" -e Sort list according to exclusive cost\n"
" -s <ev> Sort and show counters for event <ev>\n"
" -c Sort by call count\n"
" -b Show butterfly (callers and callees)\n"
" -n Do not detect recursive cycles" << std::endl;
" -n Do not detect recursive cycles" << endl;
exit(1);
}
......@@ -52,6 +52,7 @@ void showHelp(bool fullHelp = true)
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
QTextStream out(stdout);
Loader::initLoaders();
ConfigStorage::setStorage(new ConfigStorage);
......@@ -59,7 +60,7 @@ int main(int argc, char** argv)
QStringList list = app.arguments();
list.pop_front();
if (list.isEmpty()) showHelp(false);
if (list.isEmpty()) showHelp(out, false);
bool sortByExcl = false;
bool sortByCount = false;
......@@ -68,7 +69,7 @@ int main(int argc, char** argv)
QStringList files;
for(int arg = 0; arg<list.count(); arg++) {
if (list[arg] == QLatin1String("-h")) showHelp();
if (list[arg] == QLatin1String("-h")) showHelp(out);
else if (list[arg] == QLatin1String("-e")) sortByExcl = true;
else if (list[arg] == QLatin1String("-n")) GlobalConfig::setShowCycles(false);
else if (list[arg] == QLatin1String("-b")) showCalls = true;
......@@ -82,11 +83,11 @@ int main(int argc, char** argv)
EventTypeSet* m = d->eventTypes();
if (m->realCount() == 0) {
std::cout << "Error: No event types found." << std::endl;
out << "Error: No event types found." << endl;
return 1;
}
std::cout << "\nTotals for event types:\n";
out << "\nTotals for event types:\n";
EventType* et;
for (int i=0;i<m->realCount();i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment