@@ -87,9 +87,9 @@ void EditDialog::setCurrentIndex(const QModelIndex& idx)
8787{
8888 currentIndex = QPersistentModelIndex (idx);
8989
90- QByteArray data = idx.data (Qt::EditRole).toByteArray ();
91- loadData (data );
92- updateCellInfoAndMode (data );
90+ QByteArray bArrData = idx.data (Qt::EditRole).toByteArray ();
91+ loadData (bArrData );
92+ updateCellInfoAndMode (bArrData );
9393
9494 ui->buttonApply ->setDisabled (true );
9595}
@@ -113,7 +113,7 @@ void EditDialog::reject()
113113}
114114
115115// Loads data from a cell into the Edit Cell window
116- void EditDialog::loadData (const QByteArray& data )
116+ void EditDialog::loadData (const QByteArray& bArrdata )
117117{
118118 QImage img;
119119 QString textData;
@@ -122,7 +122,7 @@ void EditDialog::loadData(const QByteArray& data)
122122 removedBom.clear ();
123123
124124 // Determine the data type, saving that info in the class variable
125- dataType = checkDataType (data );
125+ dataType = checkDataType (bArrdata );
126126
127127 // Get the current editor mode (eg text, hex, image, json or xml mode)
128128 int editMode = ui->comboMode ->currentIndex ();
@@ -150,7 +150,7 @@ void EditDialog::loadData(const QByteArray& data)
150150 dataSource = HexBuffer;
151151
152152 // Load the Null into the hex editor
153- hexEdit->setData (data );
153+ hexEdit->setData (bArrdata );
154154
155155 break ;
156156
@@ -162,7 +162,7 @@ void EditDialog::loadData(const QByteArray& data)
162162 ui->editorImage ->setPixmap (QPixmap (0 ,0 ));
163163
164164 // Load the Null into the hex editor
165- hexEdit->setData (data );
165+ hexEdit->setData (bArrdata );
166166
167167 break ;
168168 }
@@ -177,10 +177,10 @@ void EditDialog::loadData(const QByteArray& data)
177177 case TextEditor:
178178 case JsonEditor:
179179 case XmlEditor:
180- setDataInBuffer (data , SciBuffer);
180+ setDataInBuffer (bArrdata , SciBuffer);
181181 break ;
182182 case HexEditor:
183- setDataInBuffer (data , HexBuffer);
183+ setDataInBuffer (bArrdata , HexBuffer);
184184 break ;
185185 case ImageViewer:
186186 // The image viewer cannot hold data nor display text.
@@ -189,7 +189,7 @@ void EditDialog::loadData(const QByteArray& data)
189189 ui->editorImage ->setPixmap (QPixmap (0 ,0 ));
190190
191191 // Load the text into the text editor
192- setDataInBuffer (data , SciBuffer);
192+ setDataInBuffer (bArrdata , SciBuffer);
193193
194194 break ;
195195 }
@@ -200,7 +200,7 @@ void EditDialog::loadData(const QByteArray& data)
200200 // stored it in the editorImage widget instead, it would be a pixmap
201201 // and there's no good way to restore that back to the original
202202 // (pristine) image data. eg image metadata would be lost
203- setDataInBuffer (data , HexBuffer);
203+ setDataInBuffer (bArrdata , HexBuffer);
204204
205205 // Update the display if in text edit or image viewer mode
206206 switch (editMode) {
@@ -217,7 +217,7 @@ void EditDialog::loadData(const QByteArray& data)
217217
218218 case ImageViewer:
219219 // Load the image into the image viewing widget
220- if (img.loadFromData (data )) {
220+ if (img.loadFromData (bArrdata )) {
221221 ui->editorImage ->setPixmap (QPixmap::fromImage (img));
222222 }
223223 break ;
@@ -230,21 +230,21 @@ void EditDialog::loadData(const QByteArray& data)
230230 case JsonEditor:
231231 case XmlEditor:
232232
233- setDataInBuffer (data , SciBuffer);
233+ setDataInBuffer (bArrdata , SciBuffer);
234234 break ;
235235
236236 case HexEditor:
237237
238- setDataInBuffer (data , HexBuffer);
238+ setDataInBuffer (bArrdata , HexBuffer);
239239 break ;
240240
241241 case ImageViewer:
242242 // Set data in the XML (Sci) Buffer and load the SVG Image
243- setDataInBuffer (data , SciBuffer);
243+ setDataInBuffer (bArrdata , SciBuffer);
244244 sciEdit->setLanguage (DockTextEdit::XML);
245245
246246 // Load the image into the image viewing widget
247- if (img.loadFromData (data )) {
247+ if (img.loadFromData (bArrdata )) {
248248 ui->editorImage ->setPixmap (QPixmap::fromImage (img));
249249 }
250250 break ;
@@ -257,7 +257,7 @@ void EditDialog::loadData(const QByteArray& data)
257257 // into the hex widget (the only safe place for it)
258258
259259 // Load the data into the hex buffer
260- setDataInBuffer (data , HexBuffer);
260+ setDataInBuffer (bArrdata , HexBuffer);
261261
262262 switch (editMode) {
263263 case TextEditor:
@@ -555,7 +555,7 @@ void EditDialog::accept()
555555 }
556556}
557557
558- void EditDialog::setDataInBuffer (const QByteArray& data , DataSources source)
558+ void EditDialog::setDataInBuffer (const QByteArray& bArrdata , DataSources source)
559559{
560560 dataSource = source;
561561 QString textData;
@@ -569,7 +569,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
569569 case DockTextEdit::PlainText:
570570 {
571571 // Load the text into the text editor, remove BOM first if there is one
572- QByteArray dataWithoutBom = data ;
572+ QByteArray dataWithoutBom = bArrdata ;
573573 removedBom = removeBom (dataWithoutBom);
574574
575575 textData = QString::fromUtf8 (dataWithoutBom.constData (), dataWithoutBom.size ());
@@ -588,7 +588,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
588588 json jsonDoc;
589589
590590 try {
591- jsonDoc = json::parse (std::string (data .constData (), static_cast <size_t >(data .size ())));
591+ jsonDoc = json::parse (std::string (bArrdata .constData (), static_cast <size_t >(bArrdata .size ())));
592592 } catch (json::parse_error& parseError) {
593593 sciEdit->setErrorIndicator (static_cast <int >(parseError.byte - 1 ));
594594 }
@@ -598,7 +598,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
598598 textData = QString::fromStdString (jsonDoc.dump (4 ));
599599 } else {
600600 // Fallback case. The data is not yet valid JSON or no auto-formatting applied.
601- textData = QString::fromUtf8 (data .constData (), data .size ());
601+ textData = QString::fromUtf8 (bArrdata .constData (), bArrdata .size ());
602602 }
603603
604604 sciEdit->setText (textData);
@@ -612,14 +612,14 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
612612 QString errorMsg;
613613 int errorLine, errorColumn;
614614 QDomDocument xmlDoc;
615- bool isValid = xmlDoc.setContent (data , true , &errorMsg, &errorLine, &errorColumn);
615+ bool isValid = xmlDoc.setContent (bArrdata , true , &errorMsg, &errorLine, &errorColumn);
616616
617617 if (mustIndentAndCompact && isValid) {
618618 // Load indented XML into the XML editor
619619 textData = xmlDoc.toString (Settings::getValue (" editor" , " tabsize" ).toInt ());
620620 } else {
621621 // Fallback case. The data is not yet valid JSON or no auto-formatting applied.
622- textData = QString::fromUtf8 (data .constData (), data .size ());
622+ textData = QString::fromUtf8 (bArrdata .constData (), bArrdata .size ());
623623 }
624624 sciEdit->setText (textData);
625625
@@ -634,7 +634,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source)
634634 }
635635 break ;
636636 case HexBuffer:
637- hexEdit->setData (data );
637+ hexEdit->setData (bArrdata );
638638 hexEdit->setEnabled (true );
639639
640640 break ;
@@ -669,12 +669,12 @@ void EditDialog::editModeChanged(int newMode)
669669 case ImageViewer:
670670 {
671671 // When SVG format, load the image, else clear it.
672- QByteArray data = sciEdit->text ().toUtf8 ();
673- dataType = checkDataType (data );
672+ QByteArray bArrdata = sciEdit->text ().toUtf8 ();
673+ dataType = checkDataType (bArrdata );
674674 if (dataType == SVG) {
675675 QImage img;
676676
677- if (img.loadFromData (data ))
677+ if (img.loadFromData (bArrdata ))
678678 ui->editorImage ->setPixmap (QPixmap::fromImage (img));
679679 else
680680 // Clear any image from the image viewing widget
@@ -729,9 +729,9 @@ void EditDialog::setMustIndentAndCompact(bool enable)
729729}
730730
731731// Determine the type of data in the cell
732- int EditDialog::checkDataType (const QByteArray& data )
732+ int EditDialog::checkDataType (const QByteArray& bArrdata )
733733{
734- QByteArray cellData = data ;
734+ QByteArray cellData = bArrdata ;
735735
736736 // Check for NULL data type
737737 if (cellData.isNull ()) {
@@ -840,9 +840,9 @@ void EditDialog::switchEditorMode(bool autoSwitchForType)
840840
841841// Update the information labels in the bottom left corner of the dialog
842842// and switches the editor mode, if required, according to the detected data type.
843- void EditDialog::updateCellInfoAndMode (const QByteArray& data )
843+ void EditDialog::updateCellInfoAndMode (const QByteArray& bArrdata )
844844{
845- QByteArray cellData = data ;
845+ QByteArray cellData = bArrdata ;
846846
847847 switchEditorMode (ui->buttonAutoSwitchMode ->isChecked ());
848848
0 commit comments