Commit 17bf5af9 authored by Allen Winter's avatar Allen Winter
Browse files

passbyvalue fixes.

fix the deprecated QDateTime::currentDateTime(Qt::TimeSpec)

svn path=/trunk/KDE/kdepim/konsolekalendar/; revision=568411
parent c9f787b1
......@@ -58,14 +58,14 @@ QDateTime KonsoleKalendarEpoch::epoch2QDateTime( uint epoch )
}
// Function to convert a QDateTime value into an epoch
uint KonsoleKalendarEpoch::QDateTime2epoch( QDateTime dt )
uint KonsoleKalendarEpoch::QDateTime2epoch( const QDateTime &dt )
{
// THIS FUNCTION CAN BE OFF BY 1 HOUR DUE TO DAYLIGHT SAVINGS TIME.
// SORRY QT DOESN'T HANDLE DAYLIGHT SAVINGS TIME.
// Compute #seconds to subtract for local timezone difference from UTC.
int offset = QDateTime::currentDateTime( Qt::UTC ).toTime_t()
- QDateTime::currentDateTime( Qt::LocalTime ).toTime_t();
int offset = QDateTime::currentDateTime().toUTC().toTime_t()
- QDateTime::currentDateTime().toTime_t();
return( dt.toTime_t() - offset );
}
......
......@@ -63,7 +63,7 @@ namespace KCal
* Converts QT DateTime to epoch format.
* @param dt is a QDateTime to convert to an epoch.
*/
static uint QDateTime2epoch( QDateTime dt );
static uint QDateTime2epoch( const QDateTime &dt );
};
......
......@@ -197,14 +197,16 @@ bool KonsoleKalendarExports::exportAsTxtShort( QTextStream *ts,
return true;
}
QString KonsoleKalendarExports::processField( QString field, QString dquote )
QString KonsoleKalendarExports::processField( const QString &field,
const QString &dquote )
{
// little function that processes a field for CSV compliance:
// 1. Replaces double quotes by a pair of consecutive double quotes
// 2. Surrounds field with double quotes
QString double_dquote = dquote + dquote;
QString retField = dquote + field.replace( dquote, double_dquote ) + dquote;
QString retField = field;
retField = dquote + retField.replace( dquote, double_dquote ) + dquote;
return retField;
}
......
......@@ -93,7 +93,7 @@ namespace KCal
* @param field is the field value to be processed.
* @param dquote is a QString containing the double quote character.
*/
QString processField( QString field, QString dquote );
QString processField( const QString &field, const QString &dquote );
};
......
......@@ -79,7 +79,7 @@ KonsoleKalendarVariables::~KonsoleKalendarVariables()
// delete m_resource;
}
void KonsoleKalendarVariables::setUID( QString uid )
void KonsoleKalendarVariables::setUID( const QString &uid )
{
m_bIsUID = true;
m_UID = uid;
......@@ -95,7 +95,7 @@ bool KonsoleKalendarVariables::isUID()
return m_bIsUID;
}
void KonsoleKalendarVariables::setStartDateTime( QDateTime start )
void KonsoleKalendarVariables::setStartDateTime( const QDateTime &start )
{
m_bIsStartDateTime = true;
m_startDateTime = start;
......@@ -111,7 +111,7 @@ bool KonsoleKalendarVariables::isStartDateTime()
return m_bIsStartDateTime;
}
void KonsoleKalendarVariables::setEndDateTime( QDateTime end )
void KonsoleKalendarVariables::setEndDateTime( const QDateTime &end )
{
m_bIsEndDateTime = true;
m_endDateTime = end;
......@@ -187,7 +187,7 @@ bool KonsoleKalendarVariables::getUseJournals()
return( m_bUseJournals );
}
void KonsoleKalendarVariables::setCalendarFile( QString calendar )
void KonsoleKalendarVariables::setCalendarFile( const QString &calendar )
{
m_calendar = calendar;
}
......@@ -197,7 +197,7 @@ QString KonsoleKalendarVariables::getCalendarFile()
return m_calendar;
}
void KonsoleKalendarVariables::setImportFile( QString calendar )
void KonsoleKalendarVariables::setImportFile( const QString &calendar )
{
m_import = calendar;
}
......@@ -227,7 +227,7 @@ ExportType KonsoleKalendarVariables::getExportType()
return m_exportType;
}
void KonsoleKalendarVariables::setExportFile( QString export_file )
void KonsoleKalendarVariables::setExportFile( const QString &export_file )
{
m_exportFile = export_file;
m_bIsExportFile = true;
......@@ -258,7 +258,7 @@ bool KonsoleKalendarVariables::getAll()
return m_bAll;
}
void KonsoleKalendarVariables::setDescription( QString description )
void KonsoleKalendarVariables::setDescription( const QString &description )
{
m_bDescription = true;
m_description = description;
......@@ -274,7 +274,7 @@ bool KonsoleKalendarVariables::isDescription()
return m_bDescription;
}
void KonsoleKalendarVariables::setLocation( QString location )
void KonsoleKalendarVariables::setLocation( const QString &location )
{
m_bLocation = true;
m_location = location;
......@@ -290,7 +290,7 @@ bool KonsoleKalendarVariables::isLocation()
return m_bLocation;
}
void KonsoleKalendarVariables::setSummary( QString summary )
void KonsoleKalendarVariables::setSummary( const QString &summary )
{
m_bSummary = true;
m_summary = summary;
......
......@@ -123,7 +123,7 @@ namespace KCal
* Sets start date.
* @param start is the start date.
*/
void setStartDateTime( QDateTime start );
void setStartDateTime( const QDateTime &start );
/**
* Get start date.
......@@ -141,7 +141,7 @@ namespace KCal
* Sets end date.
* @param end is the enddate.
*/
void setEndDateTime( QDateTime end );
void setEndDateTime( const QDateTime &end );
/**
* Get end date.
......@@ -159,7 +159,7 @@ namespace KCal
* Sets the UID, the unique tag for VCard entry.
* @param uid unique tag for VCard entry.
*/
void setUID( QString uid );
void setUID( const QString &uid );
/**
* Get UID, the unique tag for VCard entry.
......@@ -211,7 +211,7 @@ namespace KCal
* Set calendar file
* @param calendar Calendar files full path.
*/
void setCalendarFile( QString calendar );
void setCalendarFile( const QString &calendar );
/**
* Returns fullpath to calendar file.
......@@ -223,7 +223,7 @@ namespace KCal
* Set file to import active calendar.
* @param calendar Calendar file to import.
*/
void setImportFile( QString calendar );
void setImportFile( const QString &calendar );
/**
* Return import filename.
......@@ -235,7 +235,7 @@ namespace KCal
* Add description.
* @param description to event.
*/
void setDescription( QString description );
void setDescription( const QString &description );
/**
* Return description.
......@@ -253,7 +253,7 @@ namespace KCal
* Add location information.
* @param location location where the event occurs.
*/
void setLocation( QString location );
void setLocation( const QString &location );
/**
* Return location information.
......@@ -271,7 +271,7 @@ namespace KCal
* Add summary.
* @param summary event summary.
*/
void setSummary( QString summary );
void setSummary( const QString &summary );
/**
* Get summary.
......@@ -324,7 +324,7 @@ namespace KCal
/**
* Set output file.
*/
void setExportFile( QString export_file );
void setExportFile( const QString &export_file );
/**
* To what file we'll output.
......
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