~qqworini/aesydict/online-improve

« back to all changes in this revision

Viewing changes to src/dictcenter.cpp

  • Committer: Joey Chan
  • Date: 2015-04-17 07:33:24 UTC
  • Revision ID: qqworini@gmail.com-20150417073324-q813re4wpnzin4lx
main functions completed

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
 
133
133
bool DictCenter::updateDictionary(const qint32 &id, const QString &status)
134
134
{
135
 
    return dictDB.updateDictionary(id, status) ;
 
135
    if (dictDB.updateDictionary(id, status))
 
136
    {
 
137
        initial();
 
138
        return true ;
 
139
    }
 
140
    else
 
141
    {
 
142
        return false ;
 
143
    }
136
144
}
137
145
 
138
146
bool DictCenter::removeDictionary(const qint32 &id, const QString &fileName)
148
156
//            return true ;
149
157
//        }
150
158
//        else { return false ; }
 
159
        initial();
151
160
    }
152
161
    else { return false ; }
153
162
}
176
185
{
177
186
    dictThread.quit();
178
187
    dictThread.wait();
 
188
    QHash<QString, Dict*>::const_iterator i;
 
189
    for (i = dictList.constBegin(); i != dictList.constEnd(); ++i) {
 
190
        delete i.value() ;
 
191
    }
179
192
    dictList.clear();
180
193
    // 0. get dict name list from db, ignore disabed dict
181
194
    QStringList dictEnabledList = dictDB.getDictionariesEnabled() ;
 
195
    qDebug() << "dictEnabledList: " << dictEnabledList ;
182
196
 
183
197
    foreach (QString dictName, dictEnabledList)
184
198
    {