[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt: convert fromTime_t to fromSecsSinceEpoch
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Tue Mar 7 09:30:53 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
8a5bcc93 by Ilkka Ollakka at 2023-03-07T09:11:00+00:00
qt: convert fromTime_t to fromSecsSinceEpoch
fromTime_t has been deprecated and fromSecsSinceEpoch looks like drop-in replacement in our use
- - - - -
7b9d6aa0 by Ilkka Ollakka at 2023-03-07T09:11:00+00:00
qt: use primaryscreen geometry as default
qApp->desktop has been deprecated, but primaryscreen should be same approach for our use in this case
- - - - -
ed986711 by Ilkka Ollakka at 2023-03-07T09:11:00+00:00
qt: replace setMargin with setContentsMargins
setMargin has been deprecated and shouldn't be used
- - - - -
13 changed files:
- modules/gui/qt/dialogs/epg/EPGItem.cpp
- modules/gui/qt/dialogs/epg/EPGProgram.cpp
- modules/gui/qt/dialogs/epg/EPGWidget.cpp
- modules/gui/qt/dialogs/epg/epg.cpp
- modules/gui/qt/dialogs/open/open_panels.cpp
- modules/gui/qt/dialogs/plugins/plugins.cpp
- modules/gui/qt/dialogs/preferences/complete_preferences.cpp
- modules/gui/qt/dialogs/preferences/preferences.cpp
- modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
- modules/gui/qt/dialogs/preferences/simple_preferences.cpp
- modules/gui/qt/medialibrary/mlrecentsmodel.cpp
- modules/gui/qt/medialibrary/mlurlmodel.cpp
- modules/gui/qt/widgets/native/qvlcframe.cpp
Changes:
=====================================
modules/gui/qt/dialogs/epg/EPGItem.cpp
=====================================
@@ -151,7 +151,7 @@ uint16_t EPGItem::eventID() const
bool EPGItem::setData( const vlc_epg_event_t *data )
{
- QDateTime newtime = QDateTime::fromTime_t( data->i_start );
+ QDateTime newtime = QDateTime::fromSecsSinceEpoch( data->i_start );
QString newname = qfu( data->psz_name );
QString newdesc = qfu( data->psz_description );
QString newshortdesc = qfu( data->psz_short_description );
=====================================
modules/gui/qt/dialogs/epg/EPGProgram.cpp
=====================================
@@ -96,7 +96,7 @@ void EPGProgram::updateEvents( const vlc_epg_event_t * const * pp_events, size_t
for( size_t i=0; i<i_events; i++ )
{
const vlc_epg_event_t *p_event = pp_events[i];
- QDateTime eventStart = QDateTime::fromTime_t( p_event->i_start );
+ QDateTime eventStart = QDateTime::fromSecsSinceEpoch( p_event->i_start );
if( !mindate->isValid() || eventStart < *mindate )
*mindate = eventStart;
=====================================
modules/gui/qt/dialogs/epg/EPGWidget.cpp
=====================================
@@ -108,7 +108,7 @@ void EPGWidget::updateEPG( input_item_t *p_input_item )
vlc_mutex_lock( & p_input_item->lock );
m_epgView->updateEPG( p_input_item->pp_epg, p_input_item->i_epg );
m_epgView->setEpgTime( ( p_input_item->i_epg_time ) ?
- QDateTime::fromTime_t( p_input_item->i_epg_time ) :
+ QDateTime::fromSecsSinceEpoch( p_input_item->i_epg_time ) :
QDateTime() );
vlc_mutex_unlock( & p_input_item->lock );
=====================================
modules/gui/qt/dialogs/epg/epg.cpp
=====================================
@@ -48,7 +48,7 @@ EpgDialog::EpgDialog( qt_intf_t *_p_intf ): QVLCFrame( _p_intf )
setWindowTitle( qtr( "Program Guide" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
- layout->setMargin( 0 );
+ layout->setContentsMargins(0, 0, 0, 0);
epg = new EPGWidget( this );
QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this );
=====================================
modules/gui/qt/dialogs/open/open_panels.cpp
=====================================
@@ -177,7 +177,7 @@ inline void FileOpenPanel::BuildOldPanel()
connect( lineFileEdit, &QLineEdit::textChanged, this, &FileOpenPanel::updateMRL );
}
- dialogBox->layout()->setMargin( 0 );
+ dialogBox->layout()->setContentsMargins(0, 0, 0, 0);
dialogBox->layout()->setSizeConstraint( QLayout::SetNoConstraint );
/** END of QFileDialog tweaking **/
=====================================
modules/gui/qt/dialogs/plugins/plugins.cpp
=====================================
@@ -346,7 +346,7 @@ AddonsTab::AddonsTab( qt_intf_t *p_intf_ ) : QVLCFrame( p_intf_ )
QVBoxLayout *layout = new QVBoxLayout( rightPane );
// Left Pane
- leftPane->layout()->setMargin(0);
+ leftPane->layout()->setContentsMargins(0, 0, 0, 0);
leftPane->layout()->setSpacing(0);
SearchLineEdit *searchInput = new SearchLineEdit();
@@ -398,7 +398,7 @@ AddonsTab::AddonsTab( qt_intf_t *p_intf_ ) : QVLCFrame( p_intf_ )
ADDON_EXTENSION );
// Right Pane
- rightPane->layout()->setMargin(0);
+ rightPane->layout()->setContentsMargins(0, 0, 0, 0);
rightPane->layout()->setSpacing(0);
// Splitter sizes init
@@ -1278,7 +1278,7 @@ QWidget *AddonItemDelegate::createEditor( QWidget *parent,
QPushButton *infoButton;
editorWidget->setLayout( new QHBoxLayout() );
- editorWidget->layout()->setMargin( 0 );
+ editorWidget->layout()->setContentsMargins(0, 0, 0, 0);
infoButton = new QPushButton( QIcon( ":/menu/info.svg" ),
qtr( "More information..." ) );
=====================================
modules/gui/qt/dialogs/preferences/complete_preferences.cpp
=====================================
@@ -554,7 +554,7 @@ AdvPrefsPanel::AdvPrefsPanel( qt_intf_t *_p_intf, QWidget *_parent,
/* Widgets now */
global_layout = new QVBoxLayout();
- global_layout->setMargin( 2 );
+ global_layout->setContentsMargins(2, 2, 2, 2);
QLabel *titleLabel = new QLabel( heading );
QFont titleFont = QApplication::font();
=====================================
modules/gui/qt/dialogs/preferences/preferences.cpp
=====================================
@@ -69,7 +69,7 @@ PrefsDialog::PrefsDialog( QWindow *parent, qt_intf_t *_p_intf )
types->setAlignment( Qt::AlignHCenter );
QHBoxLayout *types_l = new QHBoxLayout;
types_l->setSpacing( 3 );
- types_l->setMargin( 3 );
+ types_l->setContentsMargins(3, 3, 3, 3);
simple = new QRadioButton( qtr( "Simple" ), types );
simple->setToolTip( qtr( "Switch to simple preferences view" ) );
all = new QRadioButton( qtr("All"), types );
@@ -110,9 +110,9 @@ PrefsDialog::PrefsDialog( QWindow *parent, qt_intf_t *_p_intf )
simple_split_widget->layout()->addWidget( simple_tree_panel );
simple_split_widget->layout()->addWidget( simple_panels_stack );
- simple_tree_panel->layout()->setMargin( 1 );
+ simple_tree_panel->layout()->setContentsMargins(1, 1, 1, 1);
simple_panels_stack->setContentsMargins( 6, 0, 0, 3 );
- simple_split_widget->layout()->setMargin( 0 );
+ simple_split_widget->layout()->setContentsMargins(0, 0, 0, 0);
stack->insertWidget( SIMPLE, simple_split_widget );
@@ -164,7 +164,7 @@ PrefsDialog::PrefsDialog( QWindow *parent, qt_intf_t *_p_intf )
main_layout->addWidget( types, 3, 0, 2, 1 );
main_layout->addWidget( buttonsBox, 4, 2, 1 ,1 );
main_layout->setRowStretch( 2, 4 );
- main_layout->setMargin( 9 );
+ main_layout->setContentsMargins(9, 9, 9, 9);
switch( var_InheritInteger( p_intf, "qt-initial-prefs-view" ) )
{
=====================================
modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
=====================================
@@ -330,7 +330,7 @@ void FileConfigControl::insertInto( QGridLayout *l, int line )
l->addWidget( label, line, 0 );
l->setColumnMinimumWidth( 1, 10 );
QHBoxLayout *textAndButton = new QHBoxLayout();
- textAndButton->setMargin( 0 );
+ textAndButton->setContentsMargins(0, 0, 0, 0);
textAndButton->addWidget( text, 2 );
textAndButton->addWidget( browse, 0 );
l->addLayout( textAndButton, line, LAST_COLUMN );
@@ -340,7 +340,7 @@ void FileConfigControl::insertInto( QBoxLayout *l, int index )
{
l->insertWidget( index, label );
QHBoxLayout *textAndButton = new QHBoxLayout();
- textAndButton->setMargin( 0 );
+ textAndButton->setContentsMargins(0, 0, 0, 0);
textAndButton->addWidget( text, 2 );
textAndButton->addWidget( browse, 0 );
l->insertLayout( index + 1, textAndButton );
=====================================
modules/gui/qt/dialogs/preferences/simple_preferences.cpp
=====================================
@@ -281,7 +281,7 @@ SPrefsCatList::SPrefsCatList( qt_intf_t *_p_intf, QWidget *_parent ) :
#undef ADD_CATEGORY
SPrefsInterface->setChecked( true );
- layout->setMargin( 0 );
+ layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing( 1 );
setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Preferred);
@@ -371,7 +371,7 @@ SPrefsPanel::SPrefsPanel( qt_intf_t *_p_intf, QWidget *_parent,
QVBoxLayout *panel_layout = new QVBoxLayout();
QWidget *panel = new QWidget();
- panel_layout->setMargin( 3 );
+ panel_layout->setContentsMargins(3, 3, 3, 3);
// Title Label
QLabel *panel_label = new QLabel;
=====================================
modules/gui/qt/medialibrary/mlrecentsmodel.cpp
=====================================
@@ -24,7 +24,7 @@
MLRecentMedia::MLRecentMedia( const vlc_ml_media_t *media )
: MLItem( MLItemId( media->i_id, VLC_ML_PARENT_UNKNOWN ) )
, m_url ( media->p_files->i_nb_items > 0 ? media->p_files->p_items[0].psz_mrl : "" )
- , m_lastPlayedDate(QDateTime::fromTime_t( media->i_last_played_date ))
+ , m_lastPlayedDate(QDateTime::fromSecsSinceEpoch( media->i_last_played_date ))
{
}
=====================================
modules/gui/qt/medialibrary/mlurlmodel.cpp
=====================================
@@ -109,7 +109,7 @@ MLUrl::MLUrl(const vlc_ml_media_t *_data)
: MLItem( MLItemId( _data->i_id, VLC_ML_PARENT_UNKNOWN ) )
, m_url( _data->p_files->i_nb_items > 0 ? _data->p_files->p_items[0].psz_mrl : "" )
, m_lastPlayedDate(
- QDateTime::fromTime_t( _data->i_last_played_date ).toString( QLocale::system().dateFormat( QLocale::ShortFormat ) )
+ QDateTime::fromSecsSinceEpoch( _data->i_last_played_date ).toString( QLocale::system().dateFormat( QLocale::ShortFormat ) )
)
{
}
=====================================
modules/gui/qt/widgets/native/qvlcframe.cpp
=====================================
@@ -178,7 +178,7 @@ bool QVLCTools::restoreWidgetPosition(QSettings *settings, QWidget *widget,
widget->resize(defSize);
if (defPos.x() == 0 && defPos.y()==0)
- widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget->size(), qApp->desktop()->availableGeometry()));
+ widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget->size(), qApp->primaryScreen()->availableGeometry()));
return true;
}
return false;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1e244e3b5605a00c653be6632c5638d81385b3b9...ed986711c159499b873157d4e5d4a53026d94719
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1e244e3b5605a00c653be6632c5638d81385b3b9...ed986711c159499b873157d4e5d4a53026d94719
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list