~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to libs/libmythupnp/upnpcds.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2009-09-08 23:08:37 UTC
  • mfrom: (1.1.32 upstream)
  • Revision ID: james.westby@ubuntu.com-20090908230837-zrm2j6wutp76hwso
Tags: 0.22.0~trunk21742-0ubuntu1
* New upstream checkout (21742)
  - Fixes FTBFS on PPC. See changeset 21571 for more details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
892
892
            {
893
893
                BuildItemQuery( query, mapParams );
894
894
 
895
 
                if (query.exec() && query.size() > 0)
 
895
                if (query.exec() && query.next())
896
896
                {
897
 
                    if ( query.next() )
898
 
                    {
899
 
                        pRequest->m_sObjectId = RemoveToken( "/", pRequest->m_sObjectId, 1 );
 
897
                    pRequest->m_sObjectId = RemoveToken( "/", pRequest->m_sObjectId, 1 );
900
898
 
901
 
                        AddItem( pRequest->m_sObjectId, pResults, false, query );
902
 
                        pResults->m_nTotalMatches = 1;
903
 
                    }
 
899
                    AddItem( pRequest->m_sObjectId, pResults, false, query );
 
900
                    pResults->m_nTotalMatches = 1;
904
901
                }
905
902
            }
906
903
            break;
968
965
                    query.prepare  ( sSQL );
969
966
                    query.bindValue( ":KEY", sKey );
970
967
 
971
 
                    if (query.exec() && query.size() > 0)
 
968
                    if (query.exec() && query.next())
972
969
                    {
973
 
                        if ( query.next() )
974
 
                        {
975
 
                            // ----------------------------------------------
976
 
                            // Return Container Object Only
977
 
                            // ----------------------------------------------
978
 
 
979
 
                            pResults->m_nTotalMatches   = 1;
980
 
                            pResults->m_nUpdateID       = 1;
981
 
 
982
 
                            CDSObject *pItem = CreateContainer( pRequest->m_sObjectId,  
983
 
                                                                query.value(1).toString(), 
984
 
                                                                pRequest->m_sParentId );
985
 
 
986
 
                            pItem->SetChildCount( GetDistinctCount( pInfo ));
987
 
 
988
 
                            pResults->Add( pItem ); 
989
 
                        }
 
970
                        // ----------------------------------------------
 
971
                        // Return Container Object Only
 
972
                        // ----------------------------------------------
 
973
 
 
974
                        pResults->m_nTotalMatches   = 1;
 
975
                        pResults->m_nUpdateID       = 1;
 
976
 
 
977
                        CDSObject *pItem = CreateContainer( pRequest->m_sObjectId,
 
978
                                                            query.value(1).toString(),
 
979
                                                            pRequest->m_sParentId );
 
980
 
 
981
                        pItem->SetChildCount( GetDistinctCount( pInfo ));
 
982
 
 
983
                        pResults->Add( pItem );
990
984
                    }
991
985
                }
992
986
                break;
1073
1067
 
1074
1068
                query.prepare( sSQL );
1075
1069
 
1076
 
                if (query.exec() && query.size() > 0)
 
1070
                if (query.exec())
1077
1071
                {
1078
1072
 
1079
1073
                    while(query.next())
1144
1138
 
1145
1139
        query.prepare( sSQL );
1146
1140
 
1147
 
        if (query.exec() && query.size() > 0)
 
1141
        if (query.exec() && query.next())
1148
1142
        {
1149
 
            query.next();
1150
 
 
1151
1143
            nCount = query.value(0).toInt();
1152
1144
        }
1153
1145
    }
1177
1169
        if ( sKey.length() )
1178
1170
            query.bindValue( ":KEY", sKey );
1179
1171
 
1180
 
        if (query.exec() && query.size() > 0)
 
1172
        if (query.exec() && query.next())
1181
1173
        {
1182
 
            query.next();
1183
 
 
1184
1174
            nCount = query.value(0).toInt();
1185
1175
        }
1186
1176
        VERBOSE(VB_UPNP+VB_EXTRA, "UPnpCDSExtension::GetCount() - " +
1236
1226
        if ( sKey.length() )
1237
1227
            query.bindValue(":KEY", sKey );
1238
1228
 
1239
 
        if (query.exec() && query.size() > 0)
 
1229
        if (query.exec())
1240
1230
        {
1241
1231
            while(query.next()) 
1242
1232
                AddItem( pRequest->m_sObjectId, pResults, bAddRef, query );