diff --git a/ChangeLog b/ChangeLog index bd5c3844..3727f45d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25068,3 +25068,5 @@ * Added a 'sha1_test' test harness in 'tests/'. 2025-04-29 Fred Gleason * Consolidated header declarations in 'lib/rdhash.cpp'. +2025-04-30 Fred Gleason + * Cleaned up numerous compiler warnings. diff --git a/cae/driver.cpp b/cae/driver.cpp index a445b5d4..fcdbbbfd 100644 --- a/cae/driver.cpp +++ b/cae/driver.cpp @@ -2,7 +2,7 @@ // // Abstract base class for caed(8) audio driver implementations. // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -45,7 +45,7 @@ RDStation::AudioDriver Driver::driverType() const bool Driver::hasCard(int cardnum) const { - return d_cards.contains(cardnum); + return d_cards.contains((unsigned)cardnum); } diff --git a/lib/rdcae.cpp b/lib/rdcae.cpp index fe8233bb..0646d25b 100644 --- a/lib/rdcae.cpp +++ b/lib/rdcae.cpp @@ -2,7 +2,7 @@ // // Connection to the Rivendell Core Audio Engine // -// (C) Copyright 2002-2023 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -487,7 +487,8 @@ void RDCae::readyData() void RDCae::SendCommand(QString cmd) { - write(cae_socket,cmd.toUtf8().constData(),cmd.toUtf8().length()); + rda->checkcall("write",write(cae_socket,cmd.toUtf8().constData(), + cmd.toUtf8().length())); } diff --git a/lib/rdcoreapplication.cpp b/lib/rdcoreapplication.cpp index 3822c988..8ac098d6 100644 --- a/lib/rdcoreapplication.cpp +++ b/lib/rdcoreapplication.cpp @@ -578,6 +578,15 @@ void RDCoreApplication::syslog(RDConfig *config,int priority,const char *fmt,... } +int RDCoreApplication::checkcall(const char *cmd,int return_code) const +{ + if(return_code<0) { + fprintf(stderr,"%s: returned error %s\n",cmd,strerror(errno)); + } + return return_code; +} + + QString RDCoreApplication::exitCodeText(RDCoreApplication::ExitCode code) { QString ret=tr("unknown")+QString::asprintf(" [%u]",code); diff --git a/lib/rdcoreapplication.h b/lib/rdcoreapplication.h index 2c8db452..8c23f8a2 100644 --- a/lib/rdcoreapplication.h +++ b/lib/rdcoreapplication.h @@ -89,6 +89,7 @@ class RDCoreApplication : public QObject void syslog(int priority,const char *fmt,...) const; void logAuthenticationFailure(const QHostAddress &orig_addr, const QString &login_name=QString()); + int checkcall(const char *cmd,int return_code) const; static void syslog(RDConfig *config,int priority,const char *fmt,...); static QString exitCodeText(ExitCode code); static bool isUniqueProcess(const QString &cmdname); diff --git a/lib/rdmarkerdialog.cpp b/lib/rdmarkerdialog.cpp index 2ff7be2c..db059a8b 100644 --- a/lib/rdmarkerdialog.cpp +++ b/lib/rdmarkerdialog.cpp @@ -2,7 +2,7 @@ // // Rivendell Audio Marker Editor // -// (C) Copyright 2021-2023 Fred Gleason +// (C) Copyright 2021-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -200,7 +200,7 @@ void RDMarkerDialog::cancelData() switch(QMessageBox::question(this,d_caption+" - "+tr("Unsaved Changes"), tr("There are unsaved changes!")+"\n"+ tr("Do you want to save them?"), - QMessageBox::Cancel,QMessageBox::No, + QMessageBox::Cancel|QMessageBox::No| QMessageBox::Yes)) { case QMessageBox::Yes: okData(); diff --git a/lib/rdmarkerview.cpp b/lib/rdmarkerview.cpp index cbbb9a9a..8b338aa9 100644 --- a/lib/rdmarkerview.cpp +++ b/lib/rdmarkerview.cpp @@ -1153,11 +1153,12 @@ void RDMarkerView::mousePressEvent(QMouseEvent *e) if(d_view->horizontalScrollBar()!=NULL) { origin=d_view->horizontalScrollBar()->value(); } - if((e->x()<=LEFT_MARGIN)||((e->x()+origin)>d_right_margin)) { + if((e->position().x()<=LEFT_MARGIN)|| + ((e->position().x()+origin)>d_right_margin)) { QWidget::mousePressEvent(e); return; } - d_mouse_pos=e->x()-LEFT_MARGIN; + d_mouse_pos=e->position().x()-LEFT_MARGIN; if(d_marker_menu_used) { d_marker_menu_used=false; @@ -1177,7 +1178,7 @@ void RDMarkerView::mousePressEvent(QMouseEvent *e) case Qt::RightButton: d_deleting_roles.clear(); - d_main_menu->setGeometry(e->globalX(),e->globalY(), + d_main_menu->setGeometry(e->globalPosition().x(),e->globalPosition().y(), d_main_menu->sizeHint().width(), d_main_menu->sizeHint().height()); d_main_menu->exec(); diff --git a/lib/rdnotification.cpp b/lib/rdnotification.cpp index 4121f608..c36c2bd7 100644 --- a/lib/rdnotification.cpp +++ b/lib/rdnotification.cpp @@ -2,7 +2,7 @@ // // A container class for a Rivendell Notification message. // -// (C) Copyright 2018-2021 Fred Gleason +// (C) Copyright 2018-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -206,21 +206,27 @@ QString RDNotification::dump() const { QString ret; - switch((QMetaType::Type)id().type()) { - case QMetaType::Int: + switch(notify_type) { + case RDNotification::PypadType: + case RDNotification::CatchEventType: + case RDNotification::PanelButtonType: + case RDNotification::ExtendedPanelButtonType: ret+=QString::asprintf("id: %d\n",id().toInt()); break; - case QMetaType::UInt: + case RDNotification::CartType: + case RDNotification::FeedItemType: ret+=QString::asprintf("id: %u\n",id().toUInt()); break; - case QMetaType::QString: + case RDNotification::LogType: + case RDNotification::DropboxType: + case RDNotification::FeedType: ret+="id: "+id().toString()+"\n"; break; default: - ret+="Unknown QMetaType type value: %u\n",id().type(); + ret+=QString::asprintf("Unknown type value: %u\n",notify_type); break; } ret+="type: "+RDNotification::typeString(type())+"\n"; diff --git a/lib/rdpasswd.cpp b/lib/rdpasswd.cpp index 65ad9812..1c2815d1 100644 --- a/lib/rdpasswd.cpp +++ b/lib/rdpasswd.cpp @@ -2,7 +2,7 @@ // // Set Password widget for Rivendell. // -// (C) Copyright 2002-2020 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -117,7 +117,7 @@ void RDPasswd::okData() else { QMessageBox::warning(this,tr("Password Mismatch"), tr("The passwords don't match,\nplease try again!"), - tr("OK")); + QMessageBox::Ok); } } diff --git a/lib/rdpushbutton.cpp b/lib/rdpushbutton.cpp index 8f046ae3..33fe2f08 100644 --- a/lib/rdpushbutton.cpp +++ b/lib/rdpushbutton.cpp @@ -182,20 +182,20 @@ void RDPushButton::mouseReleaseEvent(QMouseEvent *e) case Qt::MiddleButton: e->accept(); emit centerReleased(); - if((e->x()>=0)&&(e->x()y()>=0)&&(e->y()position().x()>=0)&&(e->position().x()position().y()>=0)&&(e->position().y()x(),e->y())); + emit centerClicked(button_id,QPoint(e->position().x(),e->position().y())); } break; case Qt::RightButton: e->accept(); emit rightReleased(); - if((e->x()>=0)&&(e->x()y()>=0)&&(e->y()position().x()>=0)&&(e->position().x()position().y()>=0)&&(e->position().y()x(),e->y())); + emit rightClicked(button_id,QPoint(e->position().x(),e->position().y())); } break; diff --git a/lib/rdslider.cpp b/lib/rdslider.cpp index e01cb5d9..deb9b68f 100644 --- a/lib/rdslider.cpp +++ b/lib/rdslider.cpp @@ -338,7 +338,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) if(rdslider_moving) { prev_knob=curr_knob; if((rdslider_orient==RDSlider::Up)||(rdslider_orient==RDSlider::Down)) { - if(mouse->y()<0) { + if(mouse->position().y()<0) { curr_knob=QRect(curr_knob.x(),0,curr_knob.width(),curr_knob.height()); if(prev_knob!=curr_knob) { switch(rdslider_orient) { @@ -374,7 +374,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } return; } - if(mouse->y()>geometry().height()) { + if(mouse->position().y()>geometry().height()) { curr_knob=QRect(curr_knob.x(),height()-curr_knob.height(), curr_knob.width(),curr_knob.height()); if(prev_knob!=curr_knob) { @@ -411,7 +411,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } return; } - curr_y=curr_knob.y()-base_y+mouse->y(); + curr_y=curr_knob.y()-base_y+mouse->position().y(); if(curr_y<0) { curr_y=0; } @@ -420,7 +420,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } curr_knob=QRect(curr_knob.x(),curr_y, curr_knob.width(),curr_knob.height()); - base_y=mouse->y(); + base_y=mouse->position().y(); switch(rdslider_orient) { case RDSlider::Up: knob_value=(maximum()-minimum())* @@ -464,7 +464,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } if((rdslider_orient==RDSlider::Left)||(rdslider_orient==RDSlider::Right)) { - if(mouse->x()<0) { + if(mouse->position().x()<0) { curr_knob=QRect(0,curr_knob.y(),curr_knob.width(),curr_knob.height()); if(prev_knob!=curr_knob) { switch(rdslider_orient) { @@ -500,7 +500,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } return; } - if(mouse->x()>geometry().width()) { + if(mouse->position().x()>geometry().width()) { curr_knob=QRect(width()-curr_knob.width(),curr_knob.y(), curr_knob.width(),curr_knob.height()); if(prev_knob!=curr_knob) { @@ -537,7 +537,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } return; } - curr_x=curr_knob.x()-base_x+mouse->x(); + curr_x=curr_knob.x()-base_x+mouse->position().x(); if(curr_x<0) { curr_x=0; } @@ -546,7 +546,7 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) } curr_knob=QRect(curr_x,curr_knob.y(), curr_knob.width(),curr_knob.height()); - base_x=mouse->x(); + base_x=mouse->position().x(); switch(rdslider_orient) { case RDSlider::Left: knob_value=(maximum()-minimum())* @@ -594,18 +594,18 @@ void RDSlider::mouseMoveEvent(QMouseEvent *mouse) void RDSlider::mousePressEvent(QMouseEvent *mouse) { if(mouse->button()==Qt::LeftButton) { - if(curr_knob.contains(mouse->x(),mouse->y())) { - base_x=mouse->x(); - base_y=mouse->y(); + if(curr_knob.contains(mouse->position().x(),mouse->position().y())) { + base_x=mouse->position().x(); + base_y=mouse->position().y(); rdslider_moving=true; emit sliderPressed(); return; } - if(page_up.contains(mouse->x(),mouse->y())) { + if(page_up.contains(mouse->position().x(),mouse->position().y())) { addStep(); return; } - if(page_down.contains(mouse->x(),mouse->y())) { + if(page_down.contains(mouse->position().x(),mouse->position().y())) { subtractStep(); } } diff --git a/lib/rdtimearray.cpp b/lib/rdtimearray.cpp index 5546df2b..f00f2b26 100644 --- a/lib/rdtimearray.cpp +++ b/lib/rdtimearray.cpp @@ -80,7 +80,7 @@ RDTimePoint RDTimeArray::timePoint(int n) const void RDTimeArray::addPoint(QString label) { if(label.isEmpty()) { - label=QObject::tr("point")+QString::asprintf(" %d",d_points.size()); + label=QObject::tr("point")+QString::asprintf(" %lld",d_points.size()); } d_points.push_back(RDTimePoint(label)); } diff --git a/lib/rdtrackertableview.cpp b/lib/rdtrackertableview.cpp index a9e596ea..7d6cafdb 100644 --- a/lib/rdtrackertableview.cpp +++ b/lib/rdtrackertableview.cpp @@ -2,7 +2,7 @@ // // TableView widget for RDLogEdit // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -70,7 +70,7 @@ void RDTrackerTableView::dropEvent(QDropEvent *e) { RDLogLine ll; int line=-1; - int y_pos=e->pos().y(); + int y_pos=e->position().y(); if(RDCartDrag::decode(e->mimeData(),&ll)) { line=rowAt(y_pos); @@ -84,7 +84,7 @@ void RDTrackerTableView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_row<(model()->rowCount()-1))) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/lib/rdtrackerwidget.cpp b/lib/rdtrackerwidget.cpp index 3102d812..814af251 100644 --- a/lib/rdtrackerwidget.cpp +++ b/lib/rdtrackerwidget.cpp @@ -1951,7 +1951,7 @@ void RDTrackerWidget::mousePressEvent(QMouseEvent *e) d_rightclick_track=GetClick(e,d_previous_point); d_rightclick_pos=d_previous_point->x(); if(d_rightclick_track>=0) { - d_mouse_menu->setGeometry(e->globalX(),e->globalY(), + d_mouse_menu->setGeometry(e->globalPosition().x(),e->globalPosition().y(), d_mouse_menu->sizeHint().width(), d_mouse_menu->sizeHint().height()); d_mouse_menu->exec(); @@ -1976,17 +1976,17 @@ void RDTrackerWidget::mouseReleaseEvent(QMouseEvent *e) break; case Qt::MiddleButton: - if(e->y()position().y() startPoint())/TRACKER_MSECS_PER_PIXEL)+250); } else { - if(e->y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) { + if(e->position().y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) { DragTrack(0,((d_wave_origin[1]-d_loglines[1]-> startPoint())/TRACKER_MSECS_PER_PIXEL)+250); } else { - if(e->y()<(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT)) { + if(e->position().y()<(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT)) { DragTrack(0,((d_wave_origin[2]-d_loglines[2]-> startPoint())/TRACKER_MSECS_PER_PIXEL)+250); } @@ -2507,22 +2507,22 @@ QString RDTrackerWidget::GetCutName(int line,RDCut **cut) int RDTrackerWidget::GetClick(QMouseEvent *e,QPoint *p) { - p->setX(e->x()-TRACKER_X_ORIGIN); - if((e->x()<=TRACKER_X_ORIGIN)|| - (e->x()>=(TRACKER_X_ORIGIN+TRACKER_X_WIDTH))|| - (e->y()<=TRACKER_Y_ORIGIN)|| - (e->y()>=(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT))) { + p->setX(e->position().x()-TRACKER_X_ORIGIN); + if((e->position().x()<=TRACKER_X_ORIGIN)|| + (e->position().x()>=(TRACKER_X_ORIGIN+TRACKER_X_WIDTH))|| + (e->position().y()<=TRACKER_Y_ORIGIN)|| + (e->position().y()>=(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT))) { return -1; } - if(e->y()setY(e->y()-TRACKER_Y_ORIGIN); + if(e->position().y()setY(e->position().y()-TRACKER_Y_ORIGIN); return 0; } - if(e->y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) { - p->setY(e->y()-(TRACKER_Y_ORIGIN+TRACKER_Y_HEIGHT)); + if(e->position().y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) { + p->setY(e->position().y()-(TRACKER_Y_ORIGIN+TRACKER_Y_HEIGHT)); return 1; } - p->setY(e->y()-(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)); + p->setY(e->position().y()-(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)); return 2; } diff --git a/rdadmin/add_user.cpp b/rdadmin/add_user.cpp index c40d65e2..51e47a75 100644 --- a/rdadmin/add_user.cpp +++ b/rdadmin/add_user.cpp @@ -105,7 +105,7 @@ void AddUser::okData() "`LOGIN_NAME`='"+RDEscapeString(username)+"'"; if(!RDSqlQuery::apply(sql)) { QMessageBox::warning(this,tr("User Exists"),tr("User Already Exists!"), - 1,0,0); + QMessageBox::Ok); return; } sql="select `NAME` from `GROUPS`"; diff --git a/rdadmin/feedlistview.cpp b/rdadmin/feedlistview.cpp index 06016780..f86b7ff0 100644 --- a/rdadmin/feedlistview.cpp +++ b/rdadmin/feedlistview.cpp @@ -213,7 +213,7 @@ void FeedListView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_rowrowCount())) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/rdairplay/logtableview.cpp b/rdairplay/logtableview.cpp index f85bec6b..4b96e0bc 100644 --- a/rdairplay/logtableview.cpp +++ b/rdairplay/logtableview.cpp @@ -2,7 +2,7 @@ // // TableView widget for RDAirPlay // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -51,7 +51,7 @@ void LogTableView::dropEvent(QDropEvent *e) { RDLogLine ll; int line=-1; - int y_pos=e->pos().y(); + int y_pos=e->position().y(); if(RDCartDrag::decode(e->mimeData(),&ll)) { line=rowAt(y_pos); diff --git a/rdcatch/catchtableview.cpp b/rdcatch/catchtableview.cpp index 71f0445e..e52fb5a4 100644 --- a/rdcatch/catchtableview.cpp +++ b/rdcatch/catchtableview.cpp @@ -2,7 +2,7 @@ // // Events List Widget for RDCatch // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -91,7 +91,7 @@ void CatchTableView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_rowrowCount())) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/rdlibrary/audio_cart.cpp b/rdlibrary/audio_cart.cpp index 30cf8524..6e7b0f95 100644 --- a/rdlibrary/audio_cart.cpp +++ b/rdlibrary/audio_cart.cpp @@ -2,7 +2,7 @@ // // The audio cart editor for RDLibrary. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -271,7 +271,7 @@ void AudioCart::deleteCutData() else { if(QMessageBox::question(this,"RDLibrary - "+tr("Delete Cuts"), tr("Are you sure you want to delete")+ - QString::asprintf(" %d ",cutnames.size())+ + QString::asprintf(" %lld ",cutnames.size())+ tr("cuts")+"?",QMessageBox::Yes, QMessageBox::No)!=QMessageBox::Yes) { return; diff --git a/rdlogedit/edit_log.cpp b/rdlogedit/edit_log.cpp index c0c78a0c..ed3c4c42 100644 --- a/rdlogedit/edit_log.cpp +++ b/rdlogedit/edit_log.cpp @@ -1082,7 +1082,7 @@ void EditLog::cancelData() switch(QMessageBox::question(this, tr("RDLogEdit"), tr("The log has been modified.\nDo you want to save your changes?"), - QMessageBox::Yes,QMessageBox::No, + QMessageBox::Yes|QMessageBox::No| QMessageBox::Cancel)) { case QMessageBox::Yes: if(!edit_log_model->allGroupsValid()) { @@ -1093,8 +1093,7 @@ void EditLog::cancelData() SaveLog(); break; - case QMessageBox::Cancel: - case QMessageBox::NoButton: + default: return; break; } diff --git a/rdlogedit/logtableview.cpp b/rdlogedit/logtableview.cpp index 14132a03..b90db44c 100644 --- a/rdlogedit/logtableview.cpp +++ b/rdlogedit/logtableview.cpp @@ -2,7 +2,7 @@ // // TableView widget for RDLogEdit // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -70,7 +70,7 @@ void LogTableView::dropEvent(QDropEvent *e) { RDLogLine ll; int line=-1; - int y_pos=e->pos().y(); + int y_pos=e->position().y(); if(RDCartDrag::decode(e->mimeData(),&ll)) { line=rowAt(y_pos); @@ -84,7 +84,7 @@ void LogTableView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_row<(model()->rowCount()-1))) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/rdlogedit/rdlogedit.cpp b/rdlogedit/rdlogedit.cpp index a56ca8c8..2fabcd4d 100644 --- a/rdlogedit/rdlogedit.cpp +++ b/rdlogedit/rdlogedit.cpp @@ -340,7 +340,7 @@ void MainWidget::deleteData() else { if(QMessageBox::question(this,"RDLogEdit - "+tr("Delete Log"), tr("Are you sure you want to delete these")+ - QString::asprintf(" %d ",rows.size())+ + QString::asprintf(" %lld ",rows.size())+ tr("logs?"),QMessageBox::Yes,QMessageBox::No)!= QMessageBox::Yes) { return; diff --git a/rdlogmanager/clocklistview.cpp b/rdlogmanager/clocklistview.cpp index c0cde933..8265aa3e 100644 --- a/rdlogmanager/clocklistview.cpp +++ b/rdlogmanager/clocklistview.cpp @@ -2,7 +2,7 @@ // // RDTableView widget with consistent Rivendell defaults // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -70,7 +70,7 @@ void ClockListView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_rowrowCount())) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/rdlogmanager/edit_clock.cpp b/rdlogmanager/edit_clock.cpp index d4014a8b..ee0d9778 100644 --- a/rdlogmanager/edit_clock.cpp +++ b/rdlogmanager/edit_clock.cpp @@ -408,13 +408,12 @@ void EditClock::saveAsData() QString old_name=edit_name; if(edit_modified) { switch(QMessageBox::question(this,tr("Clock Modified"), - tr("The clock has been modified.\nDo you want to save?"),QMessageBox::Yes,QMessageBox::No,QMessageBox::Cancel)) { + tr("The clock has been modified.\nDo you want to save?"),QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel)) { case QMessageBox::Yes: Save(); break; - case QMessageBox::Cancel: - case QMessageBox::NoButton: + default: return; break; } @@ -495,18 +494,15 @@ void EditClock::cancelData() { if(edit_modified) { switch(QMessageBox::question(this,tr("Clock Modified"), - tr("The clock has been modified.\nDo you want to save?"),QMessageBox::Yes,QMessageBox::No,QMessageBox::Cancel)) { + tr("The clock has been modified.\nDo you want to save?"),QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel)) { case QMessageBox::Yes: Save(); done(0); break; - case QMessageBox::No: + default: done(-1); break; - - case QMessageBox::NoButton: - return; } } else { diff --git a/rdlogmanager/importcartsview.cpp b/rdlogmanager/importcartsview.cpp index c7537298..82f0fd0d 100644 --- a/rdlogmanager/importcartsview.cpp +++ b/rdlogmanager/importcartsview.cpp @@ -2,7 +2,7 @@ // // RDTableView widget with consistent Rivendell defaults // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -230,7 +230,7 @@ void ImportCartsView::dropEvent(QDropEvent *e) { RDLogLine ll; int line=-1; - int y_pos=e->pos().y(); + int y_pos=e->position().y(); if(RDCartDrag::decode(e->mimeData(),&ll)) { line=rowAt(y_pos); @@ -244,7 +244,7 @@ void ImportCartsView::mousePressEvent(QMouseEvent *e) if(e->button()==Qt::RightButton) { d_mouse_row=indexAt(e->pos()).row(); if((d_mouse_row>=0)&&(d_mouse_rowrowCount())) { - d_mouse_menu->popup(e->globalPos()); + d_mouse_menu->popup(e->globalPosition().toPoint()); } else { d_mouse_row=-1; diff --git a/rdselect/rdselect.cpp b/rdselect/rdselect.cpp index fa28c0e6..dc0e8e8f 100644 --- a/rdselect/rdselect.cpp +++ b/rdselect/rdselect.cpp @@ -55,7 +55,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) monitor_config=new RDMonitorConfig(); monitor_config->load(); int width=sizeHint().width(); - int height=sizeHint().height(); switch(monitor_config->position()) { case RDMonitorConfig::UpperLeft: setGeometry(0,RDMONITOR_HEIGHT,width,sizeHint().height()); diff --git a/ripcd/vguest.cpp b/ripcd/vguest.cpp index 1e0e3d5c..7ddd8d6b 100644 --- a/ripcd/vguest.cpp +++ b/ripcd/vguest.cpp @@ -326,7 +326,7 @@ void VGuest::processCommand(RDMacro *cmd) return; } label=cmd->rollupArgs(5).left(VGUEST_MAX_TEXT_LENGTH); - sprintf(buffer,"\x02%c\x5C%c%c%c%c%c%c%c%s",8+label.length(), + sprintf(buffer,"\x02%c\x5C%c%c%c%c%c%c%c%s",8+(uint8_t)label.length(), (char)vguest_displays_engine_nums[cmd->arg(1).toInt()-1], (char)(vguest_displays_device_nums[cmd->arg(1).toInt()-1]>>8), (char)(vguest_displays_device_nums[cmd->arg(1).toInt()-1]&0xFF), diff --git a/utils/rdalsaconfig/rdalsaconfig.cpp b/utils/rdalsaconfig/rdalsaconfig.cpp index a0339424..a78fa6d0 100644 --- a/utils/rdalsaconfig/rdalsaconfig.cpp +++ b/utils/rdalsaconfig/rdalsaconfig.cpp @@ -2,7 +2,7 @@ // // A Qt-based application to display info about ALSA cards. // -// (C) Copyright 2009-2021 Fred Gleason +// (C) Copyright 2009-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -192,19 +192,16 @@ void MainWidget::closeEvent(QCloseEvent *e) { int r=QMessageBox::question(this,tr("RDAlsaConfig quit"), tr("Save configuration before exiting?"), - QMessageBox::Yes,QMessageBox::No, + QMessageBox::Yes|QMessageBox::No| QMessageBox::Cancel); switch(r) { - case QMessageBox::Yes: - saveData(); - break; + case QMessageBox::Yes: + saveData(); + break; - case QMessageBox::No: - cancelData(); - break; - - default: - break; + default: + cancelData(); + break; } } diff --git a/utils/rdimport/rdimport.cpp b/utils/rdimport/rdimport.cpp index a6134b20..f0c62a17 100644 --- a/utils/rdimport/rdimport.cpp +++ b/utils/rdimport/rdimport.cpp @@ -2406,8 +2406,8 @@ bool MainObject::LoadIsciXref(QString *err_msg,const QString &filename) // // Skip Header // - fgets(line,1024,f); - fgets(line,1024,f); + if(fgets(line,1024,f)!=line); // Use if to suppress useless warning + if(fgets(line,1024,f)!=line); // // Load Records @@ -2438,7 +2438,7 @@ bool MainObject::LoadIsciXref(QString *err_msg,const QString &filename) } else { *err_msg=tr("invalid/corrupt data at line")+ - QString::asprintf("%d",3+fields.size()); + QString::asprintf("%lld",3+fields.size()); return false; } } diff --git a/utils/rdpopup/rdpopup.cpp b/utils/rdpopup/rdpopup.cpp index 93184f3d..31ce0537 100644 --- a/utils/rdpopup/rdpopup.cpp +++ b/utils/rdpopup/rdpopup.cpp @@ -2,7 +2,7 @@ // // A utility for displaying messages on the desktop // -// (C) Copyright 2009-2021 Fred Gleason +// (C) Copyright 2009-2025 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -19,43 +19,14 @@ // #include -#include #include #include #include #include -#include -#include #include "rdpopup.h" -// -// Icons -// -#include "../icons/rivendell-22x22.xpm" - -QString WordWrap(const QString &str) -{ - QString ret; - QString residue=str; - - while(residue.length()>TEXT_WIDTH) { - int cutpt=TEXT_WIDTH; - for(int i=TEXT_WIDTH;i>=0;i--) { - if(residue.at(i).isSpace()) { - cutpt=i; - break; - } - } - ret+=residue.left(cutpt)+"\n"; - residue=residue.right(residue.length()-cutpt-1); - } - - ret+=residue; - return ret; -} - int main(int argc,char *argv[]) { QApplication::setStyle(RD_GUI_STYLE); @@ -87,42 +58,25 @@ int main(int argc,char *argv[]) } QDateTime dt=QDateTime(QDate::currentDate(),QTime::currentTime()); - QString msg=WordWrap(argv[argc-1]); - QMessageBox *mb; + QString msg(argv[argc-1]); switch(prio) { case 1: - mb=new QMessageBox(dt.toString("MM/dd @ hh:mm"),msg, - QMessageBox::Information, - QMessageBox::Ok,QMessageBox:: - NoButton,QMessageBox::NoButton); + QMessageBox::information(NULL,dt.toString("MM/dd @ hh:mm"),msg); break; case 2: - mb=new QMessageBox(dt.toString("MM/dd @ hh:mm"),msg, - QMessageBox::Warning,QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::warning(NULL,dt.toString("MM/dd @ hh:mm"),msg); break; case 3: - mb=new QMessageBox(dt.toString("MM/dd @ hh:mm"),msg, - QMessageBox::Critical,QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(NULL,dt.toString("MM/dd @ hh:mm"),msg); break; default: - mb=new QMessageBox(dt.toString("MM/dd @ hh:mm"),msg, - QMessageBox::Information, - QMessageBox::Ok,QMessageBox::NoButton, - QMessageBox::NoButton); + QMessageBox::information(NULL,dt.toString("MM/dd @ hh:mm"),msg); break; } - mb->setWindowIcon(QIcon(QPixmap(rivendell_22x22_xpm))); - - RDFontEngine *fs=new RDFontEngine(config); - mb->setFont(fs->progressFont()); - mb->exec(); - delete mb; RDApplication::syslog(config,LOG_INFO,"\"%s\" acknowledged",argv[argc-1]); closelog(); diff --git a/utils/rdsoftkeys/rdsoftkeys.cpp b/utils/rdsoftkeys/rdsoftkeys.cpp index 6a0a2544..c58a0b01 100644 --- a/utils/rdsoftkeys/rdsoftkeys.cpp +++ b/utils/rdsoftkeys/rdsoftkeys.cpp @@ -24,10 +24,10 @@ #include #include #include -#include #include #include +#include #include "rdsoftkeys.h" @@ -39,6 +39,8 @@ MainWidget::MainWidget(RDConfig *config,Qt::WindowFlags f) : QWidget(NULL,f) { + rdt=new RDTranslator("rdsoftkeys",NULL); + key_ysize=70; // @@ -208,30 +210,6 @@ int main(int argc,char *argv[]) QApplication::setStyle(RD_GUI_STYLE); QApplication a(argc,argv); - // - // Load Translations - // - QString tr_path; - QString qt_path; - - QString loc=RDApplication::locale(); - if(!loc.isEmpty()) { - tr_path=QString(PREFIX)+QString("/share/srlabs/"); - qt_path=QString("/usr/share/qt4/translation/"); - - QTranslator qt(0); - qt.load(qt_path+QString("qt_")+loc,"."); - a.installTranslator(&qt); - - QTranslator libradio(0); - libradio.load(tr_path+QString("librd_")+loc,"."); - a.installTranslator(&libradio); - - QTranslator tests(0); - tests.load(tr_path+QString("rdsoftkeys_")+loc,"."); - a.installTranslator(&tests); - } - // // Read Command Options // diff --git a/utils/rmlsend/rmlsend.cpp b/utils/rmlsend/rmlsend.cpp index 3d2c4e71..8f2ff130 100644 --- a/utils/rmlsend/rmlsend.cpp +++ b/utils/rmlsend/rmlsend.cpp @@ -24,7 +24,6 @@ #include #include #include -//#include #include @@ -457,34 +456,6 @@ int main(int argc,char *argv[]) } else { QApplication a(argc,argv); - - // - // Load Translations - // - QString tr_path; - QString qt_path; - - QString loc=RDApplication::locale(); - if(!loc.isEmpty()) { - tr_path=QString(PREFIX)+QString("/share/rivendell/"); - qt_path=QString("/usr/share/qt4/translation/"); - - QTranslator qt(0); - qt.load(qt_path+QString("qt_")+loc,"."); - a.installTranslator(&qt); - - QTranslator rd(0); - rd.load(tr_path+QString("librd_")+loc,"."); - a.installTranslator(&rd); - - QTranslator rdhpi(0); - rdhpi.load(tr_path+QString("librdhpi_")+loc,"."); - a.installTranslator(&rdhpi); - - QTranslator tr(0); - tr.load(tr_path+QString("rmlsend_")+loc,"."); - a.installTranslator(&tr); - } // // Start Event Loop