Permalink
Browse files

Add a specialized debug statement(s) to the new meta-file parser: try…

…ing to figure out why a particular application is having it's description run together.
  • Loading branch information...
Ken Moore
Ken Moore committed Nov 14, 2013
1 parent 8d4e4d6 commit 247c0324f2487a9e57298ce1ffc9ab4bb75d48a7
Showing with 3 additions and 0 deletions.
  1. +3 −0 src-qt4/pc-softwaremanager/pbiDBAccess.cpp
@@ -212,6 +212,7 @@ QStringList PBIDBAccess::parseAppMetaLine(QString line){
QStringList list = line.split(";");
//Format the output list
QStringList output;
+ bool DEBUG = (list[0].toLower()=="xastir");
if(list.length() < 13){ return output;} //invalid line
output << list[0]; //NAME
output << list[1]; //CATEGORY
@@ -223,12 +224,14 @@ QStringList PBIDBAccess::parseAppMetaLine(QString line){
output << list[7]; //TAGS
//Cleanup the description (try to format the text properly)
QStringList tmp = list[8].split("<br>");
+ if(DEBUG){ qDebug() << "Raw Description:\n" << list[8]; }
for(int i=1; i<tmp.length(); i++){
tmp[i-1] = tmp[i-1].simplified();
if(tmp[i-1].isEmpty() || tmp[i].isEmpty() ){}
else if(tmp[i-1].endsWith(".") || tmp[i-1].endsWith(":") || tmp[i-1].endsWith(";") || tmp[i-1].endsWith("?") || tmp[i-1].endsWith("!") ){}
else if( tmp[i].startsWith("*") || tmp[i].startsWith("0") || tmp[i].startsWith("-") || tmp[i].startsWith("o ") ){}
else{
+ if(DEBUG){ qDebug() << " - Bad Line Break:\n" << tmp[i-1] << "<br>" << tmp[i]; }
//Bad line break, combine it with the previous line
tmp[i-1].append(" "+tmp[i]);
tmp.removeAt(i);

0 comments on commit 247c032

Please sign in to comment.