Seafood/Fishes.cpp
author John Kern <johnk@symbian.org>
Tue, 06 Apr 2010 08:02:52 -0700
changeset 14 a16afe3df8c9
parent 11 f3dbeee07821
child 15 0f80a0f39475
permissions -rwxr-xr-x
get nutrition information from db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
#include <QDesktopServices>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
#include <QMessageBox>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
#include <QtGlobal>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
#include <QtSql>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
#include "Fishes.h"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
Fishes::Fishes(QObject *parent) : QObject(parent)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
    QSqlDatabase db;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
    // Find QSLite driver
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
    db = QSqlDatabase::addDatabase("QSQLITE");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    15
#ifdef Q_OS_SYMBIAN
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
    QString dbFile = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
                     + '/'  // Qt Universal file separator
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
                     + "seafood.db";
11
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
    19
    dbFile.replace("/","\\");
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    20
#else
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    21
    // Windows assumed.
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    22
    // unfortunately, "C:\Documents and Settings" is corrupted on my home PC. hard coding until I fix it. -jk
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    23
    QString dbFile = "C:/workspace/QtExamples/Seafood/populateDB/seafood.db";
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    24
#endif
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
    QFile f(dbFile);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
    if (!f.exists()) {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
        qWarning("db not found ");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
    } else {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
        qWarning("found db ");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
    }
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    31
    qWarning(dbFile.toStdString().c_str());
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
    db.setDatabaseName(dbFile);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
    // Open databasee
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
    if(!db.open())
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
    {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
        qWarning("DB: failed to open.");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
        this->bestFish << "Abalone (farmed)" << "Anchovy, European" << "Barramundi U.S."
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
            << "Capelin, smelt roe (Iceland)" << "Catfish (U.S.)" << "Clam, softshell"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
            << "Clams (farmed)" << "Cod, AK (longline)" << "Crab, Dungeness"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
            << "Crab, stone" << "Mussels" << "Oysters (farmed)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
            << "Sablefish/ Black Cod (Alaska, Canada)" << "Salmon, wild (Alaska)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    44
            << "Sardines, Pacific (U.S.)" << "Shrimp, pink (Oregon)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    45
            << "Trout, rainbow (farmed)" << "Tuna, albacore (U.S., Canada)";
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
        this->okFish << "Clams (wild)" << "Cod, Pacific (trawl)" << "Crab, Snow"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
            << "Flounder/sole (Pacific)" << "Lobster, American/Maine" << "Scallops, sea (U.S., Canada)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
            << "Shrimp (U.S. wild)" << "Squid" << "Tilapia (Latin America)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
            << "Tuna, canned light";
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    50
        this->worstFish << "Chilean sea bass" << "Grouper" << "Orange roughy"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    51
            << "Rockfish (trawl)" << "Salmon, farmed or Atlantic" << "Shark"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    52
            << "Swordfish (imported)" << "Tilefish (Gulf of Mexico/South Atlantic)"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    53
            << "Tuna, bigeye/yellowfin" << "Tuna, bluefin";
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    54
    } else {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    55
        this->populate(EPresentBest);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    56
        this->populate(EPresentOK);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    57
        this->populate(EPresentWorst);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    58
    }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    59
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    60
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    61
/* given the name of a fish, return a list of eco details in html format.
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    62
 */
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    63
QString Fishes::getEcoDetails(QString name)
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    64
{
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    65
    QString detailsInHtml;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    66
    QSqlQuery query;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    67
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    68
    query.prepare("select details from ecoDetails "
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    69
                  "where fid in (select fid from fish where name = :name )");
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    70
    query.bindValue(":name",name);
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    71
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    72
    if (!query.exec())
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    73
    {
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    74
        QString errCode =  "failed to get eco details " + query.lastError().text();
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    75
        qWarning(errCode.toStdString().c_str());
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    76
    }
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    77
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    78
    detailsInHtml.append("<html> <title>name</title> <body> <h2>Eco Details</h2> <ul> ");
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    79
    while (query.next()){
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    80
        detailsInHtml.append( " <li>");
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    81
        detailsInHtml.append( query.value(0).toString());
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    82
        detailsInHtml.append( "</li> " );
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    83
    }
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    84
    detailsInHtml.append("</ul> </body> </html> ");
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    85
    return  detailsInHtml;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    86
}
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    87
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    88
void Fishes::getNutrition(QString name)
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    89
{
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    90
    QSqlQuery query;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    91
    QMap<QString, QString> nutrition;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    92
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    93
    query.prepare("select calories,fat,protein,omega3,cholesterol,sodium from fish where name = :name ");
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    94
    query.bindValue(":name",name);
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    95
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    96
    if (!query.exec())
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    97
    {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    98
        QString errCode =  "failed to get nutrition information " + query.lastError().text();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    99
        qWarning(errCode.toStdString().c_str());
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   100
    }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   101
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   102
    query.next();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   103
    nutrition["Calories"] = query.value(0).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   104
    nutrition["Total Fat"] = query.value(1).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   105
    nutrition["Total Protein"] = query.value(2).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   106
    nutrition["Omega-3"] = query.value(3).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   107
    nutrition["Cholesterol"] = query.value(4).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   108
    nutrition["Sodium"] = query.value(5).toString();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   109
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   110
    QMapIterator<QString, QString> i(nutrition);
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   111
    while (i.hasNext())
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   112
    {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   113
         i.next();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   114
         qDebug() << i.key() << ": " << i.value() << endl;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   115
    }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   116
}
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   117
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   118
void Fishes::populate(TCATEGORIES cat)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   119
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   120
    QSqlQuery query;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   121
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   122
    query.prepare("SELECT name FROM fish where category = :category ");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   123
    query.bindValue(":category",cat);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   124
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   125
    if (!query.exec())
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   126
    {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   127
        QString errCode =  "failed to populate " + query.lastError().text();
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   128
        qWarning(errCode.toStdString().c_str());
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   129
        //qFatal("Failed to add fish.");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   130
    }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   131
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   132
    while (query.next()){
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   133
        switch (cat)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   134
        {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   135
        case  EPresentBest:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   136
            this->bestFish << query.value(0).toString();
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   137
            break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   138
        case EPresentWorst:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   139
            this->worstFish << query.value(0).toString();
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   140
            break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   141
        case EPresentOK:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   142
            this->okFish << query.value(0).toString();
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   143
            break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   144
        default:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   145
            qWarning("this can't happen.");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   146
            break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   147
        }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   148
    }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   149
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   150
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   151
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   152
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   153
const QStringList Fishes::getBest()
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   154
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   155
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   156
    return bestFish;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   157
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   158
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   159
const QStringList Fishes::getOK()
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   160
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   161
    return okFish;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   162
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   163
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   164
const QStringList Fishes::getWorst()
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   165
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   166
    return worstFish;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   167
}