Compare with isEmpty() instead of null string "" [krazy 36/37] by Mikko Rapeli

parent ec4afadc
......@@ -233,7 +233,7 @@ void ClipStabilize::slotUpdateParams()
for (int i=0;i<vbox->count();i++){
QWidget* w=vbox->itemAt(i)->widget();
QString name=w->objectName();
if (name !="" && m_ui_params.contains(name)){
if (!name.isEmpty() && m_ui_params.contains(name)){
if (m_ui_params[name]["type"]=="int" || m_ui_params[name]["type"]=="double"){
DoubleParameterWidget *dbl=(DoubleParameterWidget*)w;
m_ui_params[name]["value"]=QString::number((double)(dbl->getValue()));
......
......@@ -74,7 +74,7 @@ void JogShuttleAction::slotShuttlePos(int shuttle_pos)
void JogShuttleAction::slotButton(int button_id)
{
if (button_id >= m_actionMap.size() || m_actionMap[button_id] == "") {
if (button_id >= m_actionMap.size() || m_actionMap[button_id].isEmpty()) {
// TODO(fleury): Shoudl this go to the status bar to inform the user ?
fprintf(stderr, "Button %d has no action\n", button_id);
return;
......
......@@ -64,7 +64,7 @@ QString JogShuttleConfig::actionMap(const QStringList& actionMap)
{
QStringList mappings;
for (int i=0; i < actionMap.size(); ++i) {
if (actionMap[i] == "")
if (actionMap[i].isEmpty())
continue;
mappings << QString("%1%2%3%4").arg(BUTTON_PREFIX).arg(i).arg(KEY_VALUE_SEP).arg(actionMap[i]);
}
......
......@@ -635,7 +635,7 @@ void TitleWidget::refreshTitleTemplates()
void TitleWidget::templateIndexChanged(int index)
{
QString item = templateBox->itemData(index).toString();
if (item != "") {
if (!item.isEmpty()) {
if (lastDocumentHash != QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex()) {
if (KMessageBox::questionYesNo(this, i18n("Do you really want to load a new template? Changes in this title will be lost!")) == KMessageBox::No) return;
}
......
......@@ -80,7 +80,7 @@ bool UnicodeDialog::controlCharacter(QString text)
switch (inputMethod) {
case InputHex:
if (t == ""
if (t.isEmpty()
|| (t.length() == 1 && !(t == "9" || t == "a" || t == "d"))
|| (t.length() == 2 && t.at(0) == QChar('1'))) {
isControlCharacter = true;
......
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